Status variables. Help please ^_^
ramtha
04 Nov 2005, 18:15Is there any way to put a cap on status variables. Such as health or money. Meaning, you can only have up to 500 dollars or 20 points of health, and no more, so that if you were to say heal yourself, you wouldnt have more than the cap amount.
GameBoy
05 Nov 2005, 05:33If %HP% = 30 Then
Msg "You already have full HP"
You'll have to forgive me, I haven't used ASL (Again) for a long long time. But it's something similar to this.
With potions... say a potion healed 10 HP, and you have 25 HP, you could have it check every time the potion heals 1 point that you're not going over 30, or you could have the potion check,
if %HP% > 20 Then
Msg "You can not heal yet"
Else
Do Heal
Again you'll have to excuse my VB syntax there, not used ASL in some time, but you can get a good idea of what to do there, although my suggestion is indeed basic. One of the more experienced ASL users will probably give you a better suggestion.
paul_one
06 Nov 2005, 19:27When you make a status variable, you go into the "onchange" part and check whether the variable is that amount (say 500 dollars). And then if it is over that amount, you make the variable equal to that amount (say 500).
So you'd make a conditional, see if:
"#variablename#
is greater than
500"- or other limit
put in the "then" part:
set variable "#variablename#" to "500" - or other limit.
Sorry I can't explain better.
I may put up a little file in a day or two - unfortunately, I start a new job tomorrow, and don't know how busy I shall be.
So you'd make a conditional, see if:
"#variablename#
is greater than
500"- or other limit
put in the "then" part:
set variable "#variablename#" to "500" - or other limit.
Sorry I can't explain better.
I may put up a little file in a day or two - unfortunately, I start a new job tomorrow, and don't know how busy I shall be.
ramtha
09 Nov 2005, 19:37Actually this helped alot, thank you.
paul_one
10 Nov 2005, 10:56That's good.
Will get to a little demo, if you still wish, on Saturday - or perhaps tonight/Friday.
Glad I could offer assistance.
Will get to a little demo, if you still wish, on Saturday - or perhaps tonight/Friday.
Glad I could offer assistance.