adding my own character to the game
by Roger D Vargas · in Torque 3D Beginner · 11/21/2013 (7:46 am) · 3 replies
I have a Blender made character model, it has 3 animations (idle, attack, walk) and I would like to use it for testing. But seems that I need a datablock or something to add it, because putting it directly into map sometimes results in an static model and sometimes in a model playing only idle animation. Can somebody explain me how to correctly configure it to have access to all animations?
About the author
Game developer and writer
#2
11/21/2013 (8:16 pm)
Datablock and replace all animations in CS cscript. There's the soldier example to follow.
#3
2) Open the file and change datablock PlayerData(DefaultPlayerData) to datablock PlayerData(WHATEVERYOURPLAYERNAMEISDATA) also change shapeFile = "art/shapes/actors/Soldier/soldier_rigged.DAE"; to the file location for your model.
3) Remember to exec your script in datablockExec.cs (also in the same folder) you'll see how they exec scripts inside that file.
4) Your character should be in /game/art/shapes/actors/whateverfolderyoumadeforyourcharacter and it requires a *.cs script for the engine to know which animations are for what. You can see an example in /game/art/shapes/actors/Solider, inside the soldier_rigged.cs you'll see in the function SoldierDAE::onLoad(%this) how it tells the engine what files are for what animations (or frames, if you export your characters animations all to one file), you'll need to setup the same for your model.
5) When you launch the game and load the level, click on the SpawnSphere and change the spawnDatablock to the WHATEVERYOURPLAYERNAMEISDATA that you defined in part 1.
A more detailed tutorial, which is done entirely in the engine, is available in the Torque 3D Documentation. Even more documentation here, once you've decided that Torque is for you I'd recommend picking up
Torque 3D Game Development Cookbook (also available here )
11/21/2013 (9:15 pm)
1) In /game/art/datablocks/ you'll see player.cs, copy/paste this file and rename it to whatever you want for your players name.2) Open the file and change datablock PlayerData(DefaultPlayerData) to datablock PlayerData(WHATEVERYOURPLAYERNAMEISDATA) also change shapeFile = "art/shapes/actors/Soldier/soldier_rigged.DAE"; to the file location for your model.
3) Remember to exec your script in datablockExec.cs (also in the same folder) you'll see how they exec scripts inside that file.
4) Your character should be in /game/art/shapes/actors/whateverfolderyoumadeforyourcharacter and it requires a *.cs script for the engine to know which animations are for what. You can see an example in /game/art/shapes/actors/Solider, inside the soldier_rigged.cs you'll see in the function SoldierDAE::onLoad(%this) how it tells the engine what files are for what animations (or frames, if you export your characters animations all to one file), you'll need to setup the same for your model.
5) When you launch the game and load the level, click on the SpawnSphere and change the spawnDatablock to the WHATEVERYOURPLAYERNAMEISDATA that you defined in part 1.
A more detailed tutorial, which is done entirely in the engine, is available in the Torque 3D Documentation. Even more documentation here, once you've decided that Torque is for you I'd recommend picking up
Torque 3D Game Development Cookbook (also available here )
RoundedIcon