What I’m trying to do is allow an end of story scenario to play out but once the obituary part occurs, to stop it. This is for some unit testing tools I’m doing where some actions do lead to an end of game but I want the end of game output to be accepted but then simply nullify that the end of game occurred.
More specifically, I want to stop the question “Would you like to RESTART, RESTORE a saved game, QUIT or UNDO the last command?” from being asked as that kills any unit testing tools in their tracks.
Just to see if I could get avoiding the question to work at a simple level, I tried this:
Rule for printing the player's obituary:
say "Avoid Death" instead.
That doesn’t work. The question is still asked.
I tried:
Rule for printing the player's obituary:
end the printing the player's obituary activity.
That doesn’t work. The question is still asked but you get:
*** Run-time problem P13: Tried to abandon an activity which wasn’t going on
Then I tried:
After printing the player's obituary:
end the printing the player's obituary activity.
That doesn’t work, you get:
Glulxe fatal error: Stack overflow in function call.
I also tried to abandon – rather than end – the activity and the same errors mainly still occur. For example, I tried this:
After printing the player's obituary:
abandon the printing the player's obituary activity.
The question still gets asked but you get this set of errors:
[** Programming error: tried to write to -->-1 in the array “activity_parameters_stack”, which has entries 0 up to 19 ]
[ Programming error: tried to write to -->-1 in the array “activities_stack”, which has entries 0 up to 19 **]
I also tried to just fail the rule, like this:
Before printing the player's obituary:
rule fails.
No errors come up but it doesn’t do anything. The question is still asked.
Basically if you try to do anything with “Before” or “Rule for” with this activity, you get an error about how the activity wasn’t going on or nothing at all happens. So it seems like you have to handle things in the “After” part of the handling, but that leads to various types of errors.
So maybe the better question here is how you can entirely subvert how an end of game (“obituary”) part of Inform works.
Any ideas?