How to make a you win screen when you win in a turn based fight fight

Hey im using harlowe in twine and im trying to make a turn based rpg and i tried to do this coding
[(if:$Ehealth is 0 “”(go-to: “1st win”)]
but everyone time i test it out i win no matter what

Please use the Preformatted text option when including code examples in a comment, it is the </> button that can be found in the comment field toolbar.

The structure / syntax of your (if:) macro example is invalid, it is missing the required associated Hook.

eg. [as show in the documentation] the structure of an (if:) macro call is…

(if: condition)[ content to process when condition is true ]

So a valid variation of your example would look something like…

(if: $Ehealth is 0)[(go-to: "1st win")]
1 Like

As GreyElf said, using the proper syntax your code should like this

(if: $Ehealth is 0)[(go-to: “1st win”)]

Remember that variables that are not set up previously read as “0” so that also might cause difficulty for testing.
Testing passage example:

(set: $Ehealth to 10)

(link-rerun: “Hit the enemy”)[
(set: $Ehealth to it - 2)[
(if: $Ehealth <= 0)[
(go-to: “1st win”)]
(else:)[<br>“You harmed the enemy.”]

Hope it helps :slight_smile: