Game Development Community

player.setDatablock(defaultPlayerData); error

by Jovani Adolfo · in Torque 3D Professional · 05/26/2012 (12:20 pm) · 8 replies

Every time that I begin a new game, I must set the name of the player over and over again. Once I quit, his name is not there. How do I make his name permanent?

#1
05/26/2012 (12:39 pm)
change the following

1)\game\art\gui\JoinGameGui.gui(117): text = "Visitor"


2)\game\core\scripts\client\defaults.cs(11): $pref::Player::Name = "Visitor";

3)\game\scripts\client\prefs.cs(32): $pref::Player::Name = "Visitor";

After changing those 3 from visitor to bob should be bob forever
#2
05/26/2012 (12:54 pm)
I mean the name of the object player
#3
05/26/2012 (1:08 pm)
Okay I am not getting yeah what are you asking to change. you whant to have a new datablock not named player?
#4
05/26/2012 (1:21 pm)
You know how when you are on world editor and you change the name of an object? Well, when I exit the game, the name doesn't stay, I have to adjust it every time I start a game.
#5
05/26/2012 (1:29 pm)
are you trying to change the Global name or the source class?

Becues the player is a new spawn each time you start the game the spawn sphere is what is saved in your level
#6
05/26/2012 (1:32 pm)
Global name
#7
05/26/2012 (1:40 pm)
what are you trying to acomplish by this? maybe thats a better way of asking this. Becues the player is a new spawn each time you start the game the spawn sphere is what is saved in your level.
#8
05/26/2012 (9:16 pm)
Quote:
You know how when you are on world editor and you change the name of an object?
may be problem is in your project or pc.i am having no issue like that.and never have heard like this.is that problem happened with other template.

ok.wait.
may be in world editor u are selecting player.then in it's name field u are entering the name.that will not work.because there is a script line which do the naming of player.and it is only a show off name of player.not the name of the player object that you see in world editor.

do this:
press "~".(keyboard key which print ~)
in bottom of the console paste this :
$pref::Player::Name = "YOUR_NAME";
press enter
now quite to main menu and load the mission again.
press alt+c.
you will see your name on the top of the player



Quote:player.setDatablock(defaultPlayerData);
where u get this "player" things?
it only produce an error.