Furrez 10 Posted May 27, 2014 So I want an AI plane to land on northeast airfield in Chernarus (plane landAt 1) when ammo = 0 or its damaged or the fuel is < 0.2. There is trigger on the airfield that detects when the plane is present and it starts to rearm, repair and refuel. After the plane takes off again, I want him to keep doing the current waypoint and the next ones. So basically I need script that forces an AI plane to land on airfield when it runs out of ammo and after that go back to objectives. I tried some "if" sentences but I didn't know how to check the ammo/damage/fuel. Share this post Link to post Share on other sites
katipo66 94 Posted May 27, 2014 Hi, I was pondering the same thing the other day, I was thinking maybe simply placing support vehicles at the airport with support waypoints? I doubt it could be that simple but never got around to testing it, this is in Arma 3 but should be same principle.. Probably it would need a trigger with certain conditions? Just guessing. Share this post Link to post Share on other sites
eegore 11 Posted May 28, 2014 What is in your trigger that detects the plane and continually rearms/refuel/repairs it? Share this post Link to post Share on other sites
domcho 20 Posted May 28, 2014 Check if fuel is low: fuel (vehicleName) <= 0.4 Check damage: damage (vehicleName) >= 0.5 Share this post Link to post Share on other sites
Furrez 10 Posted May 28, 2014 (edited) What is in your trigger that detects the plane and continually rearms/refuel/repairs it? I am using this and I have activation BLUFOR, repeatedly and present. Now I only need the ammo check if it's possible and the waypoint script. vehicleMaintenance.sqf while {(true)} do { { if (not (_x isKindOf "Man") and (count crew _x != 0) and (speed _x < 60) and (speed _x > -1) and (getPos _x select 2 < 1)) then { _x setVehicleAmmo 1; while {(count crew _x != 0) and ((damage _x > 0) or (fuel _x < 0.99)) and (speed _x < 60) and (speed _x > -1) and (getPos _x select 2 < 1)} do { if (damage _x > 0) then { _x setDamage ((damage _x) - 1); }; if (fuel _x < 1) then { _x setFuel ((fuel _x) + 1); }; sleep 0.1; }; }; } forEach list _this; sleep 1; }; I modified it a little bit. Edited May 28, 2014 by Furrez Share this post Link to post Share on other sites
Furrez 10 Posted May 28, 2014 Okay, so I got it working by creating a trigger that is activated repeatedly when condition is: "((fuel (pln1) < 0.3) or (damage (pln1) > 0.4));", "pln1" being name of the plane and On Act. "pln1 landAt 1;". The plane was forced to land so it came back to waypoints automatically. However I don't know how to check the ammunition of the plane or is it possible? Share this post Link to post Share on other sites