Jump to content
Sign in to follow this  
Rh1985

Group chasing/hunting the player

Recommended Posts

Hello all, i've recently aquired Arma 2 and tried to make some levels for me and some friends. I've learned a lot on this and other forums but there are some things that i cant get to work right.

I'm making a simple level where the goal is to fight and run from various enemies. What i want for now is a working trigger that sends a group to the player position if i get that working i can experiment futher :)

This is the on act line from my trigger, for now it goes active when there are no blufor at the trigger (just so it always triggers)

_null = [] spawn { while {true} do { (leader Hunters) domove (getPos Player); sleep 5; }; };

The group hunters consists of an officer and 4 rifleman (that i've grouped with a blue line to the officer) The officer has in his init line Hunters = group this;

What does it do: Only the officer moves to the player npc and engages him in combat. his group mates just stand around in wedge formation. Can anyone tell me where i went wrong? I'm really on a basic level and i mostly use the forums / video tutorials to find the hard to do things like respawn scrips and paradrop scripts.

Share this post


Link to post
Share on other sites

Try using commandMove instead of doMove, or group Hunters instead of leader Hunters.

Share this post


Link to post
Share on other sites

Try it like this.....

_null = [] spawn { while {true} do {{_x doMove (getPos player)} foreach units Hunters; sleep 5; }; }; 

Share this post


Link to post
Share on other sites

The other thing you can do is spawn a group and then continually set it's waypoint on the players position:

_patrol = [getMarkerPos "patrolStart", EAST, ["RU_Soldier_AT", "RUS_Soldier_TL", "MVD_Soldier_GL", "RU_Soldier_MG", "RU_Soldier_AT"]] call BIS_fnc_spawnGroup;
_patrolwp1 = _patrol addWaypoint [position player, 0];
_patrolwp1 setWaypointType "MOVE";
_patrolwp1 setWaypointSpeed "FULL";
_patrol setCombatMode "RED";

while {true} do {
if (({alive _x} count units _patrol) == 0) exitWith {};
_patrolwp1 setWPPos getPos player;
};

Edited by PELHAM

Share this post


Link to post
Share on other sites

Tried this one:

_null = [] spawn { while {true} do {{_x doMove (getPos player)} foreach units Hunters; sleep 5; }; };

And it worked! thanks a lot =)

Also the spawned idea is great because i was toying around with spawning units and now i know how to make those hunt for my blood as well,!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×