Multiple scores

Started by Sayhello-hello, Fri 01/10/2010 20:52:48

Previous topic - Next topic

Sayhello-hello

Hi everyone,
I am kind of lost as to how to construct multiple scores in AGS (or just in general).
So basically you would have score A, score B, score C and so on...
if score A = 2 then something happens and likewise with B and C, but I can't quite figure out how to make different scores.

Matti

Just don't use the built-in scoresystem and create a variable for each score you want to have..

KamikazeHighland

Between Fonts and Scripts there's a section for Global Variables.  You just right click the blank list and hit "add", give it a name (score1, score2..), choose "int" for intergers and what the value should be at the beginning. 8)

You can try this in a room.  Make a hotspot, then go over to the bottom right and click the lightning bolt over the room properties.  Choose one of the actions for a click on the hotspot, which will take you to the room script under a function.

Example:

function hHotspot1_Look()
{
 score1 = (score1 + 4);
 Display("score1: %d", score1);
}

When you Look at hotspot one, you'll add 4 points to score1 and your new score will be displayed. ;D

??? P.S. I have my own question I'd like to ask.  ???

When editing GUIs you can add a GUI label and replace the name with @SCORE@ to display the score, but what about OTHER VARIABLES?  How can I display a variable OTHER THAN the game's default score in a gui label?

tzachs

Quote from: KamikazeHighland on Mon 04/10/2010 21:33:37
??? P.S. I have my own question I'd like to ask.  ???

When editing GUIs you can add a GUI label and replace the name with @SCORE@ to display the score, but what about OTHER VARIABLES?  How can I display a variable OTHER THAN the game's default score in a gui label?

In the repeatedly execute function, put:
Code: ags

myLabel.Text = String.Format("%d", myScore);

SMF spam blocked by CleanTalk