Adv3Lite -- ActorState

Greetings and Happy New Year!

I looked for the answer to my issue in several areas (documentation, the code, here) but came up empty, so I’m hoping somebody can point me in the right direction.

To set the stage, an NPC has two ActorStates – npcMoving & npcReading. In npcMoving, I modify the sayArriving() and sayDeparting() methods. Everything works great in that the custom messaging in sayArriving() and sayDeparting() is displayed appropriately when npcMoving isActive.

However, when I switch from npcReading back to npcMoving, the sayArriving() & sayDeparting() methods aren’t called anymore.

The code to switch back is:


When the npc arrives, the default library message (npc arrives in the area) is displayed instead of the custom sayArriving() message.

Thanks for the help!

– Mike

Hahahah… Ok, so when I read my post to make sure it made sense, the answer jumped out at me (I just tested it and it’s no longer an issue). Funny how that works.

I need to put npc.setState(npcMoving) before I call npc.travelVia(libraryDoorInside);
It seems so obvious to me now, but when you’re off and looking elsewhere, the solution is sometimes hard to find.

– Mike