Scripting Animation
From TorqueWiki
Contents |
[edit] Overview
http://www.garagegames.com/docs/tge/general/ch08s05.php
[edit] Animation Threads
Playthread - this is a generic method and clan plany any sort of animation...but has no special "meaning" beyond that.
setAction - this is where the main "action" therad is set. A player can do one action at a time. He can be walking forward, but not backward at same time, nor side to side. He can be falling, but not walking. Set Action has the ability to "transition" between threads to minimize jerky changes.
setArm - the "arm" of the player controls where the gun is pointing and also where the player is "looking". The arm and action are independant. You can be walking and looking up... you can be walking and looking down. The "arm" animation is meant to blend in this range of motion of the arm to control your "aim" in the "up and down" ("side to side" being controlled by your players rotation)
To make an animation thread able to be played at the SAME time as other animations it must be marked as a "Blend" animation. I do not know the details on that as I am a programmer not a Max artists...ie...i dont konw Max or the exporter well enough to say HOW to make a thread a "blend" thread.
The action animations do not have to be blends.
The "arm" animations have to be blends.
You can run other blend animations on top of both action and arm using the .playthread() script method. there are up to, i think, FOUR slots that can run any blend animations you want on top of the standard ones.
[edit] AFX and Anim Threads
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=14113
[edit] Animating collision mesh in TGE 1.5.2
http://www.garagegames.com/mg/forums/result.thread.php?qt=63382
Normally, animated collision meshes are a really bad idea unless you are extremely careful. For a basic door, this can work out ok, but for a complex shape like a "mech warrior" with rotating head, arms, weapons, torso and legs, all with animated collisions, you'll be throwing fits at performance.
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=14113
[edit] Doors
To create a collision mesh for on opening door, there are two possibilities:
- move an invisible door (set transform ..)
- hide invisible doors at certain angles staticShare.setHidden=true.
[edit] Links
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=11651
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=13641
http://www.garagegames.com/mg/forums/result.thread.php?qt=47493
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=11651
[edit] Animate Radar from Tutorial
Create a fine radarz.cs and load it:
datablock StaticShapeData( Radarz )
{
category = "Misc";
shapeFile = "~/tuts/radarz.dts";
};
function Radarz::onAdd( %this, %obj )
{
%obj.playThread( 0, "Action" );
}
function StaticShapeData::create( %block )
{
%obj = new StaticShape()
{
dataBlock = %block;
};
return( %obj ) ;
}
[edit] Player Animation
[edit] Turn Animation
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=12723
[edit] MISC
http://www.garagegames.com/mg/forums/result.thread.php?qt=1961
setMovement: http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=13964
commandToServer('setMovement', "walk");
