Ending the game

On inform for windows I am trying to make it so if the player doesn’t do something, or take something the game will end in death. Any suggestions?

ex: After entering van:
If player has bill,
say " good.";
end the game in victory
This worked but this next one didn’t…

After entering van:
If player doesn’t have bill,
say " too bad.";
end the game in death.
Is there a way I can word it differently so it works?

“If the player does not have the bill”
or
“unless the player has the bill”.

Also, the indentation got lost, but it looks like your “if” statement only applies to the “say” message and not ending the game. That is, writing code like this will end the game whether the player has the item or not. You probably mean:

After entering van:
	if the player does not have the bill:
		say "Too bad.";
		end the game in death.

Okay so I tried to use that with what I had, but it’s not working, so how should I word it if I want one thing the player does to end in death and the other to not.
example: If they enter the van with the bill, the game continues. If they don’t have the bill the game ends in death.
any suggestions?

In what way is it not working?

After entering van:
If the player has the bill;
say " good.";
end the game in victory.
After entering van:
If player does not have the bill,
say " too bad.";
end the game in death.
This is what I have. And when you enter the van without the bill it say’s you have won the game.

This should work:

[code]After entering van:
If player is not carrying bill:
say " too bad.";
end the game in death;
else:
continue the action.

After player entering van:
If player carries bill:
say " good.";
end the game in victory.[/code]

You also need the ‘continue the action.’, if you still want the following rule to fire. Otherwise the rulebook will automatically end after the first fitting after rule.

To avoid this you could also use:

[code]After entering van when player is not carrying the bill:
say " too bad.";
end the game in death.

After player entering van when player is carrying the bill:
say " good.";
end the game in victory.[/code]

Hope that helped!

These phrases are deprecated in the current version of Inform 7 and will most likely be removed in the next release. You can get the same effect like this.

end the story saying "You have died!";
end the story finally saying "You have won!";

Hope this helps.

Or you could put both conditions inside a single rule: After entering the van: if the player has the bill: say "Good!"; end the story finally saying "You made it"; [or whatever message you like] otherwise: say "Too bad ..."; end the story saying "You have lost everything". [or whatever message you like]