Game Development Community

Animation script

by Adam Troutman · in Artist Corner · 03/29/2006 (11:21 am) · 2 replies

Ok so I am working on a pickaxe object and I am wondering how the sequences.
this is what I have so far but I am not sure that I am doing it right since I don't have any melee type objects to look at as an example,


statename[0] = "Active";
stateTransitionOnTimeout[0] = "Ready";

statename[1] = "Ready";
stateTransitionOnTriggerDown[1] = "swing";

statename[2] = "swing";
(now here I should call the swinging animation right? if it were a gun it would use this

stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.2;
stateFire[3] = true;
stateRecoil[3] = LightRecoil;
stateAllowImageChange[3] = false;
stateSequence[3] = "Fire";
stateScript[3] = "onFire";
instead of saying "fire" i used swing, can I do that, now how exactly is this calling the fire animation and what would I need to put instead to play a swinging animation.
( stateScript[3] = "onFire"; this is calling a script? if so where is that located?




Sorry if I complicated this to much, just trying to understand.

Thanks.

#1
03/29/2006 (11:44 am)
The onFire script should be located beneath the datablock definition. you can place and call a script which runs a swinging animation at any point. the reason the weapon shapebaseimagedata uses so many different states is because it's the nature of how guns are handled. they must be able to activate or intialize to a ready state, shoot, reload, check ammo, dry fire, etc. you don't need that many states for a melee weapon i think. you would just need two, ready and swing. swing should call an animation on the player character, i dont think weapon images can be animated themselves.
#2
03/29/2006 (11:50 am)
Okay, thanks, that is helpful could you explain how exactly I would call the animation I don't understand how that is done.

I see the fire script, since I am not firing anything I wouldnt even need that right?
stateSequence[3] = "Fire"; is calling the animation correct? so if I make a swinging animation I would call it by simply changing "Fire" to "swinging"?