I need to have a rule fire whenever the player moves to a new location (or enterable object) or an object moves to the holder of the player (typically this would be another actor moving into the location, but not necessarily).
After going:
foo;
try looking;
This seems to fire “foo;” in order to cover the first half of the first use case above, but it interferes with the looking action that is supposed to take place, making it not occur so I added “try looking” after. Is that safe?
As for if an object moves into the location, I haven’t figured out how to do that yet. How would I do that part?
You need to say “continue the action” if you want an After rule to fall through to the Report rules.
Statements like “move X to Y” can’t be tracked like this because they aren’t actions. Define a new phrase if you need more tracking, but be aware that it will be called many times per turn.
Aha! For some reason, this is the first time I’ve needed a “continue the action” rule after an after… I guess I usually don’t put after rules after actions, just after non-action rules. Good to know, thank you!
I kind of figured that tracking random movements of things wouldn’t be possible with a catch-all… I’d have to define that kind of movement anyway, so I’ll add the logic to any new rules I make for that.
However, I still hoped there was a rule for when an actor moves into the location. That should be supported in the core functionality right? This works for enterable things:
After an actor entering the holder of the player:
foo;
But I haven’t yet found an example with search (perhaps my search fu is weak) for the correct way to do this psuedocode:
After an actor that is not the player going to the location:
foo;
I did some testing, and the most concise I could get was
After someone going when the room gone to is the location...
It seems that objects after “matched as” prepositions have to be constants, rather than variables or phrases. Is this a bug? I can’t find mention of it in the documentation.
Definition: an object is non-player if it is not the player.
Definition: an object is loc-like if it is the location.
After an actor going to a loc-like room when the actor is non-player:
say "Foo."
In futzing around with this, I ran into both ordinary errors and “abject failure” errors. I’ve filed a bug that mentions both: inform7.com/mantis/view.php?id=1411