Hi guys,
I'm sorry if this is a stupid question, I know it's covered in the forum but it seems to be only for outdated versions of AGS. I'm trying to make a Pokemon style battle system, and I need the Enemy hitpoints to be displayed in a GUI. The players hitpoints are displayed via @score@, so this is fine. I have defined enemy hitpoints like so -
SetGlobalInt(5,50);
How do I translate that into a GUI text label to display the value?
Any help is much appreciated
Thanks
Shaun
function repeatedly_execute() // GLOBAL asc
{
LSCORE.Text = String.Format("%d", game.score); // This is will display @SCORE@ at present time on Label LSCORE and will increase if you add to game.score (or minus of course).
}
game.score=(game.score+70); // One way of adding 70 to @SCORE@. There is a shorter way but outcome is the same.
From the manual:
QuoteNOTE: GlobalInts are now considered obsolete. Consider using global variables instead, which allow you to name the variables.
@SCORE@ is an AGS built in score system.
You may also need Game.DoOnceOnly in some cases. It's in the help manual.
Hope this helps
Many many thanks Slasher, exactly what I needed :)