The Lost in Rust is a room. The Iron Bark Trees are east of the Lost in Rust.
The rust storm passable is initially false.
The rust storm prepared is initially false.
The cross rust storm committed is initially false.
After reading a command:
If the player's command includes "follow" and the player's command includes "whistling" and the player is in the Lost in Rust:
If the rust storm passable is false and the rust storm prepared is false and cross rust storm committed is false:
now cross rust storm committed is true;
instead say "You're about to follow a noise inside your head into a storm made of rust. If you're sure about this try that again.";
Otherwise if the rust storm passable is false and the rust storm prepared is false and cross rust storm committed is true:
instead end the story saying "Following the whistling alone did little to stop the rust flakes from tearing away your flesh from your bones. You die in a very special kind of agony, one that has a whistling sound to it.";
Otherwise if the rust storm passable is false and the rust storm prepared is true:
now the rust storm passable is true;
try the player going east;
I am trying to have it so that if the player attempts to use a command twice while certain conditions are not met, the story ends.
However, on the second attempt nothing happens and until I try a valid command, such as go east, the end the game does not trigger. If this is due to it being an After rule, how would I change it to work? Do I need to define following and do this whole thing as an action rule?
âAfter reading a commandâ is not a normal âafterâ rule. Itâs an atypical processing stage coming after the player has typed something but before the parser has processed the command. Itâs not the place to run the core machinery of your game, which is how youâve used it here.
I think reason nothing is happening is because, though you run some code (e.g. âinstead say yadaâ) during the After reading a command stage⌠EDIT - the âinsteadâ means the command isnât continuing through to the parser, and then I donât think the every turn rules are running. The game canât end because the turn didnât end. Thatâs why the end is suddenly freed when you then type in a normal command afterwards; time got moving again.
You wonât run into any of these (weird!) problems if you create a Following action and code for it, and then maybe a noun âwhistlingâ which the following action can then act on. Then youâll be able to write:
Instead of following whistling: (beneath which is all the code youâve currently got from âif the rust storm passable is falseâŚâ onwards)
I agree! It is possible to horse around with the text of the playerâs command, make your own verb, then trigger it under the hood, but by then youâve already done more work than you would have were you to make a custom action.
But what youâd really miss out on is the lack of debug support you get from standard action processing. In a large game youâll want those tools at the ready!
Iâm not sure why youâve chosen to go with an âafter reading a commandâ rule here, since itâs much better to do this via an action instead. Try this.
"Test"
The rust storm passable is initially false. The rust storm prepared is initially false. The cross rust storm committed is initially false.
Following is an action applying to nothing. Understand "follow whistling" as following.
Check following when the rust storm passable is false and the rust storm prepared is false and cross rust storm committed is false (this is the give warning rule):
now cross rust storm committed is true;
say "You're about to follow a noise inside your head into a storm made of rust. If you're sure about this try that again." instead.
Check following when the rust storm passable is false and the rust storm prepared is false and cross rust storm committed is true (this is the end the story rule): end the story saying "Following the whistling alone did little to stop the rust flakes from tearing away your flesh from your bones. You die in a very special kind of agony, one that has a whistling sound to it." instead.
Check following when the rust storm passable is false and the rust storm prepared is true (this is the go east rule):
now the rust storm passable is true;
try the player going east instead.
Check going east from the lost in rust (this is the set storm passable rule): now the rust storm passable is true.
Report following (this is the catch all rule): say "Nothing happens.".
The Lost in Rust is a room. The Iron Bark Trees are east of the Lost in Rust.
Test lose with "follow whistling / follow whistling". Test win with "follow whistling / e / follow whistling".
This should allow the trying to do the same thing twice to end the game and going east to let the game continue as normal.
This part will be true if and only if both âfollowâ and âwhistlingâ are included in the playerâs command. While this may be what you were after (âfollow whistlingâ), itâll also allow commands like âdonât/stop follow whistlingâ, âwhistling followâ or even âIâm a whistling away follow da lead a lead a lead aâ!