Gamebasedata' error
by Sean H. · in Torque Game Engine · 05/19/2005 (6:51 pm) · 0 replies
Im getting really frustrated here. im trying to do two very simple things in the demo and i cant figure out why its not working. im trying to load another separate player object and im trying to move the player object using setvelocity().
what i would like to do is load a separate player object so that its present at mission start. to this end, i added this
datablock PlayerData(dummy)
{
category= "character";
shapeFile = "~/data/shapes/player/player.dts";
mass=20;
}
right after the 'lightmalehuman' armor datablock in server\scripts\player.cs and i added
%dummy = new player(slave)
{
datablock = dummy;
client= %this;
};
MissionCleanup.add(%dummy);
%dummy.settransform("0 0 300");
at the end of GameConnection::CreatePlayer() which is called from GameConnection::onClientEnterGame(). Im getting this error:
Object 'dummy' is not a member of the 'GameBaseData' data block class
fps/server/scripts/game.cs (306): Register object failed for object slave of class Player.
huh? according to everything ive read this should work. the only thing im not sure about is setting %dummys client=%this, but i only threw that in because its not working. i cant figure out what the problem is.
also, why is it so hard to make anything move? every time i call setvelocity() the character is pushed a little but brought to a halt. i asked about this before and the answer i got was friction but ive found this to still be the case even when i set the mass to 0.1 which should just about zero out the friction. i finally got the character to move using a function that continuously reschedules itself calling setvelocity() over and over. is there an easier way to achieve constant velocity?
what i would like to do is load a separate player object so that its present at mission start. to this end, i added this
datablock PlayerData(dummy)
{
category= "character";
shapeFile = "~/data/shapes/player/player.dts";
mass=20;
}
right after the 'lightmalehuman' armor datablock in server\scripts\player.cs and i added
%dummy = new player(slave)
{
datablock = dummy;
client= %this;
};
MissionCleanup.add(%dummy);
%dummy.settransform("0 0 300");
at the end of GameConnection::CreatePlayer() which is called from GameConnection::onClientEnterGame(). Im getting this error:
Object 'dummy' is not a member of the 'GameBaseData' data block class
fps/server/scripts/game.cs (306): Register object failed for object slave of class Player.
huh? according to everything ive read this should work. the only thing im not sure about is setting %dummys client=%this, but i only threw that in because its not working. i cant figure out what the problem is.
also, why is it so hard to make anything move? every time i call setvelocity() the character is pushed a little but brought to a halt. i asked about this before and the answer i got was friction but ive found this to still be the case even when i set the mass to 0.1 which should just about zero out the friction. i finally got the character to move using a function that continuously reschedules itself calling setvelocity() over and over. is there an easier way to achieve constant velocity?