Another OnCollision Tutorial question lol
by Brian Wilmeth · in Torque Game Engine · 12/31/2005 (11:58 am) · 3 replies
I also am having a problem with the tutorial. When I touch the object it dissapears yes fine... but the counter isn't implemented. I found out that neither of the following functions in clientGame.cs
function clientCmdSetScoreCounter(%score)
{
ScoreCounter.setText("Score:" SPC %score);
}
function clientCmdShowVictory(%score)
{
MessageBoxYesNo("You Win!",
"Would you like to restart the game ?",
"loadMyMission();",
"quit();");
}
are being called at all :(.. I know this because I commented out the return in logoitem.cs and tried calling
commandToClient(%client, 'ShowVictory', %client.score); when I collide with an object
yet the "Do you want to quit" YES/NO message box doesn't show up when I hit the object.
Yes I executed the file clientGame.cs in main.cs in the GameOne folder, so that can't be the problem. I simply don't know what I did wrong?
function clientCmdSetScoreCounter(%score)
{
ScoreCounter.setText("Score:" SPC %score);
}
function clientCmdShowVictory(%score)
{
MessageBoxYesNo("You Win!",
"Would you like to restart the game ?",
"loadMyMission();",
"quit();");
}
are being called at all :(.. I know this because I commented out the return in logoitem.cs and tried calling
commandToClient(%client, 'ShowVictory', %client.score); when I collide with an object
yet the "Do you want to quit" YES/NO message box doesn't show up when I hit the object.
Yes I executed the file clientGame.cs in main.cs in the GameOne folder, so that can't be the problem. I simply don't know what I did wrong?
About the author
#2
12/31/2005 (2:51 pm)
You can save to a .gui file from the GUI editor, and then exec the .gui file like it was a normal script to get the GUI into memory. IF your objects are named then you can refer to them by name from script. Note there can only ever be one object of a given name at a time.
#3
What do you mean by save the GUI ? did your score counter show up in game ? am i forgetting to save it correctly ?
05/27/2006 (5:47 pm)
I might have a problem like this i don't quite know. everything works axcept the counter.What do you mean by save the GUI ? did your score counter show up in game ? am i forgetting to save it correctly ?
Torque Owner Brian Wilmeth