I´m thinking about a way to determine the players distance to enemies in a loop in a certain zone.
When the player gets too close to an enemy and stays in that range for too long the enemy should be
alerted, verbally adress the player and open fire at the player. In the next version I want to have the enemy adress the player and give the player the options to show false papers or talk to the enemies. This should be working for all enemies in a zone (base)
How can I set something like this up ?
What I need is a script or trigger setup that constantly checks the distance of the player to the enemies in a certain radius around him.
I guess if I loopcheck the distance to all enemies within the base it would hit the performance. So best would be to have a radius around the player that "moves" with the player and lists the units within the radius. Now if those units are hostile, for example east-side a timer should be started, the unit should doWatch the player and if the player stays near the unit for a certain time, let´s say 5 seconds, the unit should doTarget the player and use a voicesample to tell the player to stop. If the player moves away from the enemy unit the enemy should open fire.
If the player gets too close to enemy, let´s say 1m, the enemy should immmedeately shout and open fire, disregarding the 5 seconds from above.
If the player leaves the "zone" within the 5 seconds the enemy unit should disengage and doTarget 0 and continue with it´s regular stuff.
Is someone willing to waste some minutes on a script for that purpose ?
It´s basically for a stealth mission within an enemy base where I want to use setcaptive on the player or use rating to make him appear friendly to enemies unless he gets too close , they smell the deal and take further actions.