Jump to content
Sign in to follow this  
reggaeman007jah

Trigger AA only when heli is over a certain height

Recommended Posts

Hi folks,

I am building up a few heli training missions, and I have been wondering if it is possible to trigger enemy AA only when your heli goes over a certain height (ie anything under 20m is literally under the radar).

Is this possible?

Thank you

RM

KITD FOHS

Share this post


Link to post
Share on other sites

Repeatable trigger:

Condition: (getpos heli select 2) < 20

onAct: heli setCaptive true

onDea: heli setCaptive false

  • Like 2

Share this post


Link to post
Share on other sites

awesome sounding trigger, however two questions, 1.  the height setting is it the current altitude of the heli, or is it referring to sea level height?  2.  Can i sync this trigger to certain units (aka missile based aa) so that the heli can still be targeted by small arms fire or gun based aa that wouldn't require a lock and therefor stealth wouldn't matter?

  • Like 1

Share this post


Link to post
Share on other sites
35 minutes ago, ironhawx said:

awesome sounding trigger, however two questions, 1.  the height setting is it the current altitude of the heli, or is it referring to sea level height?  2.  Can i sync this trigger to certain units (aka missile based aa) so that the heli can still be targeted by small arms fire or gun based aa that wouldn't require a lock and therefor stealth wouldn't matter?

  1. The height is above terrain, use getPosASL for above sea
  2. No, but it's possible to do it:

on act (reverse for deact):

{_x disableAI "ALL"} forEach [AA1, AA2,...];

//or another option

{_x setVehicleAmmo 0} forEach [AA1, AA2,...];

 

Share this post


Link to post
Share on other sites

Ok so i'd put the 

{_x disableAI "ALL"} forEach [AA1, AA2,...];

into the act, and "AA1" etc is what ever i name the enemy units, and for deactive i'd use same code except for disableAI i would use enableAI?

Share this post


Link to post
Share on other sites
2 minutes ago, ironhawx said:

Ok so i'd put the 


{_x disableAI "ALL"} forEach [AA1, AA2,...];

into the act, and "AA1" etc is what ever i name the enemy units, and for deactive i'd use same code except for disableAI i would use enableAI?

Yes. Now that I'm thinking about it, just use both to be sure.

{
	_x disableAI "ALL";
	_x setVehicleAmmo 0;
} forEach [AA1, AA2,...];

//-----------------------------

{
	_x enableAI "ALL";
	_x setVehicleAmmo 1;
} forEach [AA1, AA2,...];

 

Share this post


Link to post
Share on other sites

ok well i used jus the first one, disable/enable and worked like a charm you sir deserve a beer, this will really help mission i'm working on.

Share this post


Link to post
Share on other sites

ok so i understand scripting to the extent of I can read it and somewhat understand what does what.  However I'm not good knowing how to phrase and/write things.  Was wondering if (if you'd be so kind) how I would code multiple variable that are to be "stealthed"  aka more than one helicpoter aka heli1, heli2, heli3, jet1, jet2, jet3, etc.  I tried to just repeat this " (getpos heli select 2) < 20 " in same trigger, but got an error.  Was wondering if could help me out one last time

Share this post


Link to post
Share on other sites
29 minutes ago, ironhawx said:

ok so i understand scripting to the extent of I can read it and somewhat understand what does what.  However I'm not good knowing how to phrase and/write things.  Was wondering if (if you'd be so kind) how I would code multiple variable that are to be "stealthed"  aka more than one helicpoter aka heli1, heli2, heli3, jet1, jet2, jet3, etc.  I tried to just repeat this " (getpos heli select 2) < 20 " in same trigger, but got an error.  Was wondering if could help me out one last time

That's getting too complicated for simple triggers. Also, you'd need to use the setCaptive solution in this case (so no small arms fire on the heli).

 

Trigger:

condition: true

onAct:

_nul = [heli1, heli2,...etc.] spawn {
  {
    while{sleep 1; alive _x} do {
    	if (getPos _x select 2 <= 20) then {_x setCaptive true} else {_x setCaptive false}
    }
  } forEach _this
};

 

  • Like 1

Share this post


Link to post
Share on other sites

ok thanks for that so for a few vics just have a cpl triggers one for each, otherwise we are stepping into a dedicated script scenario.  Ok thanks for all the help.

Share this post


Link to post
Share on other sites

So, is ASL now possible? Last time I checked, I thought it was not..?

 

If it is, I'd like to pick your awesome brain one last time, if I may.. Is it in any way possible to generate a HUD reading that shows the ASL value of the unit in question? In other words, is it possible to create a HUD number for 'above sea level'? That would be so damn awesome for formation flying..

 

Just a thought..

Share this post


Link to post
Share on other sites
4 minutes ago, reggaeman007jah said:

So, is ASL now possible? Last time I checked, I thought it was not..?

 

If it is, I'd like to pick your awesome brain one last time, if I may.. Is it in any way possible to generate a HUD reading that shows the ASL value of the unit in question? In other words, is it possible to create a HUD number for 'above sea level'? That would be so damn awesome for formation flying..

 

Just a thought..

as far as hud w/ asl kimi's hmd if not mistaken has that function in its hud

 

  • Like 1

Share this post


Link to post
Share on other sites
14 minutes ago, reggaeman007jah said:

So, is ASL now possible? Last time I checked, I thought it was not..?

 

If it is, I'd like to pick your awesome brain one last time, if I may.. Is it in any way possible to generate a HUD reading that shows the ASL value of the unit in question? In other words, is it possible to create a HUD number for 'above sea level'? That would be so damn awesome for formation flying..

 

Just a thought..

Of course it's possible but making it how it should be done (via dialogs) is something I didn't want to bother to learn. You could make it the easy, hacky way like this:

altASL = [] spawn {
  while {true} do {
  	hintSilent format ["Altitude ASL: %1", [getPosASL player select 2, 0] call BIS_fnc_cutDecimals];
  }
};

and use this to end it:

terminate altASL;
hintSilent "";

 

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  

×