Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
Jigsor

Trigger condition if ammo low

Recommended Posts

Does anybody have any idea what condition can be used if an AI aircraft is running low or out of ammo. I know this can be done for fuel. The sensor will be used to have an AI aircraft land at an airfield to rearm. The AI already announces when out of ammo. This should be a general condition and not specific to which type of ammo as varying aircraft types have many types of guns although the cannon is the main concern. Is this possible?

Share this post


Link to post
Share on other sites

You could try something like this..idk how it would work for vehicles. I'm sure someone will have a better solution though.

if (someAmmo unitName) then {hint format ["%1", someAmmo unitName]} else {hint format ["%1", someAmmo unitName]};

returns the amount of ammo...

Share this post


Link to post
Share on other sites

waitUntil {(_aircrft ammo "MaverickLauncher") == 0};

or

if ((_aircrft ammo "CMFlareLauncher") == 0) then {hint "no flares left"};

The command works for vehicles. However only for the vehicle's gunners' weapons - aka those returned by "weapons vehicle". So you may want to check that before stringing some conditions together with && or and

Edited by Mattar_Tharkari

Share this post


Link to post
Share on other sites

I can work with that. Thanks for the suggestions Iceman77 and Mattar_Tharkari

Share this post


Link to post
Share on other sites
Sign in to follow this  

×