T3D How do I change or swap an objects animations for walk / run ? [resolved]
by Jeff Yaskus · in Torque 3D Beginner · 03/02/2011 (4:35 pm) · 5 replies
I have a 3d model in DTS format which has the animations "baked" into it.
Problem is, they do not have the correct name ... instead its something like this;
Bear_walk
Bear_eat
Bear_run
so, the bear just slides around ... but when I set the animation directly, it works.
With T3D, I remember reading somewhere that its possible to over-ride these at load time ?
(Couldn't seem to find the posts when searching)
If so, whats required ?
Also - on the same token is it possible to change a loaded objects animations for walk ?
ie. if there health is < 25%, change it to the crawl animation?
Problem is, they do not have the correct name ... instead its something like this;
Bear_walk
Bear_eat
Bear_run
so, the bear just slides around ... but when I set the animation directly, it works.
With T3D, I remember reading somewhere that its possible to over-ride these at load time ?
(Couldn't seem to find the posts when searching)
If so, whats required ?
Also - on the same token is it possible to change a loaded objects animations for walk ?
ie. if there health is < 25%, change it to the crawl animation?
About the author
Long time gamer, hacker and programmer. With dreams of making video games -
#2
03/03/2011 (7:53 am)
What Rene said or manually modify the TSShapeConstructor to use your named animations.
#3
It created the onLoad() script below ... showing the commands to perform the rename.
03/03/2011 (1:21 pm)
I like these new features within T3D -- I used the Shape Editor, the key was to hit enter after changing the name to "save" it. Then save the entire shape when done.It created the onLoad() script below ... showing the commands to perform the rename.
singleton TSShapeConstructor(bearDts)
{
baseShape = "./bear.dts";
};
function bearDts::onLoad(%this)
{
%this.renameSequence("bear_eat", "eat");
%this.renameSequence("bear_attack1", "attack1");
%this.renameSequence("bear_idle", "root");
%this.renameSequence("bear_run1", "run");
%this.renameSequence("bear_run2", "run2");
%this.renameSequence("bear_walk", "walk");
%this.renameSequence("bear_death", "death");
%this.renameSequence("bear_startled", "startled");
%this.renameSequence("bear_defense", "defense");
%this.renameSequence("bear_attack2", "attack2");
}
#4
03/03/2011 (1:24 pm)
So makes me curious, if its possible to perform the sequence rename AFTER its loaded as well ... would make it possible for me to define a new sequence for default movement.
#5
03/03/2011 (11:10 pm)
I don't believe that is possible, Jeff, as the sequences are loaded at runtime to memory, kinda like datablocks.
Associate Rene Damm
Simply go into the Shape Editor and rename the sequences. Simple as that :)