OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: X75TIGER75X on 14 Nov 2008, 21:34:17
-
How can you make airplane refuel and rearms their spent ammonium when they enter a trigger?
I wanted to recreate Air Combat game named Ace Combat, if player runs out a ammonium, they fly back to south to rearm the weapons and back to the combat.
Thanks to anyone who replied!
-
Create the trigger, group it with the aircraft and in the 'On Activation' field enter
vehicle (thislist select 0) setfuel 1; vehicle (thislist select 0) addmagazine "whatever the name of the magazine is"
Untested, but should work fine. :good:
EDIT - tested in OFP and it works
-
Nope, It didn't work, I'm using F18 Addon, I put
vehicle (thislist select 0) setfuel 1; vehicle (thislist select 0) addmagazine "fz_f18_m61"
In trigger "On Activation" and grouped it with my F18, didnt rearm my gun.
-
Try adding a
hint format["%1", name (thislist select 0)]
to the 'On Activation' field, which will tell you the name of the unit. If it's not the player's name, then that's the problem.
And please don't quote the post you're replying to :good:
-
I named the aircraft Vehicle, when I play the map, it tells me the code is missing ; and etc and lots of error.
-
'vehicle' is a reserved term, use something like my_vehicle. The 'On Activation' code should be
vehicle (thislist select 0) setfuel 1; vehicle (thislist select 0) addmagazine "fz_f18_m61"; hint format["%1", name (thislist select 0)]
When you have multiple commands one after the other they need to be separated by a ;
-
You might consider using setVehicleArmor and setVehicleAmmo commands to repair and refit the planes, as well as ensuring that you only resupply aircraft, rather than any vehicle or man within the trigger:
{ if (_x isKindOf "Air") then { _x setFuel 1; _x setVehicleArmor 1; _x setVehicleAmmo 1; }; } forEach thisList;
-
Spooner's script worked =P Yay!
Thank you everyone =P
EDIT: Wait, I forgot something, I also need repair too
EDIT 2: Never mind I didnt read completely, it does repair too.