Permanent If


#1

Is there some way to make it so that if a stat ever reaches zero, the game goes to a scene? (such as death) It would make coding much easier.
Thanks :smiley:


#2

I am no pro at this by any means, in fact CJW or one of the others may have a simple fix. But I would make a check


*label death_check
 *if (heatlh=>0)
  *goto_scene death
 *else
  *return

Then I would run the check every time heath was changed. Of course I have not tested this one, but use something similar for a banking system. Hope this helps.


#3

Yup, just like @lordirishdas said:

*label death_check
*if (health<=0)

…*goto_scene death
*else
…*return

Then, whenever you need to:

The monster hits you!
*set health -5
*gosub death_check
*line_break
You shrug off the wound and carry on.

EDIT: Ignore the < br >, I don’t know why that is there.


#4

@Lucid the Forum doesn’t parse HTML perfectly, using a crocodile sign causes weird things like that to happen… If you use one in a private message it deletes everything after it… .-.


#5

Okay, that should save me some time. Thanks for your help


#6

@Lucid put `

` on the line before examples, and `

` and the yellow block which retains spaces too.


#7

Thanks, @Reaperoa , that’s handy!

I see that the crocs still give the br problem though. But, I like that pre to show spaces clearly for indentation.