0 votes
by (2.5k points)
closed by

I want to make a basic if then statement for a death-reload mechanic...

(Unless: -Player is on "Dead"-)[
(If: $health < 1)[
(go-to: "Dead")
 ]
]

(once the player is on the death passage, they can reload to their last "save" and gain all their health)

The reason this is important is if I don't do this it will keep reloading death because of having no hp and saying unless history contains "dead" will mean dying twice will break the game.

I need something valid to replace "Player is on "Dead"

closed with the note: Got my answer.

1 Answer

+1 vote
by (159k points)
selected by
 
Best answer

You can use the (passage:) macro to obtain the name of the current passage being viewed.

(unless: (passage:)'s name is "Dead")[
	(if: $health < 1)[
		(go-to: "Dead")
	]
]

warning: The above example was written from memory, and it has not been tested.

by (2.5k points)

So what ended up happing is it worked, but going back "reloading" wouldn't work. So I made a small edit that fixed it.

(unless: (passage:)'s name is "Dead" or "Save point")[
	(if: $health < 1)[
		(go-to: "Dead")
	]
]

Again, you're the best.

by (159k points)

Your conditional expression is wrong, it should be.

(unless: (passage:)'s name is "Dead" or (passage:)'s name is "Save point")[
	(if: $health < 1)[
		(go-to: "Dead")
	]
]

 

...