Giving the player Hit Points

Started by CheeseMonkeyC, Thu 26/02/2004 20:49:32

Previous topic - Next topic

CheeseMonkeyC

Is there a way to give the player character Hit Points, like in Quest for Glory?  I don't want it to be based on stats though.  Just a random number
(8-48).  I saw something about

Random (int max)
to return
0,1,2 or 3 on Random(3),

but how can I return 8-48?  Or am I going about the whole thing wrong?

SSH

You mean 8+Random(40)?

by the way, questions like this should maybe be placed in the Beginner's Tech Forum...
12

CheeseMonkeyC

That makes sense.
How do I get the random number to be displayed on a GUI though?  @SCORETEXT@ is the closest thing I can think of, but that would affect the score, (which I'm using for something else)

And should (can) I move this topic?  Or can I continue here for now?

deltamatrix

To display an number in a GUI, it needs to be converted to a string.

This is how I did it...

StrFormat(health, "%d",GetGlobalInt(10));
SetLabelText(3, 8,health);

where 'health' is the string to be drawn on the GUI and 'GlobalInt(10)' is the health stat.
BAD WOLF - TORCHWOOD - MR SAXON - THE BEES ARE DISAPPEARING - PANDORICA - RIVER SONG

SMF spam blocked by CleanTalk