Two Questions
by Sean T. Boyette · in Torque X 2D · 10/26/2008 (11:49 pm) · 4 replies
I typically load animations from a Single DTS with multiple sequence nodes in
What would be a way to load a DSQ for playing as an animation
something like this -however I know that a dsq is not a rendercomponent..
also
what would be the best way to play an animatin (sword attack) complelye when the button is pressed and then return to whatever you are doing..right now it plays while it button 0 is pressed...
I want it to completely play the animation (not allowing user input) and then return to the update.
What would be a way to load a DSQ for playing as an animation
something like this -however I know that a dsq is not a rendercomponent..
//Render Component - DSQ Idle Animation
T3DTSRenderComponent componentIdleAnimation = new T3DTSRenderComponent();
componentIdleAnimation.ShapeName = @"data\shapes\Robot_Animations\Robot_Idle.dsq";
componentIdleAnimation.SceneGroupName = "PlayerObject";
objPlayer.Components.AddComponent(componentIdleAnimation);also
what would be the best way to play an animatin (sword attack) complelye when the button is pressed and then return to whatever you are doing..right now it plays while it button 0 is pressed...
I want it to completely play the animation (not allowing user input) and then return to the update.
if (move.Buttons[0].Pushed)
{
if (_currentAnimationPlaying != CurrentAnimationPlaying.Idle_Attack_1)
{
_currentAnimationPlaying = CurrentAnimationPlaying.Idle_Attack_1;
_currentAnimation = (TSAnimation)componentAnimation.GetAnimation("Idle_Attack_1");
_currentAnimation.Play();
}
return;
}About the author
#2
Any suggestions for playing a looping animation already embedded in the dts file? If a person were coding the object placement via code in the game.cs file could the animation coding be set and played there?
Thanks,
Jeff
10/30/2008 (9:19 am)
Sean,Any suggestions for playing a looping animation already embedded in the dts file? If a person were coding the object placement via code in the game.cs file could the animation coding be set and played there?
Thanks,
Jeff
#3
Yup - you certainly can play the anims embedded int he DTS -
- its the same as above - excet you dont identify the SequenceFilename.
I would caution doing this - because having seperate DSQ's allows for quicking changing of the anims.
but you can do it- its how boombot is implemented.
10/31/2008 (11:01 am)
Jeff Yup - you certainly can play the anims embedded int he DTS -
- its the same as above - excet you dont identify the SequenceFilename.
I would caution doing this - because having seperate DSQ's allows for quicking changing of the anims.
but you can do it- its how boombot is implemented.
//Idle Animation
TSAnimation animationIdle = new TSAnimation();
animationIdle.ThreadName = "ActionThread";
animationIdle.SequenceName = "Idle";
animationIdle.Name = "Idle";
componentAnimation.AddAnimation(animationIdle);
#4
I should have stated the question better....
My problem is figuring out how to actually play the animation from code. I have a simple dts file with an embedded animation that I want to call and have play continuously.
Thanks,
Jeff
10/31/2008 (11:12 am)
Sean,I should have stated the question better....
My problem is figuring out how to actually play the animation from code. I have a simple dts file with an embedded animation that I want to call and have play continuously.
Thanks,
Jeff
Torque Owner Sean T. Boyette
anyways -
DSQ's are handled via TSAnimations via the SequenceFilename - Easy!! and works like a champ!!!
//Idle Animation TSAnimation animationIdle = new TSAnimation(); animationIdle.ThreadName = "ActionThread"; animationIdle.SequenceName = "Idle"; animationIdle.SequenceFilename = @"data\shapes\Robot_Animations\Robot_Idle.dsq"; animationIdle.Name = "Idle"; componentAnimation.AddAnimation(animationIdle);