I need an NPC to move to a door and disappear. I have been trying the code below. But, any tiny obstruction, such as another NPC walking in front of him, stops him and he just stands there. I am sure I there is some better way to script this.
Or combine both. The NPC getting spoken to should abort their walk action for sure, if their action queue isn’t locked.
If those don’t fix it, maybe a pseudoheartbeat that keeps checking whether they’re still walking and makes them resume if they’re not could do it.
I use both EffectCutsceneGhost and SetCommandable. NPCs then exit reliably.
I notice that in some modules, when blocked, the exiting NPC waits until the way is clear, then continues. I suspect this is what the official EscapeArea code does. However, I find this risky (especially when the party is quite large and there are multiple exiting NPCs) because the NPCs don’t give way to PCs, and may cause complete gridlock. The ghost effect is infallible and much safer, if you don’t mind that they clip through anyone in the way.
Thank you. I had not thought of making the NPCs intangible so that they aren’t impeded.
As it stands, I added some timer code that, after some delay, checks if the NPC has done what I told him to and, if he hasn’t, repeats the commands. It’s working now, but it isn’t very elegant. The ghost walker method sounds robust and should work well with adding-a-list-of-tasks-to-the-action-queue method of doing things. I will have to see if the intangibility looks too odd for some cases.