Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Sayhello-hello on Fri 01/10/2010 20:52:48

Title: Multiple scores
Post by: Sayhello-hello on Fri 01/10/2010 20:52:48
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.
Title: Re: Multiple scores
Post by: Matti on Fri 01/10/2010 21:08:26
Just don't use the built-in scoresystem and create a variable for each score you want to have..
Title: Re: Multiple scores
Post by: KamikazeHighland on Mon 04/10/2010 21:33:37
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?
Title: Re: Multiple scores
Post by: tzachs on Mon 04/10/2010 21:48:16
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:

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