How do i change the player model?
by Alexander B · in Torque Game Engine · 08/02/2008 (5:29 pm) · 11 replies
I can't change the orc. I don't know why. I even delted the player.cs and the orc is still there. The only way to change the orc is it copy and paste over my player model to the player folder and remove player.dts and make a new player.dts.
Anyone know why this is happening?
Anyone know why this is happening?
#2
EDIT: here is what it says in my game.cs
function GameConnection::createPlayer(%this, %spawnPoint)
{
if (%this.player > 0) {
// The client should not have a player currently
// assigned. Assigning a new one could result in
// a player ghost.
error( "Attempting to create an angus ghost!" );
}
// Create the player object
%player = new Player() {
dataBlock = PlayerBody;
client = %this;
};
MissionCleanup.add(%player);
08/02/2008 (7:30 pm)
I deleted the one in server/scripts. i will have a look at the function you posted.\EDIT: here is what it says in my game.cs
function GameConnection::createPlayer(%this, %spawnPoint)
{
if (%this.player > 0) {
// The client should not have a player currently
// assigned. Assigning a new one could result in
// a player ghost.
error( "Attempting to create an angus ghost!" );
}
// Create the player object
%player = new Player() {
dataBlock = PlayerBody;
client = %this;
};
MissionCleanup.add(%player);
#3
If you have done all this, check out your console.log to see where the errors are.
08/02/2008 (8:26 pm)
In server/scripts/player.cs, at the very top is where you point the script to your player model. Also, make sure your player.cs inside data/shapes/yourPlayerFolder is execed as well. (I believe that gets execd in init.cs)If you have done all this, check out your console.log to see where the errors are.
#4
08/02/2008 (9:21 pm)
Which init.cs are you talking about?
#5
08/02/2008 (9:24 pm)
EDIT: oops sorry for double post.
#6
08/03/2008 (2:43 am)
Can someone please help me?
#7
second: open that file.
third: search for 'datablock PlayerData(PlayerBody)', line 520 in my file.
forth: look down about 6 lines to the one that starts with 'shapeFile = '
you will see:
shapeFile = "~/data/shapes/player/player.dts";
edit this path to go to your new dts file.
Do you know the nodes you need in your player dts file? Because it won't work well if you don't have them.
08/05/2008 (8:06 pm)
First: un-delete the /demo/server/scripts/player.cs.second: open that file.
third: search for 'datablock PlayerData(PlayerBody)', line 520 in my file.
forth: look down about 6 lines to the one that starts with 'shapeFile = '
you will see:
shapeFile = "~/data/shapes/player/player.dts";
edit this path to go to your new dts file.
Do you know the nodes you need in your player dts file? Because it won't work well if you don't have them.
#8
08/05/2008 (10:52 pm)
I tried what you said John but it still loads the orc. I am going to go back to an older build and see what happens. Also what is a node.
#9
08/05/2008 (11:13 pm)
I have gone back to an older build and fixed everything. Thanks everyone for you help.
#10
08/05/2008 (11:43 pm)
I have gone back to an older build and fixed everything. Thanks everyone for you help.
#11
if you run DeleteDSOs.dat, you will know your new script files are being used or the game will not run.
08/06/2008 (6:18 am)
If you make a change to a script file and the changes don't seem to be taking effect. There are steps to take to fix it instead of going back to previous editions of the files. Most likely there is a syntax error. look in the console for script compilation errors. If a script does not compile after a change, the game will use the previously compiled .dso.if you run DeleteDSOs.dat, you will know your new script files are being used or the game will not run.
Torque Owner Mike Rowley
Mike Rowley
There are 2. One in the player folder, and one in server/scripts. This is the one you need to point to your player model. You will need to copy the player.cs in the player folder to get your animations to work.
Also, if you look in server/scripts/game.cs, you'll find this function:
function GameConnection::createPlayer(%this, %spawnPoint) { if (%this.player > 0) { // The client should not have a player currently // assigned. Assigning a new one could result in // a player ghost. error( "Attempting to create an angus ghost!" ); } // Create the player object %player = new Player() { dataBlock = PlayerBody; //Make sure this points to your players datablock name in server/scripts/player.cs client = %this; }; MissionCleanup.add(%player);