Game Development Community

Torque 3D FPS Tutorial error, need help

by Ammon Mills · in Torque 3D Beginner · 01/12/2012 (12:07 pm) · 6 replies

I have some students going through the tutorial provided by the main garage games website after buying a copy of 1.2, building a game for our club. We have run into a problem, and hopefully you all can help. I am completely at a loss.

On lesson 5-Weapons, at the last step, after 8, the "Complete Code Listing" the student copy and pasted all that was in managedDatablocks.cs just to make sure everything was there and correct. She then ran it, and we now get this error each time we tried to load and the character will not appear:

"Unable to create a player with class Player and datablock myPlayer"

Any ideas? I don't know if it was the code, as we went through the entire lesson, taking out everything, and putting it back in. Any help is appreciated.

#1
01/12/2012 (3:13 pm)
The player datablock "myPlayer" is created in Lesson 4, so you must have created that datablock in order to use it. If you haven't done Lesson 4 you probably should.

The shorter method would be to open the datablock editor, select the "New" tab in the Datablock Library, scroll down to Player Data, double-click it, then enter myPlayer in the name field and select DefaultPlayerData from the Copy Values From drop-down. When you click Create you need to save the level and exit the editor. You then restart the world editor and your new datablock should be available.

If you have any more questions drop a line. Hope that helps!
#2
01/12/2012 (6:50 pm)
She started the tutorial from scratch, and had done Lesson 4 the previous day. We deleted the old datablock today, and created a new one in hopes that was the problem and spawned the player temporarily. It was gone when we restarted. Tried again, and no player at all. There was no error message, however, so that's a bonus.

Is it possible to drop a player in after we have the datablock? F7 maybe? Will try when I get to work in the morning.
#3
01/12/2012 (10:32 pm)
Can you send me a copy of your art/datablocks/managedDatablocks.cs file to richardr@garagegames.com?

And - Double double double triple check that you click the Save Datablock button after you create it. If you don't save it, it doesn't save. I know that sounds condescending, but that's where I usually have issues myself - forgetting that one little thing.

Also, when changing values in datablocks remember to hit ENTER to commit the change to the value (type the number and hit ENTER - don't click to the next field until you hit ENTER). Technically not all of the editors require this, but it is a good habit to get into.

#4
01/13/2012 (11:40 am)
Email sent. Is there a way, after we have the datablock in place to spawn a player?
#5
01/17/2012 (1:42 pm)
There are a few ways to choose what is spawned, but the simplest is to choose the class and datablock in the spawn point settings.

You can also change the defaults in scripts/server/gameCore.cs in the initGameVars() function - change $Game::DefaultPlayerClass and/or $Game::DefaultPlayerDataBlock to your desired class and datablock, but this sets the default spawn class and datablock for the whole game.
#6
01/17/2012 (2:32 pm)
Silly question - what are your students using for a script editor?