I’d been using this quite extensively in a project where only the player character moved around, and it didn’t dawn on me how much more complicated things would get once I made somebody else move.
Long story short: my character enters room while followed by another NPC that has an AccompanyingState. When entering a room for the first time, a scene is supposed to play, and then never again. This is quite easy with a single traveller:
[code]place1: Room ‘Random Room’
“This is a place”
north = place2
place2: Room ‘Random Room 2’
“This is a place too!”
south = place1
if (sceneDone == true)
"Scene goes here. ";
sceneDone = true;
sceneDone = nil
My problem is when I have a character following me. For some reason, having someone following me causes the event not to trigger… or perhaps trigger too many times. I notice that if I remove the line that sets sceneDone to True, the scene triggers correctly (every time I enter the room, which is not desirable). I’m guessing the NPC with accompanyingState enters the room before the PC does, causing the scene to play invisibly for the NPC, and so sceneDone is already set to True by the time my character steps inside.
…or so I’m guessing. The question would be: if I’m right about what’s causing this, is It possible to make enteringRoom(traveller) trigger ONLY when the one walking in is a specific character (the PC in this case)? Or am I getting the whole situation wrong?