When health reaches 0


#1

If the MCs health reaches 0 can I just use an if statement in the stats screen to send the character to the death scene or do I have to and an if statement for each scene where health loss is possible?
*if (Health <= 0)
</>*goto_scene SadEnding


#2

You’ll have to do it every time health can be lost. If it were on the stats screen, the player wouldn’t lose until they checked it. At least, I think so.


#3

A *if statement for each scene is not necessary. Just create a label with your Health test and link it to your code with a simple *gosub command.

simple!


#4

A small note, but it’s now even a tiny bit easier then copy/pasting subroutines with *gosub_scene. Use *gosub_scene to go to the death scene every time you reduce health, and than just put a check to see if the PC’s health is > 0 with a *return if it is.


#5

Yep, that’s a simpler way to do it. I don’t use *gosub often.

Here’s the wiki page for it, in case you need more info!


#6

Thanks everyone, I will try that out


#7

I didn’t want to make too many post so
*title Factions: Raids of the Divided
*author Waseeq
*scene_list
and then the rest of my scenes

how do I get rid of the error for *author is it no longer a command?
The error says ‘author’ is a non existent command


#8

You probably somewhere put *author = x rather than *if author = x.


#9

It works without the if, I just had to redownload everything.