OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: CharlieReddog on 25 Jan 2009, 12:58:52
-
I'm trying to determine how many bombs an aircraft has left so that it's not left loitering in CAS mode if it's empty. The aircraft is an ACE Harrier, but it uses 6rnd_GBU12_AV8B magazines if that's any use.
If I try pln ammo "6rnd_GBU12_AV8B" it returns 0.
Any ideas?
-
well, ammo command should work: unit ammo "weaponclassname", is "6rnd_GBU12_AV8B" the correct weapon class name? If not sure, type hint format["%1", weapons this] in the init line of one of these harriers.
-
Try using the Ammo classname instead of the Magazine Classname
-
Should be unit ammo "magazineName"
At least according to the comref anyway. :P
Planck
-
EDIT: I've got it working!
1) If you place a playable harrier on the map you must use (vehicle player) to access the vehicle weapon array because for some reason the name is attached to the unit commander (i.e. the pilot in this case) and not to the vehicle
2) For vehicles you must use the Weapon classname and not the Magazine classname for ammo command
So let's say you named your harrier "plane", then this line returns the ammount of GBU left
_bombs = (vehicle plane) ammo "BombLauncher"
-
Strangely I changed the biki a couple of days ago.
Have to check, maybe the muzzlename doesn't apply to vehicle weapons.
EDIT: Mandoble was right it is the weaponName:
_bigBangs = _myPlane ammo "BombLauncher"
Muzzle names would only be relevant for weapons with added grenade launchers methinks.
All comrefs edited to suit.
Planck
-
Many thanks, that's working perfectly now. :clap: Just need to debug the rest of the CAS routine now :(