So, I have a monster that is chasing the player in one region. It works great, except that Inform uses the “So-and-so arrives from the [direction]” line to announce the arrival of the creature, which is fairly undramatic when dealing with a monster trying to kill the player. I’d prefer to change that to something with a little more oomph.
I was able to tell inform to say what I want when the monster arrives, but I don’t know how to tell it to also quit saying the rather bland line that’s built in.
Any help would be appreciated!
As a general strategy, if you type RULES when testing the game in the Inform developers program, it will start telling you what rules are being checked at each stage of the game. Then, whichever rule produces the effect you are describing can be changed.
That’s the “describe room gone into” rule, in the report going rulebook. You can override it with an after rule:
EDIT: First attempt at writing the rule was pretty sloppy; here’s a revised and compilable version:
After the monster going when the room gone to is the location of the player:
say "Blargh!! The monster bursts in from [the opposite of the noun]!"
Another way to find and change automatically produced messages is by looking at responses.
If you type “responses all” it will give you an enormous list of every response message, and you can try searching through it for your phrase. You have to be careful about adaptive text when you’re figuring out how to search–“arrives” here comes from the verb “arrive” so in this case you want to search for “[arrive]”.
(Using Brian’s suggestion of “rules” to figure out the rule would perhaps cut down the effort of finding this.)
Anyhow, this turns out to be the describe room gone into rule response (F): “[The actor] [arrive] from [the back way]”. (There are a couple other messages for up and down, and a case where the way the actor came in doesn’t match up with the map in a neat way.) “The back way” here is a local variable defined in the rule, which is the opposite of the noun. So another thing you could do is change this response:
The describe room gone into rule response (F) is "[if the actor is the monster]Aaaaah! The monster crashes in from [the back way][otherwise][The actor] [arrive] from [the back way]"
This might be something to do if you really need to capture all the logic in the describe room gone into rule, which has a lot of edge cases. If none of those edge cases apply, it’s probably simpler to use Mike’s After rule. (Though you should use “the opposite of the noun”–again assuming no edge cases like up or down connection.)
…in fact, one issue is that the responses in the describe room gone into rule basically have a hard-coded period at the end. (There’s a bunch of different responses without periods, designed to accommodate extra clauses for cases like the case where an actor is pushing something, which you may be in, etc.) So if you want to have an exclamation point you definitely need to do something besides just rewriting responses.
YES! Thank you! I didn’t know that! That makes so many things easier. Doing what you said, I just found and turned off the “describe room gone into” rule. Worked like a charm!
I always wondered how you were supposed to find specific rules. This is great!
Thank you! This is all very helpful.
Thank you! And thanks to all of you. This is a fantastic message board. I’ve never had to wait long for someone to help me overcome an obstacle in my programming. I wish I understood Inform better so I could return the favor once in a while, but I fear a lot of my solutions are a kind of bulldozer approach that work for me, but are probably 10X longer and less elegant than they need to be.
…and you know what else? This is a question I had a long time ago, but I figured it wasn’t very critical, and I had bigger things to do. So I put it aside.
And now I get to tweak something I always sort of hoped to. So thanks back to you.