Game Development Community

Pose transition animations, Standing to Kneeling, Kneeling to Prone. etc

by Grey9999 · in Torque 3D Beginner · 11/30/2012 (3:09 am) · 10 replies

Can you use Player::setActionThread in some way to add some animations for the player moving from a standing stance into a kneeling or prone position?


#1
11/30/2012 (8:33 am)
prone position-->already in stock code.u just need animation with proper naming.

kneeling--> u can look into code of crouching. then copy paste it for kneling down or others.

do a search u will get threads on adding more movement actions.
#2
12/04/2012 (10:18 pm)
I think he means transition animations from one pose to the other
#3
12/05/2012 (12:53 am)
Yes deepscratch that's what I mean.
#4
12/06/2012 (7:58 am)
I'm going to throw this out there without checking my facts:

Perhaps looking at the state machine editor can provide some clues for this endeavor. I'm certain that it is used to handle transitioning to the "sprint" animation for the first-person arms on the soldier model. You'll probably have to look at both the player datablock and the weapon datablocks for hints. And it might be a blind alley anyway. Just thinking out loud and hoping it sparks something for you.
#5
12/06/2012 (9:58 am)
Well what I've been looking at is default.bind.cs, maybe adding some stuff under function docrouch??
#6
12/06/2012 (1:35 pm)
In the World Editor, open the Datablock Editor. In the Datablock Library on the Existing tab scroll down and open the ShapeBaseImageData group. Look at any of the weapon datablocks toward the bottom of the General section - you should see an entry named States with a + mark on its left. Open the States section and examine any of the states - you'll see entries for various state properties. Refer to the FPS Tutorial, Lesson 5 for more information on what can be done here - the basic idea is that you can set up transition states for each weapon between various states. You will need to have animations assigned to the player model, of course, and I believe the trick will be to figure out what kicks each of the "stateTransitionGenericXIn" and "out" states (you can see in the lurker weapon image state 2 that stateTransitionGeneric0In triggers the sprint animation.
#7
12/06/2012 (2:33 pm)
... you dont need to create seperate animations for stand to crouch, crouch to prone, pront to stand,etc.

you create them for each state and the engine handles the rest.

i.e. my model has animations for root - stand, root - crouch, root - prone.

It uses root-stand when in default stance ... when I change stances, the engine automatically merges from one stance to the other. no need for transition animations
#8
12/07/2012 (3:30 am)
That works fine in a limited pose-difference change, like stand->crouch and vise versa, but would look weird if you did something more drastic like stand->prone because they would just glide onto their belly without regards to physics.

I achieved this functionality by overhauling the action animation system to be script-controlled and then having callbacks from the engine for when animations start, end or hit triggers.

I ended up using a state machine in addition to that, but just the above would suffice for most cases. From there you would play a animation to go prone, and then when that animation ends it kicks the callback, and you can finish setting the player info to update from that(like officially changing their stance to prone, updating arm thread animations, etc).

I'm plotting on diffusing out a lot of the changes I made for my project as resources or whatnot once I get the first release out there(ideally in about a month) and this is one of the things I plan on tossing out there. But if you need it now, you're going to want to do more or less what I suggested above. A way to override the current actionAnimation from script calls(as engine-called actionAnimations always override script-called ones by default) and then the animation callbacks so you can tell when you've finished your transitional animation and can continue on.
#9
12/08/2012 (6:55 am)
Ok well today I scripted a pretty good system for cycling your stance up and down between poses, If I could just get SetActionThread to work I think I might have a way to plug it into it and add these transitional animations. Everytime I try to use SetActionThread either in a script or just in the console the console always says "Unable to find object: '' attempting to call function 'SetActionThread' ".

$player.setActionThread("stand_to_crouch", true, false );

gives me that error... How do I get it to work?

#10
12/12/2012 (7:49 am)
i was out of any internet connection.so missed those new comments.


"I think he means transition animations from one pose to the other"
sorry.
with my sleepy eye i missed that.
i will give it a go.

1st i have to check if i had a model with those required animations