Jump to content
Sign in to follow this  
colosseum

Way to send enemy units to attack you when detected

Recommended Posts

All,

I'm working on a downed pilot game set on Lingor. I've got patrolling An-2s and UH-1Hs, and I want to create a trigger so that a squad of motorized infantry in Land Rovers are sent to attack the player at their current location when the OPFOR aircraft detect them. Is this as simple as giving the OPFOR ground team a Seek and destroy waypoint that gets activated by a BLUFOR detected by OPFOR trigger or is there more to it?

Thanks very much,

Ian

Share this post


Link to post
Share on other sites

You could give the enemy a Hold waypoint synced to a blufor detected trigger. Make sure you set the trigger to "Switch". This will then release them from the Hold and send them to their next waypoint aka..Seek/Destroy; Move etc...

Share this post


Link to post
Share on other sites

On this subject does anyone know what scripting is needed to create a new waypoint at the groups current position? Thanks

Share this post


Link to post
Share on other sites

Like this mate..... with addWaypoint

_wp = _squad addWaypoint [getpos (leader squad), 0];

[_squad, 1] setWaypointCompletionRadius 10;
[_squad, 1] setWaypointType "MOVE";
[_squad, 1] setWaypointBehaviour "AWARE";
[_squad, 1] setWaypointCombatMode "RED";
[_squad, 1] setWaypointSpeed "FULL";
[_squad, 1] setWaypointFormation "LINE";
[_squad, 1] setWaypointTimeOut [30,120,60];
[_squad, 1] setWaypointStatements ["true", ""];

This would be a good place to bookmark... The Scripting Commands.

http://community.bistudio.com/wiki/Category:Scripting_Commands

Share this post


Link to post
Share on other sites

My problem is that the player could be in any number of areas, and the enemy ground team needs to be sent to the area where they are detected.

ArmA2 doesn't seem to have an editor dynamic for "Ground team, this is Air Team, enemy spotted at grid 052101", with the ground team then heading there to attack.

Any ideas?

Share this post


Link to post
Share on other sites

No... you have to create something like that yourself with one of the various methods of outputting text to the screen. There was a thread on hints recently.

You have to give the enemy ground team a name.... lets say... enemy_grp1

You can do this by adding this code to the Init of the leader of the enemy group:-

enemy_grp1 = group this;

In the trigger that detects your player... you add something like this to the OnAct:-

wp = enemy_grp1 addWaypoint [getpos player, 0];

Not too sure about the addWaypoint bit. Whether the waypoint will kick in.... that depends on if they have other waypoints to complete first. But give it a try. It's heading you in the right direction anyway :)

Edited by twirly

Share this post


Link to post
Share on other sites

Thanks guys. I will try both.

Is there a script like removeWaypoint? I figure if I make the BLUFOR detected by OPFOR trigger set to activate repeatedly, the script will need to remove all of the ground team's previous waypoints and then give them the new waypoint at the player's position.

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  

×