Score board and kill cap
by Jonas · in Torque 3D Beginner · 06/12/2010 (9:16 am) · 4 replies
Hey everyone!
I have a question regarding Score board and death cap on online levels.
Ok lets start out with score board. What i wanna do is have a GUI window appear when a button is pressed.
That shows deaths/kills for each player. I have noticed that the console is saving how many times i die/kill something is it possible to use that data in a GUI window and if so how will i go about doing that?
What i mean with kill cap is lets say the kill cap is 50 as soon as someone gets 50 kills the map going into a gui screen that shows stats of the game and when the one holding the server press resume the game starts again.
I know how to do the GUI window but i am unsure of how to do the statistics accurate to the match.
Best regards
/Jonas
I have a question regarding Score board and death cap on online levels.
Ok lets start out with score board. What i wanna do is have a GUI window appear when a button is pressed.
That shows deaths/kills for each player. I have noticed that the console is saving how many times i die/kill something is it possible to use that data in a GUI window and if so how will i go about doing that?
What i mean with kill cap is lets say the kill cap is 50 as soon as someone gets 50 kills the map going into a gui screen that shows stats of the game and when the one holding the server press resume the game starts again.
I know how to do the GUI window but i am unsure of how to do the statistics accurate to the match.
Best regards
/Jonas
About the author
Freelance 3D artist at day scripter/coder on Enduring Life at night. Lover of all things TorqueScript.
#2
EDIT: hmm... wouldn't be a bad idea to slightly rewrite this so that each gametype has a unique global name for EndGameScore
06/12/2010 (10:13 am)
Glancing over the script files I see that the endGameScore is hardcoded to 20// Set the gameplay parameters %game.duration = 30 * 60; %game.endgameScore = 20; // This shouldn't be hardcoded! %game.endgamePause = 10; $Game::EndGameScore = 20;Should probably be
// Set the gameplay parameters $Game::EndGameScore = 20; %game.duration = 30 * 60; %game.endgameScore = $Game::EndGameScore; // now it makes use of the global variable %game.endgamePause = 10;
EDIT: hmm... wouldn't be a bad idea to slightly rewrite this so that each gametype has a unique global name for EndGameScore
#3
If i can just spin on another thing really quick.
If i want to change the firing mode or how fast a weapon can fire or how many shoots it can get of before reload how would i go about doing that and what do i need to think about?
Now i only have the "states" from the Full template.
Note: i am not asking for a direct answer how to do this just in general, and what i need to think of when modifying states.
06/12/2010 (1:38 pm)
Ah thank you ill look into it.If i can just spin on another thing really quick.
If i want to change the firing mode or how fast a weapon can fire or how many shoots it can get of before reload how would i go about doing that and what do i need to think about?
Now i only have the "states" from the Full template.
Note: i am not asking for a direct answer how to do this just in general, and what i need to think of when modifying states.
#4
Best regards Jonas
06/14/2010 (6:48 am)
Hey again sorry for reviving this thread again but i cant for the life of me figure out how i should go about getting the GUI to appear and then pass it along to cycle.Best regards Jonas
Associate Michael Hall
Distracted...
art/gui/playerList.gui
scripts/client/playerList.gui
The default keybind to access this GUI is f2
Scoring limits are changed in the appropriate gametype's script file. Look in scripts/server/gameDM.cs, it has a checkScore() function that checks the client's current score and if it's greater than the EndGameScore it tells the game to cycle:
// Determine if this client has reached the $Game::EndGameScore limit, // and if so then cycle the game. function DeathMatchGame::checkScore(%game, %client) { //echo (%game @"c4 -> "@ %game.class @" -> DeathMatchGame::checkScore"); echo("score: "@ %client.score @" "@ %game.endgameScore @" "@ $Game::EndGameScore); if (%client.score >= %game.endgameScore) cycleGame(); }Simply find and change the EndGameScore variable to your preference. Also in this function is probably where you would want to pop up your endgame score gui before passing things to cycleGame()