Replacing spaceOrc in TSE demo
by Spencer Alexander · in Torque Game Engine Advanced · 05/31/2006 (9:05 am) · 1 replies
I made a copy of the demo directory and replaced the spaceorc directory with a test character that I set up using the blueGuy skeleton. I was able to use this character in TGE, however I can't seem to get it to work in TSE. The character loads and positions itself the same as the spaceorc did, however I can't get the animations to play.
Since the player_dance.dsq seems to be what gets played during the demo, I just copied and renamed one of the blueGuy animations to player_dance.dsq in the new spaceOrce directory thinking it would play that animation and added the player_dance entry into the player.cs file at the end under sequence30, same as the original player.cs. I also copied a BlueGuy animation for the player_range animation and added the entry to the player.cs to assure the player.cs looks exactly the same as it did before.
I also tried this with the starter.fps, backing up and replacing the player directory with the one I have working in TGE. The character moves around in the static default pose. No animation.
I assume I must be missing some sort of mapping to the animations, however the new animations(dsq files) have all the same names as the original spaceOrc so I would think they would get picked up the same. The player.cs file looks the same as the original also. Any thoughts about what I might be missing?
Since the player_dance.dsq seems to be what gets played during the demo, I just copied and renamed one of the blueGuy animations to player_dance.dsq in the new spaceOrce directory thinking it would play that animation and added the player_dance entry into the player.cs file at the end under sequence30, same as the original player.cs. I also copied a BlueGuy animation for the player_range animation and added the entry to the player.cs to assure the player.cs looks exactly the same as it did before.
I also tried this with the starter.fps, backing up and replacing the player directory with the one I have working in TGE. The character moves around in the static default pose. No animation.
I assume I must be missing some sort of mapping to the animations, however the new animations(dsq files) have all the same names as the original spaceOrc so I would think they would get picked up the same. The player.cs file looks the same as the original also. Any thoughts about what I might be missing?
About the author
Torque Owner Spencer Alexander
When I discovered the problem ShowTools pro was showing an error in the console when you load the dts and cs files together saying that it doesn't like one of the bones and was not loading the animations automatically. This confused me because when I loaded the dts by itself and different dsq animations individually they would load and play okay. I must have been accessing the correct dsq files that were in a different directory than the ones that were being attempted to load automatically. Other lessons I have learned from the forums were to make sure the player.cs file in your characters shape directory is being sourced by editing the OTHER player.cs script that is located in your games server/scripts directory.
These 2 lines need to be changed to have the relative path and name of your character's cs file.
// Load dts shapes and merge animations
exec("~/data/shapes/player/player.cs");
...
shapeFile = "~/data/shapes/player/player.dts";
//changed to
exec("~/data/shapes/myGuy/myGuy.cs");
...
shapeFile = "~/data/shapes/myGuy/myGuy.dts";
Should usually be named after your character. So in this example. The player is called myguy in a myGuy directory under shapes dir..and assuming your cs file is named after your character's dts file is sharing that same directory and the cs file contains the TSShapeConstructor function that has all your animation dsq files named properly. Also, makesure that the baseShape line has the name of your character in it.
Example
baseShape = "./myGuy.dts";
Other things that can cause problems are when the hierarchy of the nodes in maya are not correct. Check the docs to verify this and look at the console to get hints about any errors either in ShowToolsPro or in the game itself after it has loaded or attempted to load the character. Pay attention to the naming conventions and how numbers are suffixed for detail nodes ect..
When exporting make sure the dtsNode's extra attributes have the paths to your projects dts and dsq directories and file names are named after your player. example
shapeName
player.dts
shapeLocation
C:\Projects\TorquePlay\dts
sequenceName
player.dsq
sequenceLocation
C:\Projects\TorquePlay\dsq
I noticed that creating a Projects directory (like mine above, that had no spaces in the full path, unlike the following example
"C:\Documents and Settings\Owner\My Documents\maya\projects\torqueTest"
helped the exporter avoid being confused.
Of course when you implement this in the starter.fps you'll need to make sure to copy the cs dts and dsq files to your shape directory from your maya projects directory.
Hope this might help anybody else hunting the forums for similar problems. Good Luck with your character.