(Thanks to everyone who’s helped me on other stuff so far - I know these must seem like noob questions.)
I’ve got a point in my game where I’d like to automatically give a stuck player hints. However, I’m not having much luck getting these to play nice with other code.
So, for example:
The Laboratory is a room. The lab door is a locked door. The lab door is north of the Laboratory and south of the Resurrection Room. Using is an action applying to one thing. Understand "use [something]" as using. The player carries an orb. The wizard is a man in the Laboratory. Instead of asking the wizard about something: say "'Hmm hmm,' he says, absentmindedly."; continue the action. Hint-countdown is a number that varies. When play begins: now hint-countdown is 4. Instead of going north from the Laboratory: say "The wizard looks up briefly and mutters some words, and you are thrown back from the door." After doing anything other than using the orb: decrease hint-countdown by 1; continue the action; After doing anything other than using the orb when hint-countdown is 1: say "Maybe something in your inventory will help."; continue the action; After doing anything other than using the orb when hint-countdown is less than 1: say "[italic type]Type USE ORB.[roman type]"; continue the action; Before using the orb: now hint-countdown is 100000; say "The orb glows and suddenly the entire northern wall is gone!"; continue the action; Every turn: say "hint-countdown is [hint-countdown]"; continue the action.
Here’s a sample readout:
I think the issue that I’m having is that my “instead” rules are meaning that the parser isn’t registering these actions as a “doing anything” that would decrease the countdown. However, adding “continue the action” statements or rephrasing as “carry out asking” results in nonsensical scenarios like the game reporting both that the wizard responds and that he does not respond, in the same turn. What do I need to do to make sure the countdown is counting down? Is there some kind of “return” equivalent that I’m missing?
It’s also mildly frustrating to me that, while I’m able to get special responses to print before the hint, the default responses (like “Time passes” or “Dropped”) are printing after. How can I fix this?
Thirdly, attempting to go north is not registering as a “doing anything” (with or without a “continue” statement), presumably on account of the door’s being locked, but I’d also like this to count towards the hint countdown.