OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: HedgeHog on 13 Oct 2008, 23:41:26

Title: Get to player's position
Post by: HedgeHog on 13 Oct 2008, 23:41:26
If I want to make some units reach the player's position (wherever he is), which command should I use?


I want a chopper to pursue the player and to fire on him wherever he is, so that's more difficult to hide yourself because the enemy will chase you everywhere.

Basically, i need the same function used by the command domove getmarkerpos "pos", but with the player position instead of the markers.

I hope I managed to explain what I need.

Thank you in advance! :D
Title: Re: Get to player's position
Post by: Mandoble on 13 Oct 2008, 23:57:37
Then just use getPos vehicle player instead of getMarkerPos
Title: Re: Get to player's position
Post by: HedgeHog on 14 Oct 2008, 00:03:40
What's the right syntax?


This domove getpos vehicle or what? I keep getting error messages. :dunno:
Title: Re: Get to player's position
Post by: Mandoble on 14 Oct 2008, 00:22:05
Code: [Select]
// Pursue.sqf
// res = [my_heli]execVM "pursue.sqf";

_pursuer = _this select 0;

while {alive _pursuer} do
{
   _pursuer doMove (getPos vehicle player);
   if ((_pursuer distance (vehicle player)) < 1000) then
   {
      (group driver _pursuer) reveal (vehicle player);
   };
   Sleep 10;
};