Troubleshooting using skeletal animation for RTSUnit Characters
by Tim Colwill · in RTS Starter Kit · 10/03/2006 (10:01 am) · 6 replies
Hi everyone,
Was just wondering if anybody had implemented skeletal animation for RTS characters. We were planning on doing so and I'd love any pointers on how to put it into the RTSUnit class, as I'm having some troubles. The dts file reads okay but the model doesn't animate and simply glides around the terrain.
At the moment this is the top of my operative.cs file. All the dsq files and the dts file are located in their own seperate folder.
And this is what's in the player.cs file...
So as far as I can tell, the sequence is called "run", and "attack" and so forth, so they should be getting called and applied... am I missing something pivotal here?
Thanks in advance,
Tim
Was just wondering if anybody had implemented skeletal animation for RTS characters. We were planning on doing so and I'd love any pointers on how to put it into the RTSUnit class, as I'm having some troubles. The dts file reads okay but the model doesn't animate and simply glides around the terrain.
At the moment this is the top of my operative.cs file. All the dsq files and the dts file are located in their own seperate folder.
datablock RTSUnitData(operativeBlock : UnitBaseBlock)
{
shapeFile = "~/data/shapes/operative/operative.dts";
sequence0 = "~/data/shapes/operative/player_root.dsq root";
sequence1 = "~/data/shapes/operative/player_forward.dsq run";
....up until (cut to fit into char limit of post)...
sequence30 = "~/data/shapes/operative/player_attack1.dsq attack";
baseDamage = 50;
attackDelay = 32;
damagePlus = 3;
armor = 1;
moveSpeed = 8;
range = 12;
maxDamage = 250; //maxDamage = health
vision = 100;
repairRate = 100;
boundingBox = "2.0 2.0 2.0";
};And this is what's in the player.cs file...
function Player::playDeathAnimation(%this)
{
// This will choose from 11 possible death animations.
//if (%this.deathIdx++ > 11)
// %this.deathIdx = 1;
//%this.setActionThread("death" @ %this.deathIdx);
// The RTS example unit has "die" as it's animation name
// The bot has no death animation, the building is a different name
if( strstr( %this.getDatablock().shapeFile, "building" ) != -1 )
%this.setActionThread("destroy", true);
else
%this.setActionThread("die", true);
}
function Player::playAttackAnimation(%this)
{
// Lame hack because of inconsistant animation names
// omgwtfbbq
if( strstr( %this.getDatablock().shapeFile, "rifleman" ) != -1 )
%this.setActionThread("fire");
else // It's the shocker or the bot
%this.setActionThread("attack");
}
function Player::playRunAnimation(%this)
{
%this.setActionThread("run");
}
function Player::playRootAnimation(%this)
{
// omgwtfbbq
// Again another lame hack because of inconsistant animation names
if( strstr( %this.getDatablock().shapeFile, "building" ) != -1 )
%this.setActionThread( "idle" );
else
%this.setActionThread( "root" );
}
function Player::playCelAnimation(%this,%anim)
{
if (%this.getState() !$= "Dead")
%this.setActionThread("cel"@%anim);
}So as far as I can tell, the sequence is called "run", and "attack" and so forth, so they should be getting called and applied... am I missing something pivotal here?
Thanks in advance,
Tim
#2
Do I need to put this in there instead.
EDIT: That's weird. When I put that in and merge them in avatars/base.cs it tells me it can't find looknw.dsq. Which is exactly what it says about player.cs as well. If I tell it not to use looknw.dsq it tells me it can't find standjump.dsq. The files are clearly there, what's the go?
How can I put back into RTSUnit the skeletal animation support that appears to have been stripped out completely? Hints? Guides? Anyone?
10/08/2006 (8:25 am)
Question:Do I need to put this in there instead.
datablock TSShapeConstructor(PlayerDts)
{
baseShape = "./player.dts";
sequence0 = "./player_root.dsq root";
sequence1 = "./player_forward.dsq run";
sequence2 = "./player_back.dsq back";
sequence3 = "./player_side.dsq side";
sequence4 = "./player_lookde.dsq look";
sequence5 = "./player_head.dsq head";
sequence6 = "./player_fall.dsq fall";
sequence7 = "./player_land.dsq land";
sequence8 = "./player_jump.dsq jump";
sequence9 = "./player_diehead.dsq death1";
sequence10 = "./player_diechest.dsq death2";
sequence11 = "./player_dieback.dsq death3";
sequence12 = "./player_diesidelf.dsq death4";
sequence13 = "./player_diesidert.dsq death5";
sequence14 = "./player_dieleglf.dsq death6";
sequence15 = "./player_dielegrt.dsq death7";
sequence16 = "./player_dieslump.dsq death8";
sequence17 = "./player_dieknees.dsq death9";
sequence18 = "./player_dieforward.dsq death10";
sequence19 = "./player_diespin.dsq death11";
sequence20 = "./player_looksn.dsq looksn";
sequence21 = "./player_lookms.dsq lookms";
sequence22 = "./player_scoutroot.dsq scoutroot";
sequence23 = "./player_headside.dsq headside";
sequence24 = "./player_recoilde.dsq light_recoil";
sequence25 = "./player_sitting.dsq sitting";
sequence26 = "./player_celsalute.dsq celsalute";
sequence27 = "./player_celwave.dsq celwave";
sequence28 = "./player_standjump.dsq standjump";
sequence29 = "./player_looknw.dsq looknw";
};EDIT: That's weird. When I put that in and merge them in avatars/base.cs it tells me it can't find looknw.dsq. Which is exactly what it says about player.cs as well. If I tell it not to use looknw.dsq it tells me it can't find standjump.dsq. The files are clearly there, what's the go?
How can I put back into RTSUnit the skeletal animation support that appears to have been stripped out completely? Hints? Guides? Anyone?
#3
10/08/2006 (3:09 pm)
I didnt know it had gone, thats a bit lame.
#4
We tried it in the vanilla RTS demo that comes with the engine and it seems to work perfectly.
Conclusion: We broke it, and we need to fix it.
10/08/2006 (5:45 pm)
Hmm. After further experimentation, I don't think it is gone.We tried it in the vanilla RTS demo that comes with the engine and it seems to work perfectly.
Conclusion: We broke it, and we need to fix it.
#6
I have all my DSQs loaded for each of the units in the avatars/players.cs file like such;
and I changes each of those .cs files from (PlayerDts) to a unique value like ElfDts, GoblinDts and StonemanDTs
So I'm thinking I finally have it all loaded properly ... but the units all still slide along the except.
With the exception of the bot, rifleman and shocker -- which don't use DSQ animations -- they have animations built into the DTS files.
02/01/2010 (12:37 am)
I've been having the same issues / questions -- whats this about whitespace?sequence29 = "./player_looknw.dsq looknw";
I have all my DSQs loaded for each of the units in the avatars/players.cs file like such;
// Load dts shapes and merge animations
exec("~/data/shapes/player/player.cs");
exec("~/data/shapes/tge_elf/elf.cs");
exec("~/data/shapes/goblin/goblin.cs");
exec("~/data/shapes/stoneman/stoneman.cs");and I changes each of those .cs files from (PlayerDts) to a unique value like ElfDts, GoblinDts and StonemanDTs
So I'm thinking I finally have it all loaded properly ... but the units all still slide along the except.
With the exception of the bot, rifleman and shocker -- which don't use DSQ animations -- they have animations built into the DTS files.
Torque Owner Tim Colwill
Even a "lol u is a noob" would be nice.