RTS Kit animations (1.5.2 version)
by Jeff Yaskus · in RTS Starter Kit · 01/18/2010 (9:58 pm) · 9 replies
For my class project, I've taken the challenge of creating a full "game" out of this in the next 6 weeks.
So far, I've merged in the total domination mod as well as the RTS content packs (creatures, houses, units) - and added in the mini map fog of war, and applied all the "fixes" on the forum.
I've replaced all the default buildings with those from the RTS Human House content pack -- they "drop" ok onto the screen, but display the "Create" version of the animated model. I'm not sure how to set it to the "Create" model -- and then turn it into the "idle" model a few seconds later (like its been built).
And I've replaced the rifleman with the goblin and bot with the troll from the content packs.
They all "show up" in the game OK - but don't animate in any way.
Before I tear things apart trying to find where/what to fix ... does anyone have any pointers on how to get the animations working as intended ?
So far, I've merged in the total domination mod as well as the RTS content packs (creatures, houses, units) - and added in the mini map fog of war, and applied all the "fixes" on the forum.
I've replaced all the default buildings with those from the RTS Human House content pack -- they "drop" ok onto the screen, but display the "Create" version of the animated model. I'm not sure how to set it to the "Create" model -- and then turn it into the "idle" model a few seconds later (like its been built).
And I've replaced the rifleman with the goblin and bot with the troll from the content packs.
They all "show up" in the game OK - but don't animate in any way.
Before I tear things apart trying to find where/what to fix ... does anyone have any pointers on how to get the animations working as intended ?
About the author
Long time gamer, hacker and programmer. With dreams of making video games -
#2
But I'm keeping notes of all the changes I make to this kit / engine to get it working for my project.
And when done, would like to share the progress with the community ... perhaps even use it to improve the over-all RTS kit into a more robust add-on.
Any 3d Modeling guru's want to help making the missing buildings with animations?
01/19/2010 (12:18 am)
ok, so far I have no idea how to get it to work properly ... But I'm keeping notes of all the changes I make to this kit / engine to get it working for my project.
And when done, would like to share the progress with the community ... perhaps even use it to improve the over-all RTS kit into a more robust add-on.
Any 3d Modeling guru's want to help making the missing buildings with animations?
#3
Well, if/when I find how to animate these ... I'll post it for everyone else.
01/19/2010 (6:38 pm)
I found another article in the forum - it seems the RTS kit units don't use the DSQ animations, but the one that does animate is using an animation built into the 3d model?Well, if/when I find how to animate these ... I'll post it for everyone else.
#4
and I found the function definition in starter.RTS/server/scripts/avatars/player.cs
Also the setActionThread which this calls is defined in the player.cc (engine code) file.
However, it doesn't appear to work - either for units or buildings.
I used the "RTS Building Pack: Humans" and set the dts to animated/classic/human2.dts ... which is the windmill. Its supposed to have (3) animation sequences - "Create", "idle" and "destroy".
playRootAnimation() appears to call the "idle" animation - but in reality, what shows up is the "Create" or default animation sequence for the building.
01/23/2010 (8:49 pm)
server/scripts/items/building.cs has a call to playRootAnimation ... which is supposed to call the "idle" animation for a building, after its placed down.and I found the function definition in starter.RTS/server/scripts/avatars/player.cs
Also the setActionThread which this calls is defined in the player.cc (engine code) file.
However, it doesn't appear to work - either for units or buildings.
I used the "RTS Building Pack: Humans" and set the dts to animated/classic/human2.dts ... which is the windmill. Its supposed to have (3) animation sequences - "Create", "idle" and "destroy".
playRootAnimation() appears to call the "idle" animation - but in reality, what shows up is the "Create" or default animation sequence for the building.
#5
and typed;
and it switched from the build to the "idle" animation, with the windmills arms going around ... and then i tried the destroy animation.
and it animates goes into the ground.
So the animations work, but the .cs code is not calling them or such.
01/23/2010 (10:39 pm)
hmm, I got the animation to work manually ... loading up the game and placed down the animated building. then selected it and brought up the console window (~)and typed;
1974.setActionThread("idle");and it switched from the build to the "idle" animation, with the windmills arms going around ... and then i tried the destroy animation.
1974.setActionThread("destroy");and it animates goes into the ground.
So the animations work, but the .cs code is not calling them or such.
#6
Here is how to get buildings to switch to the idle animation when placed down ... going to work on making a timer or such now.
Edit starter.RTS/server/scripts/avatars/player.cs
change the line ~345 to the use the name and not the shapefile;
Now, when I place the building down, they show the idle animation.
01/23/2010 (11:01 pm)
Fixed!! The hack that was in place did nothing useful ... Here is how to get buildings to switch to the idle animation when placed down ... going to work on making a timer or such now.
Edit starter.RTS/server/scripts/avatars/player.cs
change the line ~345 to the use the name and not the shapefile;
//if( strstr( %this.getDatablock().shapeFile, "building" ) != -1 ) if( strstr( %this.getClassName(), "RTSBuilding" ) != -1 )
Now, when I place the building down, they show the idle animation.
#7
a) place the building with the default ("create") animation
b) set its current hit points to 10 (or 1 or such) ... maxDamage=1000
c) send the peon over and have him start "building"
d) since the build animation doesn't exist ... instead you'll see the buildings health bar start to creep up towards full.
e) when its full, the peon is done - and the building animation turns to "idle"
now to write the code ...
01/23/2010 (11:22 pm)
Ok, now I've got a plan.a) place the building with the default ("create") animation
b) set its current hit points to 10 (or 1 or such) ... maxDamage=1000
c) send the peon over and have him start "building"
d) since the build animation doesn't exist ... instead you'll see the buildings health bar start to creep up towards full.
e) when its full, the peon is done - and the building animation turns to "idle"
now to write the code ...
#8
http://www.torquepowered.com/community/forums/viewthread/27018
01/24/2010 (1:38 am)
Tried to use this code, but its from prior to TGE 1.5.2 and it seems to not work because when I click to place the building -- the peon is no longer selected.http://www.torquepowered.com/community/forums/viewthread/27018
#9
01/24/2010 (1:49 am)
for now, I used a schedule command to delay the transition from "create" to "idle"// %b.playRootAnimation();
%b.setActionThread("Create"); // start building out as under construction
%b.schedule(15000, setActionThread,"idle");
Torque Owner Jeff Yaskus
jy games