Jump to content
Sign in to follow this  
Bahger

Help requested with two mission editor events

Recommended Posts

[Apologies if you have read a similar post in the ArmA 2 Editor forum; I posted it there in error]

Building a single-player mission using the High Command module I cannot figure out how to:

- Get a helicopter that is under the player's control in High Command (and therefore has no pre-plotted waypoints) to RTB (i.e. leave the mission) when a mission trigger fires.

- Get enemy units to spawn in by the same trigger, or the trigger plus time delay, i.e. 30 sec after the chopper departs.

I'm sure this must be easy for many of you guys but I struggle with not having a coder's brain so the simpler you can make any explanation, the better for me. I would really appreciate your help, thank you.

Share this post


Link to post
Share on other sites

i was able to have a trigger have a helo under player high command 'rtb' on trigger activation using doMove... in the trigger On Act -

heli1 doMove [0,0,0];
// replace [0,0,0] with your destination (can be variable or array like above)
// heli1 doMove _pos;

as for enemies, you could use BIS_fnc_spawnGroup; BIS_fnc_spawnEnemy (find in Arma Functions Viewer under category 'spawning.' this function requires 2 positions - player or friendly units, and a reference object; enemy will spawn on far side of reference), or createGroup

if still failing, double check you have your trigger setup properly

Share this post


Link to post
Share on other sites

This is so helpful to me, dr, thanks a lot. With apologies for my non-coder's brain, q couple of quick follow-up questions:

- Can I use a marker name instead of those coordinates for the helicopter's RTB destination in the above script?

- As for the enemy spawn script, this works beautifully and does exactly what I want, all code in the trigger activation field with no need for a script document. Obviously you need all the right ArmA 3 class names, which I found here.

Edited by Bahger

Share this post


Link to post
Share on other sites
This is so helpful to me, dr, thanks a lot. With apologies for my non-coder's brain,

No apology needed, theres alot of info, and alot of it isn't clear or easy to find

Can I use a marker name instead of those coordinates for the helicopter's RTB destination in the above script?

yes, you'll need to use getMarkerPos. remember to put " " quotations around your marker name (marker names are handled as strings in -most- cases. more on markers: Command Group - Markers)

Share this post


Link to post
Share on other sites

Thanks for your patience. This is a large-ish mission that is testing my meager scripting abilities to the full.

I'm about to start testing what I want to to with this group of two attack helps. As we have discussed, I want them to RTB and I will use the method you suggest but can you think of a relatively easy way I could get a group with no WPs but under High Command to RTB by timer in this specific way: 15 minutes after the player first calls on them via HC to maneuver or perform a task?

Share this post


Link to post
Share on other sites

personally, i would just spawn a small timer when the player first calls, a timer that sleeps for 15 minutes and then issues the doMove command:

_nil = [_unit,_pos] spawn {sleep (15 * 60);_unit doMove _pos;};

Share this post


Link to post
Share on other sites

When the player first calls the helo, it's through the High Command module so my question is, how can I associate a trigger with this event?

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  

×