(Swear I posted about this yesterday, maybe I didn’t press send)
So I have a situation where I want someone to notice you and say something about your appearance, after you do one of a few things to them. If you throw something at them, talk to them, give them something, it will get their attention, and IF you look different than before, they will make a comment on it. The point is it’s the same check, but it can be triggered in different ways.
The way I’d do this in programming is I’d just have a function CheckPlayerAppearance that I’d call in all the parts of the code where something happens that should get their attention, eg. Throw, Talk, Give, etc.
In Inform 7, I gather it’s a “rules based” system, not a “function based system”, so I imagine what I’m supposed to do is, create a state for a person, then act when that state is achieved eg.
A person can be attentive.
Instead of throwing something at Bob:
say "Bob says: Ow that hurt.";
Bob is now attentive.
Instead of giving something to Bob:
say "Bob says: I don't want it.";
Bob is now attentive.
But I’m not sure about how to take action on that state. I imagine something like;
If Bob becomes attentive:
if player wears the hat:
say "Bob says: That's a cool hat!".
That syntax doesn’t work, and I’m not sure what to search for to find the answer…