According to the toolset documentation and things I've seen in scripts, It should be possible to have NPCs cross area transistions using just the stock walkwaypoin system from the standard AI scripts. Has anyone ever done this successfully? If so, what exactly is required?
Walkwaypoints and area transitions
Débuté par
M. Rieder
, déc. 17 2011 05:12
#1
Posté 17 décembre 2011 - 05:12
#2
Posté 17 décembre 2011 - 10:52
The cross-area thing is actually vestigial from NWN1, and doesn't really work in NWN2. I was able to kludge together something in Last of the Danaan, though. Basically, I fixed some things in the core walkwaypoints script, and then added these triggers, on top of the area transitions, that automatically jump flagged NPCs to the next area, where they resume walking their waypoints.
The way things work, when a creature is first spawned it compiles a list of it's waypoints, irrespective of what area they're in. When they walk waypoints, they move from one waypoint to next. If a waypoint is inaccessible, like if it's in a different area, the NPC freezes up and never moves again. The trick is to jump them to the next area and tell them to move on to another waypoint before that happens.
Patch 1.22, though, changed the way NPCs in areas without a PC behave, shutting off their AI altogether after a few rounds. Because of this, having NPCs moving about without a PC there to look at them is of limited utility. It's often best just to fake it, jumping the NPCs about so that they're in the right place when and if the PC shows up.
I worked everything out for the Mithral convoy in The Last of the Danaan, then realized that it took the convoy over 20 minutes to do a complete loop, and no player would want to sit and wait 20 minutes just for the sake of realism. So I added in another convoy that spontaneously spawned in whenever the PC was in the area, and used similar fake convoys for The Danaan Unvanquished.
The way things work, when a creature is first spawned it compiles a list of it's waypoints, irrespective of what area they're in. When they walk waypoints, they move from one waypoint to next. If a waypoint is inaccessible, like if it's in a different area, the NPC freezes up and never moves again. The trick is to jump them to the next area and tell them to move on to another waypoint before that happens.
Patch 1.22, though, changed the way NPCs in areas without a PC behave, shutting off their AI altogether after a few rounds. Because of this, having NPCs moving about without a PC there to look at them is of limited utility. It's often best just to fake it, jumping the NPCs about so that they're in the right place when and if the PC shows up.
I worked everything out for the Mithral convoy in The Last of the Danaan, then realized that it took the convoy over 20 minutes to do a complete loop, and no player would want to sit and wait 20 minutes just for the sake of realism. So I added in another convoy that spontaneously spawned in whenever the PC was in the area, and used similar fake convoys for The Danaan Unvanquished.
#3
Posté 18 décembre 2011 - 06:19
Thanks for the explaination, Lugaid, and I loved ambushing the mithral convoy over... and over... and over... tons of fun.
#4
Posté 18 décembre 2011 - 06:42
I had one npc inadvertantly go through a door transition just by assigning the command to use it to the npc. Also, as Lugaid mentioned, they have their AI set to VERY_LOW if there is no PC in the area (via heartbeat script I think). Forcing this to the LOW level of AI still
allows them to do basic things like walk way points.
allows them to do basic things like walk way points.





Retour en haut






