Author Topic: Exporting/naming animations in milkshape?  (Read 1212 times)

I've been learning how to animate, and i can animate in milkshape now,
but what i don't know is how to export the animation or name the animation.
Help?
« Last Edit: March 06, 2011, 01:12:21 AM by Arcturus »

Let's assume you've made two animations (examples). One is from frame1 to frame12, the second is from frame13 to frame15.
Let's say the first animation is a reload, the second is a magazine replacement.

Go to File>Export>Torque DTS Plus.
Click on Add, set the name for the reload animation here (we'll call it Animation1) under "Name".
Set "First Frame" to 1, and "Last Frame" to 12. Click OK.

Let's set the second. Click Add, set the name for the magazine replacement animation (we'll call it Animation2).
Set "First Frame" to 13, and "Last Frame" to 15. Click OK.

By default, you don't need to touch the other options. Cycle is for looping animations, such as a propeller.
You can leave all this alone and just click OK.

Export the rest like normal, and you're done.


Now, in the script of add-ons you have to set these animations that are known as sequences.
The script block usually looks like this.

Code: [Select]
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]            = 0.14;
stateFire[2]                    = true;
stateAllowImageChange[2]        = false;
stateSequence[2]                = "Fire";
stateScript[2]                  = "onFire";
stateWaitForTimeout[2] = true;
stateEmitter[2] = gunFlashEmitter;
stateEmitterTime[2] = 0.05;
stateEmitterNode[2] = "muzzleNode";
stateSound[2] = gunShot1Sound;
stateEjectShell[2]       = true;

stateName[3] = "Smoke";
stateEmitter[3] = gunSmokeEmitter;
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";

};
This is from the Weapon_Gun's server script.

What you're looking for is stateSequence[numberHere] = "namehere";
For example.

Code: [Select]
stateName[4] = "Animation1";
This will make the reload animation occur at this state in time.
Scripting is not really my thing, so explaining more detailed is off limits for me.

I hope this helps, if not I'll just do it again with pictures to try and explain it more easily.
« Last Edit: March 06, 2011, 01:31:10 AM by Blastdown »

Thank you! I'll try that out now.