Jump to content

Help needed with NPC AI Packages


jcro25

Recommended Posts

I am currently having difficulties with getting an NPC to remain in the same place when engaging in combat. Currently I have an NPC that has a guard package in a watch tower, despite my efforts I am unable to make the NPC stay in the watch tower when he engages in combat which results in the idea of him being in the watchtower pretty pointless.



His AI package is as follows:



Package Type: Guard (remain near guard location ticked)


Guard Location: WatchTowerREF, Radius 0


Flags currently set: No Combat alert, Continue during combat, Friendly fire comments.



The NPC will remain in the watchtower until he engages in combat, once engaged he runs out of tower to the enemy


NPC's. My aim is to make the NPC remain in the watchtower at all times.



If anyone has a suggestion for my problem then please let me know, credit will be given on the PLR mod page.



Thanks in advance,



Jcro25 :nuke:


Link to comment
Share on other sites

Combat behavior has priority over any other AI behavior, regardless of which AI package/settings you use. This makes actors very difficult to control while in combat.


You can try NavMesh-ing the perimeter (where you want the NPC to remain) as an "island" - i.e. not connected to the cell's main NavMesh.

Link to comment
Share on other sites

 

Combat behavior has priority over any other AI behavior, regardless of which AI package/settings you use. This makes actors very difficult to control while in combat.
You can try NavMesh-ing the perimeter (where you want the NPC to remain) as an "island" - i.e. not connected to the cell's main NavMesh.

 

Won't the npc will just zone over the non nav-meshed area? I've never tested that with combat but I know that's the case when npc is following PC.

How does that sniper work in Fallout 3? He shoots at the PC from long range and never moves from one spot.

Link to comment
Share on other sites

I believe it is in the Combat style that controls how they engage a target as well as what weapon they have. A guard in a watchtower would be a sniper most likely so take a look at some of the combat styles. If the NPC is permanent in the tower and never leaves you can simply block it from leaving by making the door owned by the player faction or even not have a door to the tower at all. Either way should keep the NPC ontop of the tower.

Link to comment
Share on other sites

Building on Jet4571's suggestion, some col meshes or invisible walls (that are around rails or low walls, so that sniper & return fire isn't blocked) may help "pin in" the NPC and keeep him/her from leaping from the tower. I believe if you uncheck "no low level processing" s/he wont be popping through the ether with mini t-ports to avoid barriers. I'm not sure how taxing that will be on the system as far as cpu cycles, how many npcs you have etc.
Link to comment
Share on other sites

Thanks for the suggestions guys, I have tried everything and the NPC still runs out of the tower towards the enemy once engaged in combat, I would have like to use Danny159's suggestion but the fact that the NPC needs to be able to move out of the tower makes this impossible. I have changed the combat style and still no luck? any other suggestions, this problem has really got me stuck :down:

Link to comment
Share on other sites

Thanks for the suggestions guys, I have tried everything and the NPC still runs out of the tower towards the enemy once engaged in combat, I would have like to use Danny159's suggestion but the fact that the NPC needs to be able to move out of the tower makes this impossible. I have changed the combat style and still no luck? any other suggestions, this problem has really got me stuck :down:

Arkansas essentially fires through scripted actions most of the way through minefield, you can emulate that behavior. If worse comes to worse you can setRestrained on the NPC when the player begins to approach and continue to have him/her fire on teh player (useWeapon). If you can't use a trigger (too big of an area to cover) you can initiate the sniping via getDistance <= (but if you use getDistance you have to make sure the player is in the same cell, getInSameCell or you'll get a CTD). Make it a quest script and you can control the frequency it's executed to keep teh cpu cost down.

 

Jazzisparis posted a solid sniper script in the mod request section.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...