Home   Help Search Login Register  

Author Topic: Get to player's position  (Read 1105 times)

0 Members and 2 Guests are viewing this topic.

Offline HedgeHog

  • Members
  • *
Get to player's position
« 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

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Get to player's position
« Reply #1 on: 13 Oct 2008, 23:57:37 »
Then just use getPos vehicle player instead of getMarkerPos

Offline HedgeHog

  • Members
  • *
Re: Get to player's position
« Reply #2 on: 14 Oct 2008, 00:03:40 »
What's the right syntax?


This domove getpos vehicle or what? I keep getting error messages. :dunno:

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Get to player's position
« Reply #3 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;
};