Advanced NPC Target Priority

Need Help? The Day isnt going so well on the Mapping front?
Post Reply
shiftey
npc_combinegunship
npc_combinegunship
Posts: 705
Joined: Thu Oct 09, 2008 4:45 pm
Contact:

Advanced NPC Target Priority

Post by shiftey »

Image

Red are targets.
Yellow are the NPC spawn points.

The red dots (A) represent nearby enemies. Both B's and C represent buildings that may or may not have enemies in them.

Now what I'm trying to accomplish is this:
I want the npcs (yellow) to spawn and fight any nearby targets (A). If no nearby targets exist, I want them to move to the nearest B target if it is occupied. If the nearest B target is not occupied then I want the npc to move to the C target. If no A target, B target, or C target exists, then I want the NPC to disappear (since they are antlions, burrow)

I want to try to get them to attack the nearby targets (A) through some type of AI entity rather than using triggers. The B and C targets I believe will need triggers though.
KON_Air
prop_static
prop_static
Posts: 96
Joined: Thu Oct 16, 2008 10:41 am

Post by KON_Air »

How about making them patrol with node sets? Or just enemy finders...
shiftey
npc_combinegunship
npc_combinegunship
Posts: 705
Joined: Thu Oct 09, 2008 4:45 pm
Contact:

Post by shiftey »

I don't follow...Care to explain?
User avatar
Tysn
Former Developer
Former Developer
Posts: 358
Joined: Thu Oct 26, 2006 1:57 am
Location: Minnesota, USA
Contact:

Post by Tysn »

Not completely sure how well this would work, but you could try placing same squad npc_enemyfinders in all those areas, and then enable/disable them through I/O depending on if there are enemies there or not. Though if you want it to be more AI driven you could use ai_relationships to change the hostile priorities of the different enemies, rather than the usual 99 value. As far as having them burrow afterward, there might be some kind of output in the npc_antlions that is fired whenever no enemies are in sight or when they have lost sight of the enemy to have them burrow.

Either way, it's probably a good idea to try and stick to the AI-driven squad system as much as possible, as using thing like schedules tends to cause problems with npcs freezing up or not reacting dynamically to events.
Image
Post Reply