Home   Help Search Login Register  

Author Topic: Refuel and Resupply the plane (SOLVED)  (Read 3671 times)

0 Members and 1 Guest are viewing this topic.

Offline X75TIGER75X

  • Members
  • *
Refuel and Resupply the plane (SOLVED)
« 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!
« Last Edit: 15 Nov 2008, 19:26:04 by X75TIGER75X »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Refuel and Resupply the plane
« Reply #1 on: 14 Nov 2008, 21:38:49 »
Create the trigger, group it with the aircraft and in the 'On Activation' field enter

Code: [Select]
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
« Last Edit: 14 Nov 2008, 21:48:17 by bedges »

Offline X75TIGER75X

  • Members
  • *
Re: Refuel and Resupply the plane
« Reply #2 on: 14 Nov 2008, 22:44:34 »
Nope, It didn't work, I'm using F18 Addon, I put 
Code: [Select]
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.
« Last Edit: 14 Nov 2008, 22:46:50 by bedges »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Refuel and Resupply the plane
« Reply #3 on: 14 Nov 2008, 22:49:27 »
Try adding a

Code: [Select]
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:

Offline X75TIGER75X

  • Members
  • *
Re: Refuel and Resupply the plane
« Reply #4 on: 14 Nov 2008, 23:31:21 »
I named the aircraft Vehicle, when I play the map, it tells me the code is missing ; and etc and lots of error.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Refuel and Resupply the plane
« Reply #5 on: 14 Nov 2008, 23:36:41 »
'vehicle' is a reserved term, use something like my_vehicle. The 'On Activation' code should be

Code: [Select]
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 ;

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Refuel and Resupply the plane
« Reply #6 on: 15 Nov 2008, 01:41:44 »
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:
Code: [Select]
{ if (_x isKindOf "Air") then { _x setFuel 1; _x setVehicleArmor 1; _x setVehicleAmmo 1; }; } forEach thisList;
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline X75TIGER75X

  • Members
  • *
Re: Refuel and Resupply the plane
« Reply #7 on: 15 Nov 2008, 19:20:50 »
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.
« Last Edit: 15 Nov 2008, 19:25:41 by X75TIGER75X »