Author Topic: How do you activate an animation in a weapon?  (Read 500 times)

Hey, as many of you may know, I'm learning how to make some addons mahsalf. I FULLY understand every part of making an addon, but scripting. So, today, I'd like to know how you activate an animtion on a weapon in the script. What I'm using it for:
CheyTac M-200 INTERVENTION
(I want the bolt action to work)

Please help!

Code: [Select]
stateSequence[x] = "ANIMATION NAME";You have to have the model animated, of course.

where would this go exactly?

where would this go exactly?
In the image.
If you don't know how to use the state system you might as well get another scripter to do this for you. It's pretty straightforward though, try reading through the gun's.

Code: [Select]
// Initial start up state
stateName[0]                     = "Activate";
stateTimeoutValue[0]             = 0.15;
stateTransitionOnTimeout[0]       = "Ready";
stateSound[0] = weaponSwitchSound;

stateName[1]                     = "Ready";
stateTransitionOnTriggerDown[1]  = "Fire";
stateAllowImageChange[1]         = true;
stateSequence[1] = "Ready";

stateName[2]                    = "Fire";
stateTransitionOnTimeout[2]     = "Smoke";
stateTimeoutValue[2]            = 1.00;
stateFire[2]                    = true;
stateAllowImageChange[2]        = false;
stateSequence[2]                = "Fire";
stateScript[2]                  = "onFire";
stateWaitForTimeout[2] = true;
stateEmitter[2] = InterventionFlashEmitter;
stateEmitterTime[2] = 0.05;
stateEmitterNode[2] = "muzzleNode";
stateSound[2] = InterventionShot1Sound;
stateEjectShell[2]       = true;

stateName[3] = "Smoke";
stateEmitter[3] = InterventionSmokeEmitter;
stateEmitterTime[3] = 0.05;
stateEmitterNode[3] = "muzzleNode";
stateTimeoutValue[3]            = 0.01;
stateTransitionOnTimeout[3]     = "Reload";

stateName[4] = "Reload";
stateSequence[4]                = "Reload";
stateTransitionOnTriggerUp[4]     = "Ready";
stateSequence[4] = "Ready";

};

Heres the code. The animation name is Reload. I'm pretty sure this is correct.
Its just a sniper. I want it to "Reload" after I fire (bolt action sniper). So if anything is not right point it out. I don't really want to have another person script it because I need to learn how to do this stuff so I don't need to be dependant on other peoples skills.

Edit:

Well, I'm lookin at the AWM cause im tryin to do what its doin, but it uses two different animations so its confuzzling me.
« Last Edit: February 15, 2010, 01:16:52 PM by ShadowsfeaR »