Weapon State Transitions
by Mason Baron · in Torque Game Engine · 07/23/2005 (2:34 pm) · 0 replies
Is there a way to change the state of a weapon in script?
for example, if I'm in the onFire() callback, and want to return to the "Ready" state (but not due to timeout, trigger. ammo or any of the existing transitions)... any ideas?
I tried creating a ConsoleMethod which calls the following code:
voidPlayer::BlahBlahBlah(int imageSlot)
{
S32 readyState = getMountedImage(imageSlot)->lookupState("Ready");
setImageState(imageSlot, readyState, true);
}
but I'm guessing that's a pretty dangerous thing to do (since in one case it crashed the game)
thanks,
mason
for example, if I'm in the onFire() callback, and want to return to the "Ready" state (but not due to timeout, trigger. ammo or any of the existing transitions)... any ideas?
I tried creating a ConsoleMethod which calls the following code:
voidPlayer::BlahBlahBlah(int imageSlot)
{
S32 readyState = getMountedImage(imageSlot)->lookupState("Ready");
setImageState(imageSlot, readyState, true);
}
but I'm guessing that's a pretty dangerous thing to do (since in one case it crashed the game)
thanks,
mason