Ulic and Cay Posted August 18, 2007 Share Posted August 18, 2007 So I have some questions about using the "ActionPlayAnimation()" command. I've been faking my understanding of this function for awhile now and I'm hoping that someone can set me straight. Let me lay out a little experiment for you. Lets say I want to have a NPC call some animation. I open up the animations.2da (seems a good place to start) and pick an animation randomly lets say: animations.2da Label: Name: Description: ... 37 inject Inject_Self_In_Leg ... so I write a simple script... void main() { object oAtton = GetObjectByTag("Atton", 0); AssignCommand(oAtton, ActionPlayAnimation(37, 1.0, 0.0)); } ...and have it call, but to my surprise Atton sits, as if at a table, rather than injecting himself in the leg. So what's the deal? Why did this happen? I'm guessing I'm either looking in the wrong place for a list of animations or not identifying the animation correctly right? So where can I find a list, or several lists as the case may be, of animations I can call with a script/how do I identify the animation? Link to comment Share on other sites More sharing options...
stoffe Posted August 18, 2007 Share Posted August 18, 2007 I open up the animations.2da (seems a good place to start) and pick an animation randomly lets say: 37 inject Inject_Self_In_Leg ...and have it call, but to my surprise Atton sits, as if at a table, rather than injecting himself in the leg. So what's the deal? The number 37 in this case corresponds to one of the ANIMATION_ constants declared in nwscript.nss, ANIMATION_LOOPING_SIT_CHAIR_DRINK. I don't remember what these numbers references, hopefully someone else can help with that. // Looping animation constants. int ANIMATION_LOOPING_PAUSE = 0; int ANIMATION_LOOPING_PAUSE2 = 1; int ANIMATION_LOOPING_LISTEN = 2; int ANIMATION_LOOPING_MEDITATE = 3; int ANIMATION_LOOPING_WORSHIP = 4; int ANIMATION_LOOPING_TALK_NORMAL = 5; int ANIMATION_LOOPING_TALK_PLEADING = 6; int ANIMATION_LOOPING_TALK_FORCEFUL = 7; int ANIMATION_LOOPING_TALK_LAUGHING = 8; int ANIMATION_LOOPING_TALK_SAD = 9; int ANIMATION_LOOPING_GET_LOW = 10; int ANIMATION_LOOPING_GET_MID = 11; int ANIMATION_LOOPING_PAUSE_TIRED = 12; int ANIMATION_LOOPING_PAUSE_DRUNK = 13; int ANIMATION_LOOPING_FLIRT = 14; int ANIMATION_LOOPING_USE_COMPUTER = 15; int ANIMATION_LOOPING_DANCE = 16; int ANIMATION_LOOPING_DANCE1 = 17; int ANIMATION_LOOPING_HORROR = 18; int ANIMATION_LOOPING_READY = 19; int ANIMATION_LOOPING_DEACTIVATE = 20; int ANIMATION_LOOPING_SPASM = 21; int ANIMATION_LOOPING_SLEEP = 22; int ANIMATION_LOOPING_PRONE = 23; int ANIMATION_LOOPING_PAUSE3 = 24; int ANIMATION_LOOPING_WELD = 25; int ANIMATION_LOOPING_DEAD = 26; int ANIMATION_LOOPING_TALK_INJURED = 27; int ANIMATION_LOOPING_LISTEN_INJURED = 28; int ANIMATION_LOOPING_TREAT_INJURED = 29; int ANIMATION_LOOPING_DEAD_PRONE = 30; int ANIMATION_LOOPING_KNEEL_TALK_ANGRY = 31; int ANIMATION_LOOPING_KNEEL_TALK_SAD = 32; int ANIMATION_LOOPING_CHECK_BODY = 33; int ANIMATION_LOOPING_UNLOCK_DOOR = 34; int ANIMATION_LOOPING_SIT_AND_MEDITATE = 35; int ANIMATION_LOOPING_SIT_CHAIR = 36; [color=Yellow]int ANIMATION_LOOPING_SIT_CHAIR_DRINK = 37;[/color] int ANIMATION_LOOPING_SIT_CHAIR_PAZAK = 38; int ANIMATION_LOOPING_SIT_CHAIR_COMP1 = 39; int ANIMATION_LOOPING_SIT_CHAIR_COMP2 = 40; int ANIMATION_LOOPING_RAGE = 41; int ANIMATION_LOOPING_CLOSED = 43; int ANIMATION_LOOPING_STEALTH = 44; int ANIMATION_LOOPING_CHOKE_WORKING = 45; int ANIMATION_LOOPING_MEDITATE_STAND = 46; int ANIMATION_LOOPING_CHOKE = 116; // Fire and forget animation constants. int ANIMATION_FIREFORGET_HEAD_TURN_LEFT = 100; int ANIMATION_FIREFORGET_HEAD_TURN_RIGHT = 101; int ANIMATION_FIREFORGET_PAUSE_SCRATCH_HEAD = 102; int ANIMATION_FIREFORGET_PAUSE_BORED = 103; int ANIMATION_FIREFORGET_SALUTE = 104; int ANIMATION_FIREFORGET_BOW = 105; int ANIMATION_FIREFORGET_GREETING = 106; int ANIMATION_FIREFORGET_TAUNT = 107; int ANIMATION_FIREFORGET_VICTORY1 = 108; int ANIMATION_FIREFORGET_VICTORY2 = 109; int ANIMATION_FIREFORGET_VICTORY3 = 110; int ANIMATION_FIREFORGET_INJECT = 112; int ANIMATION_FIREFORGET_USE_COMPUTER = 113; int ANIMATION_FIREFORGET_PERSUADE = 114; int ANIMATION_FIREFORGET_ACTIVATE = 115; int ANIMATION_FIREFORGET_THROW_HIGH = 117; int ANIMATION_FIREFORGET_THROW_LOW = 118; int ANIMATION_FIREFORGET_CUSTOM01 = 119; int ANIMATION_FIREFORGET_TREAT_INJURED = 120; int ANIMATION_FIREFORGET_FORCE_CAST = 121; int ANIMATION_FIREFORGET_OPEN = 122; int ANIMATION_FIREFORGET_DIVE_ROLL = 123; int ANIMATION_FIREFORGET_SCREAM = 124; // Placeable animation constants int ANIMATION_PLACEABLE_ACTIVATE = 200; int ANIMATION_PLACEABLE_DEACTIVATE = 201; int ANIMATION_PLACEABLE_OPEN = 202; int ANIMATION_PLACEABLE_CLOSE = 203; Link to comment Share on other sites More sharing options...
Pavlos Posted August 18, 2007 Share Posted August 18, 2007 Hehe, the good old animation craziness. If you want to play an animation listed in animations.2da you need to add 10 000 to the value. Otherwise, you're either referencing an animation that doesn't exist, or one listed in NWScript. In your case, by putting 37 down, you're playing the animation ANIMATION_LOOPING_SIT_CHAIR_DRINK . Your script is fine, it just needs a tweak to get the animation correct: void main() { object oAtton = GetObjectByTag("Atton", 0); AssignCommand(oAtton, ActionPlayAnimation(10037, 1.0, 0.0)); } Link to comment Share on other sites More sharing options...
Ulic and Cay Posted August 18, 2007 Author Share Posted August 18, 2007 Ahhh. "Add 10,000 to the value" that's not very intuitive is it? I mean I never would have figured that out on my own. How could I have figured that out on my own? Is that written down somewhere, I mean in the nwscript.nss or something or was this a question I really had to ask here? I looked for a tutorial on animations but couldn't find one. Anyway thanks for the help guys. Link to comment Share on other sites More sharing options...
Pavlos Posted August 18, 2007 Share Posted August 18, 2007 Ahhh. "Add 10,000 to the value" that's not very intuitive is it? I mean I never would have figured that out on my own. How could I have figured that out on my own? Is that written down somewhere, I mean in the nwscript.nss or something or was this a question I really had to ask here? I looked for a tutorial on animations but couldn't find one. Anyway thanks for the help guys. Nowhere. It comes from decompiling scripts. If this isn't common knowledge, then perhaps it would be beneficial to move this thread to the scripting forum. Link to comment Share on other sites More sharing options...
Ulic and Cay Posted August 19, 2007 Author Share Posted August 19, 2007 Nowhere. It comes from decompiling scripts. If this isn't common knowledge, then perhaps it would be beneficial to move this thread to the scripting forum. I see, well I didn't know, that's not to say that it isn't common knowledge. I'll be the first to admit that my understanding is limited. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.