Author Topic: Animating a Model  (Read 1521 times)

So, I'm working on the Medieval Mod, and I'm currently working on the Bloktard Sword. What I need to know, is how I'd get the model to animate when the weapon fires?

And, if you don't mind, how many frames is the swing animation for a Blockhead?

When the sword fires, it's not the sword that's animating.  It's the player model performing the mêlée animation that causes the sword to rotate.  So, just make sure the weapon is setup to be a mêlée weapon.

Indeed. Only weapons that move themselves (such as the Bow when firing an arrow) need to be animated. The sword, which only rotates, does not need to be animated.

Edit: I fold my hand, I have no idea how to animate a weapon with models, but I do know one thing:
Code: [Select]
stateSequence[2]                = "Fire";
Those Sequence lines have something to do with model animation. (Found from Bow/Minigun/Auto Rocket Launcher)
« Last Edit: November 13, 2007, 09:26:43 AM by Dilt »

No, no, no: The thing is, I *want* the sword to animate

That's stupid.  I recommend against animating a sword.

However, you would just use the playAnimation or whatever the method is.  Like ::onFire %obj.playAnimation("swordattack");.

%obj.playThread(1,armAttack);

Yeah, playThread.  Couldn't remember.

http://www.geocities.com/mkia1/Torque_Tutorial_1_1.html

This helped me understand model animations quite a bit. This works for milkshape.

There are a couple easy steps to making a weapon animate when you hit the "Fire" state image sequence.

1- Make the animation using whatever amount of keyframes (example, the animation  in this case goes from the 1st keyframe to the tenth)

2- make a new material (does NOT need to be assigned to any shape, it's an information carrier)

3- name that material:
Code: [Select]
seq: fire=1-10, fps=30
Note, I used 1-10 as the keyframes but this is just an example. You can also add Cyclic after the comma, followed by another comma to make the animation repeat until the sequence is over. Fps is how fast your animation plays, a higher number will make it play faster.

4- Export the model with animations (usually done automatically unless something somewhere was unchecked)

And there you have it, you will now have a model animating itself during the "Fire" Image State sequence.