Author Topic: Fire animation gets kinda ignored.  (Read 853 times)

So as the subject says. When fireing my gun, the custom fire animation that i use gets executed. But, the problem is that the regular fire animation from the default gun gets messed up together, and creates this.

VIDEO : http://www.youtube.com/watch?v=dieSPAs58UE

Heres my line of code
Code: [Select]
stateName[0]                    = "Activate";
stateTimeoutValue[0]            = 0.42;
stateSequence[0] = "Use";
stateTransitionOnTimeout[0]      = "LoadCheckA";
stateSound[0] = "DeagleUseSound";

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

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

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

stateName[4] = "Wait";
stateTimeoutValue[4] = 0.375;
stateTransitionOnTimeout[4] = "LoadCheckA";

// Some ammo script
stateName[5] = "LoadCheckA";
stateScript[5] = "onLoadCheck";
stateTimeoutValue[5] = 0.01;
stateTransitionOnTimeout[5] = "LoadCheckB";

stateName[6] = "LoadCheckB";
stateTransitionOnAmmo[6] = "Ready";
stateTransitionOnNoAmmo[6] = "ReloadWait";

stateName[7] = "ReloadWait";
stateTimeoutValue[7] = 0.48;
stateScript[7] = "";
stateTransitionOnTimeout[7] = "ReloadStart";
stateWaitForTimeout[7] = true;

stateName[8] = "ReloadStart";
stateTimeoutValue[8] = 0.48;
stateScript[8] = "onReloadStart";
stateTransitionOnTimeout[8] = "Reloaded";
stateWaitForTimeout[8] = true;
stateSound[8] = DeagleClipOutSound;
stateSequence[8] = "reload";

stateName[9] = "Reloaded";
stateTimeoutValue[9] = 0.48;
stateScript[9] = "onReloaded";
stateTransitionOnTimeout[9] = "Ready";
stateSound[9] = DeagleClipInSound;
stateSequence[9] = "reload2";

};

One "fix" that i found is that. If you set the eye Offset to any certain value, my animation gets fixed. But when you walk the deagle doesn't do that bump up and down animation. Basically the deagle is static when you walk.

Has nothing to do with the weapon states I don't think. I believe that somewhere in the ::onFire method, a line of code is making your arm move up so look for something like this:

Quote
function DeagleImage::onFire(%this, %obj, %slot)
{
        %obj.playThread(2, shiftAway);
}

and delete the line in bold.

Has nothing to do with the weapon states I don't think. I believe that somewhere in the ::onFire method, a line of code is making your arm move up so look for something like this:

and delete the line in bold.

Damn, didn't see that piece of code. Thanks : )