Game Development Community

cant create my own character

by Roger D Vargas · in Torque 3D Beginner · 04/11/2014 (8:47 am) · 5 replies

Im trying to setup my opwn model as character model. I took one from RPG starter pack, in torque editor created the datablock, derived from PlayerDaya and modified like this:

datablock PlayerData(MikaData : DefaultPlayerData)
{
   baseShape = "art/shapes/Mika/Mika.dae";
   pickupRadius = "1";
};

taking boomBot from RTS prototype as guide and added it to datablockExec.cs . I assigned it to the spawn sphere, but when I reopen or run the level I got an error saying that it can create an spawn with datablock MikaData. I thought that i had missed the spawnclass, so I copied aiPlayer.cs too, added it to datablockExec.cs and setSpawnClass to AiPlayer, but I still get the same error. What step am I missing here? The project is an empty project, so maybe I need some other file.


#1
04/11/2014 (8:39 pm)
Creating a custom character can be achieved entirely in the engine.

Go to Editors > Datablock Editor.

In the Datablock Library to the right click the New tab. Double click PlayerData.

A window will pop up called "Create New Datablock". In the name field do something like MikaPlayer.

In the pulldown "Copy Data From", choose DefaultPlayerData. Then click the Create button.

Back in the Datablock library, click the Existing tab. Under PlayerData you will now see MikaPlayer. The asterisk next to it means it hasn't been saved yet.

Highlight your new playerdata and scroll down through the properties until you see Render. Next to shapefile click the box and point to Mika.DAE. Make sure you click the Disk icon to save it. The asterisk will disappear.

Go to the Object Editor and in the Scene tab, expand PlayerDropPoints folder. Highlight PlayerSpawn and in the field next to it type MikaPlayer, to point it to that datablock.

Save your Level and exit. The next time you start, you should spawn as MikaPlayer.

Hope I didn't miss anything.
#2
04/14/2014 (4:42 am)
When the choosen template is Empty, the "Copy Data From" list is empty, so I have to manually edit the datablock (and maybe thats not correct or something is missing). But for Full template, it displays DefaultPlayerData and DemoPlayer. I managed to achieve a partial success with Full template, but for some reason in first person camera I still get the default hands and pistol mesh, and only in third person mode I get the right mesh displayed.
#3
04/14/2014 (3:30 pm)
I was toying with the idea of figuring out how to replace the FP Arms but decided that it was too complicated at this time. I also thought of going back to the old style of just the weapon being seen in First Person.

Either way I'm a beginner to Torque also. You could try go to managedDatablocks.cs and under

datablock PlayerData(MikaPlayer : DefaultPlayerData)

try adding this

shapeNameFP[0] = "";

This should effectively "unmount" the FPS arms.

You will most likely mess up your weapons and will need to work on using eye offsets. You might be able to render your player in first person and attach the eye to your weapon.

Hopefully someone else will also try to help you because before I encountered my newest problem I probably spent 4 days just getting a shotgun animated correctly in the FP Arms and I would normally test this out for you but I'm afraid to right now. Heh sorry.
#4
05/27/2014 (6:04 am)
Did you ever get this working?

This use to happen to me as well and usually the issue is the order in which the engine would execute the scripts or the new CS file is not being executed.

#5
05/27/2014 (10:51 am)
Well if you already have the FP arm with animations..You can go to FP (under Datablock Editor> in the PlayerData, just above 3rd person shape)...Usually you'd have to click the "+" so you can access the shape...Just replace the default soldiers arm with (your shape), give it a name...Example MikaPlayer...I think you may have to add a few lines (I believe) in the player.cs, so the engine know to look for the new model over the default and that should do it!

If I'm wrong somebody can jump in and help me out but I've been playing around with T3D since it was just TGE. I think what I mention above would help you with replacing the FP arms..