Game Development Community

Player model crashing my game

by Mike Stoddart · in Torque Game Engine · 08/01/2002 (6:03 pm) · 1 replies

I'm doing some rather funky stuff with the fps/server/scripts/player.cs file, and I'm 85% sure that this is the cause of my problem. But I thought I'd check anyway.

I have a file alliedLightSoldier.cs, which is essentially the above file, renamed and with a few tweaks.

I'm execing this file inside of sendLoadInfoToClient in MissionInfo.cs. Now I know this is silly, but I have my reasons. Basically, the mission file now dictates which shape files are used for that mission, and they are loaded when the mission file is parsed. So my mission file contains:

new ScriptObject(AlliedUnits) {
         unit1 = "alliedLightSoldier";
         unit2 = "alliedHeavySoldier";
         unit0 = "alliedScout";
         numUnits = "3";
   };

When the MissionInfo.cs file reads these lines, it execs the appropriate file:

alliedLightSoldier loads alliedLightSoldier.cs

If I use the default player model (the futuristic model) that comes with Torque, it works fine. I can enter the game, I choose my team and my player class (Allied Light Soldier).

Next, I copied the Realm Wars shape directory rw/data/shapes/player, and placed it into fps/data/shapes/allied. Then I changed alliedLightSoldier.cs to refer to the Realm Wars shape file instead:

shapeFile = "~/data/shapes/allied/player.dts";

Now when I load and choose this class, the program crashes at:

F32 TSThread::getPos()
{
   return transitionData.inTransition ? transitionData.pos : pos;
}

in tsThread.cc. The this pointer is NULL.

Ok so I know that I'm probably doing something wrong with this (if you understand what I'm trying to do!), but......... I was going to ask for any suggestions how to fix it, but I guess that would be impossible.

So any comments then? I'm clutching at straws here I think.

Thanks

#1
08/01/2002 (6:14 pm)
In my usual style, I managed to solve the problem through sheer fluke.

I changed fps/data/shapes/allied/player.cs accoringly:

I changed:

datablock TSShapeConstructor(playerDts)

to:

datablock TSShapeConstructor(alliedLightSoldierDts)

Of course, I've no idea what the significance of this is, but I'm happy!