Animation system help
by Jonas · in Torque 3D Professional · 08/23/2011 (6:52 am) · 9 replies
Hi!
I have recently started to look into animation, not as in animating a character but engine/script side of things and im about to start testing my own character into the mix, but i feel like i need a bit of help to understand the system.
My first question would be: how is the animation and the keystroke bound to each other?
in the moveMap it says MOVE:Direction and in the character (gideon) file it only says "run"
next to the sequence. I don't quite understand how the two are known to each other.
**NOTE: I am using T3D binary**
Best regards
Jonas
I have recently started to look into animation, not as in animating a character but engine/script side of things and im about to start testing my own character into the mix, but i feel like i need a bit of help to understand the system.
My first question would be: how is the animation and the keystroke bound to each other?
in the moveMap it says MOVE:Direction and in the character (gideon) file it only says "run"
next to the sequence. I don't quite understand how the two are known to each other.
**NOTE: I am using T3D binary**
Best regards
Jonas
About the author
Freelance 3D artist at day scripter/coder on Enduring Life at night. Lover of all things TorqueScript.
#2
For example if i had 2 different swim animations depending on what weapon the character is holding.
Best regards
Jonas
08/23/2011 (8:34 am)
I see, would there be any way to add aditional animations via script or is that completely engine/C++ side?For example if i had 2 different swim animations depending on what weapon the character is holding.
Best regards
Jonas
#3
08/23/2011 (8:42 am)
You may be able to do it with the player's playThread or setActionAnimation methods. The tricky part will be preventing your script-side animation from being overridden by the engine-side animations.
#4
Best regards
Jonas
08/23/2011 (8:45 am)
ok, thank you ill check around bit more and check back if more questions arise.Best regards
Jonas
#5
here r some(search with title):
Crouch and Prone Side Back Animations by Steve Acaster
Getting Ai to Use Poses by Steve Acaster
Improved PlayDeathAnimation by Michael Hall
Script-side Player Animation Definitions by Daniel Buckmaster
08/24/2011 (1:32 am)
there are some old and new resource on player animation system in resource section.search and read them.they will help them to understand the system,not completly actually. here r some(search with title):
Crouch and Prone Side Back Animations by Steve Acaster
Getting Ai to Use Poses by Steve Acaster
Improved PlayDeathAnimation by Michael Hall
Script-side Player Animation Definitions by Daniel Buckmaster
#7
possible solution not a pretty one but a solution none the less.
Ok here goes:
As far as i understand it the animations is triggered via a key press
which is bound in script (MoveMap). My idea is if i remove the trigger mechanism in this case:
moveMap.bind( keyboard, w, moveforward );
and replace it with a function call instead of "moveforward"
So instead of calling the engine side function i call a function defined in a script file containing the exact same command to walk forward with a added notion that it takes weapon variable into account.
This way i wouldnt have to worry about the engine overriding my animation calls since it is not called into action.
I haven't tested yet, would just like some input on this before i start.
Best regards
Jonas
09/05/2011 (6:59 am)
Oke, i have looked at this problem for a while now and i think i have apossible solution not a pretty one but a solution none the less.
Ok here goes:
As far as i understand it the animations is triggered via a key press
which is bound in script (MoveMap). My idea is if i remove the trigger mechanism in this case:
moveMap.bind( keyboard, w, moveforward );
and replace it with a function call instead of "moveforward"
So instead of calling the engine side function i call a function defined in a script file containing the exact same command to walk forward with a added notion that it takes weapon variable into account.
This way i wouldnt have to worry about the engine overriding my animation calls since it is not called into action.
I haven't tested yet, would just like some input on this before i start.
Best regards
Jonas
#8
09/06/2011 (2:53 pm)
Edited out
#9
So in simple words this is what i wanna do:
Basically my movemap is bound to a function named Armor::Animate(*action*)
where a main IF/ELSE nest is. This determines what animation set the
character uses by getting a variable from what gun is eqquiped.
here is a code snippet of what i have so far:
The eror i get when trying this is the following:
I am almost 100% certain this is related to a error i made a while back with game modes since this also uses a namespace (Armor::) but the movemap dosnt seem to agree with me when i try to use any form of more "info" with it, if i use armor.animatewf it simply dont even show up it dosnt look for it and there is no echo from the functions itself.
I have also tried to include the correct variables(%this, %obj) but
the movemap only seem to be interested in the function name and the name alone which poses a problem.
I have tinkered around a bit, read through my other thread a few times, but still nothing. I know where the problem sits i just don't know how to handle it from here.
(All functions in question is located in the file called default.binds.cs)
Best regards
Jonas
09/08/2011 (10:17 am)
Oke so this is what i got so far and i wanna note that this is certainly a work around but with a binary version i dont have much choice right now:So in simple words this is what i wanna do:
Basically my movemap is bound to a function named Armor::Animate(*action*)
where a main IF/ELSE nest is. This determines what animation set the
character uses by getting a variable from what gun is eqquiped.
here is a code snippet of what i have so far:
moveMap.bind( keyboard, w, AnimateWF );
function Armor::AnimateWF(%this, %obj)
{
IF(EQ_WEP==1)
{
%obj.setactionthread("Awesomegun_walk1", true, true);
}
IF(EQ_WEP==2)
{
%obj.setactionthread("Awesomegun_walk2", true, true);
}
IF(EQ_WEP==3)
{
%obj.setactionthread("Awesomegun_walk3", true, true);
}
IF(EQ_WEP==4)
{
%obj.setactionthread("Awesomegun_walk4", true, true);
}
}The eror i get when trying this is the following:
AnimateWF: Unknown command
I am almost 100% certain this is related to a error i made a while back with game modes since this also uses a namespace (Armor::) but the movemap dosnt seem to agree with me when i try to use any form of more "info" with it, if i use armor.animatewf it simply dont even show up it dosnt look for it and there is no echo from the functions itself.
I have also tried to include the correct variables(%this, %obj) but
the movemap only seem to be interested in the function name and the name alone which poses a problem.
I have tinkered around a bit, read through my other thread a few times, but still nothing. I know where the problem sits i just don't know how to handle it from here.
(All functions in question is located in the file called default.binds.cs)
Best regards
Jonas
Associate Chris Haigler
Jester Dance
I'm not sure what binary version you're using but as of 1.1 Final, here's a list of animations the player class can use by default:
* root - default 'idle' animation
* run - forward walk/run
* back - backward movement animation
* side - left strafe
* side_right - right strafe
* crouch_root
* crouch_forward
* crouch_backward
* crouch_side
* crouch_right
* prone_root
* prone_forward
* prone_backward
* swim_root
* swim_forward
* swim_backward
* swim_left
* swim_right
* fall - played when the player is determined to be falling (engine/C++ side)
* jump
* standjump
* land - played when the player goes from falling -> not falling
* jet - leftover from Tribes 2