OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: myke13021 on 01 Apr 2008, 01:16:22
-
Probably something simple but with my very limited understanding of config files and how to use them (in scripting terms).
What i need is a way to get the magazine name from a known weapon.
So, in exemple i have weapon "BombLauncher" and what i need is a line that tells me (or the script) that the related magazine is the "6Rnd_GBU12_AV8B".
Thats all.
Why do i need this?
I write a Aircraft carrier simulation (sort of) which lets the missionmaker change the loadout of each plane. Right now it takes an array for each weapon which contains weapon classname and magazine classname. I would like to shorten it so only weapon classname has to be given to the script and the script itself loads the correct magazine.
I guess it's doable in one or two lines but i can't figure it out.
-
Nice easy one here, which gives an array of strings as the result, since a weapon may allow the use of multiple magazine types:
_usableMagazineClasses = getArray (configFile >> "cfgWeapons" >> "BombLauncher" >> "magazines");
-
Wow, quick answer. Thx Spooner. Maybe one day i'll see through this config stuff.