Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
izen

How to setup a simple AI squad that hunts players based on last known location

Recommended Posts

So I've made somewhat stealthy coop mission that stretches over whole stratis.

I've set up patrols etc. and a test run determined it was working fine.

 

Now I'd like to add a specific AI team (optimally with a vehicle) that is dedicated to hunt the players down.

I know the workings of scripting somehow, but I can't actually do it. I know zero terminology or syntax, so I will need a pretty precise answer please.

 

I'll try to put down precisely how I want it to work so it can be put into script.

 

If any Player engages in combat with any enemy AI (detected), the HUNTERSQUAD gets a Search and Destroy Waypoint generated within a 100x100m radius around the player position.

If a players gets detected afterwards, before the waypoint is reached, that waypoint should be deleted and a new one generated at the new position.

If the Huntersquad reaches that waypoint and doesn't find the players, it moves back to a "staging area"

 

So, I don't want the players to be constantly hunted /the AI to always know the players position.

Would this work with a large trigger spanning the entire AO, set on repeat and set on blufor detected by opfor that then triggers a setpos-getpos-thingy and creates the waypoint?

If I use a squad with a vehicle will the AI be smart enough to board that vehicle for longer journeys?

 

Thanks guys,

 

Prussian

Share this post


Link to post
Share on other sites

Place a friendly soldier on the map.  Make him "player"  and name hum  blue1.

 

Place an enemy on the map and name him  red1

 

Place a man on a runway in an out of the way place way over on the other side of the map so he will not interfere with the action.

 

Place a trigger in front of that man.  In the on activation in the trigger:  red1 move getPos player; red1 setCombatMode "RED"

 

The enemy  red1  will move to your position and kill you.  He will ALWAYS find you.

 

If you have 6 enemy they must be named red1  through red 6  and the above command must be repeated for each of the 6 enemy soldiers

 

Except of course that you will run away. Then he goes to your last position not your current position.

 

So, the man on the runway has to run through the trigger over and over again.  Give him waypoints so he does this.

 

Make the trigger repeatable

 

the man runs through the trigger, the trigger activates, he keeps running and the trigger deactivates;

the man runs through the trigger, the trigger activates, he keeps running and the trigger deactivates;

the man runs through the trigger, the trigger activates, he keeps running and the trigger deactivates;

etc etc etc

 

Place his waypoints just so and this will work just fine.

 

This also works with enemy vehicles and aircraft.  Do this with enemy choppers and its almost impossible to get away and hide.

 

Now to test your trigger.  You need the trigger to turn on and off.  This next instruction only applies to the testing phase of your project.

 

In the On act cell:            hint  "ON ON ON"

In the deactivation cell:   hint  "OFF OFF OFF"

 

 

Then you move his waypoints around  which means he runs into the trigger "ON ON ON"  runs out of the trigger   "OFF OFF OFF".   With these messages you can make adjustments to your waypoints till they are just perfect.

 

Have fun!

Share this post


Link to post
Share on other sites

×