Cant get the tutorial to work correctly
by Darin Pitts · in Torque Game Engine · 09/22/2006 (4:13 pm) · 0 replies
By the way just downloaded tourque sdk about 2 weeks ago and I love it. But for some stupid reason I cant figure out the Tutorial game. I have gone over the getting started file 100 times and checked my code about a dozen times and checked the name of the .ds files I was suposed to creat and even checked all the names of the objects I placed. For some reason the colission code isn't working. The basic Idea is to colect objects around the map and it is suposed to score them. Eventualy ending the game and asking to redo it. but what realy happens is I walk around and hit the objects like they are a soled brick. the objects dont dissapear and no score. For any of you that have any ideas let me know what I might have done wrong. oh and here is the code I wrote, copied and pasted from the .ds files.
first file. logoitem.cs located in the server folder
datablock StaticShapeData(TorqueLogoItem)
{
category = "Items";
shapeFile = "~/data/shapes/3dtorquelogo/torque_logo.dts";
};
function TorqueLogoItem::onCollision(%this, %obj, %col)
{
if(%col.getClassName() $= "Player")
{
%client = %col.client;
%client.score++;
commandToClient(%client, 'SetScoreCounter', %client.score);
%obj.delete();
%logocount = logos.getCount();
if(%logocount > 0
return;
// otherwise display victory screen
commandToClient(%client, 'ShowVictory', %client.score);
}
}
second file client game.cs located in the client folder
function ClientCmdSetScoreCounter(%score)
{
ScoreCounter.setText("Score:" SPC %score);
}
function clientCmdShowVictory(%score)
{
MessageBoxYesNo("You Win!",
"Would you like to restart the game ?",
"loadMyMission();",
"quit();");
}
it might be somthing in the code.
Thanks again for listening to me pull my hair out and screem :).
first file. logoitem.cs located in the server folder
datablock StaticShapeData(TorqueLogoItem)
{
category = "Items";
shapeFile = "~/data/shapes/3dtorquelogo/torque_logo.dts";
};
function TorqueLogoItem::onCollision(%this, %obj, %col)
{
if(%col.getClassName() $= "Player")
{
%client = %col.client;
%client.score++;
commandToClient(%client, 'SetScoreCounter', %client.score);
%obj.delete();
%logocount = logos.getCount();
if(%logocount > 0
return;
// otherwise display victory screen
commandToClient(%client, 'ShowVictory', %client.score);
}
}
second file client game.cs located in the client folder
function ClientCmdSetScoreCounter(%score)
{
ScoreCounter.setText("Score:" SPC %score);
}
function clientCmdShowVictory(%score)
{
MessageBoxYesNo("You Win!",
"Would you like to restart the game ?",
"loadMyMission();",
"quit();");
}
it might be somthing in the code.
Thanks again for listening to me pull my hair out and screem :).
About the author