I need to have something happen (an NPC greet the player, basically) when a character is moved into another room, for the first time, as opposed to entering the room, of the players own free will.
After messing around for a while… i got
carry out going to the room:
to work, but this only triggers when the player walks in by his own free will… not when he is moved there.
I’m not new to programming (i’ve been programming computers for about 25 years) and maybe that is the problem. I wrote a game in TADS many years ago, and that seemed to make more sense. I have been fighting the temptation to go back there… this is a quest now. I will make this work.
I’m not 100% sure, I am new to Inform myself. Here’s my stab at the problem:
“Move” in this case is a phrase and not an action. Therefore, you can’t have rules that apply to it like After, Instead, and so forth.
What you can do is create a new phrase, called something like Teleport, and put the logic in teleport that does what you are talking about. Then instead of moving someone around, you just “teleport them”.
This is somewhat awkward wording, but it should do what you want:
Every turn when the player is in the Greeting Room and the Greeting Room was not visited:
say "Bob says, 'Well, hello there.'"
“…was not visited” actually means “was not visited at the beginning of this turn.” So the rule will only fire the first time you enter the Greeting Room, regardless of how you got there.