CptBBQ 10 Posted February 21, 2011 Hey fellas, I´m looking for a script that determines which type of magazine a given static weapon uses. I know it´s somewhere in Xeno´s vehicle repair script but I´ve got no idea how to rework it for my needs. Maybe someone here knows a quick way to do so. Thanks in advance! Cheers, CptBBQ Share this post Link to post Share on other sites
W0lle 1052 Posted February 21, 2011 Why you need a script for that is beyond me: In the initline of the weapon: hint format ["%1 \n\n %2",weapons this,magazines this] Or even easier: ArmA2 weapons @ BI Wiki Share this post Link to post Share on other sites
CptBBQ 10 Posted February 21, 2011 (edited) Uh sorry, I probably should´ve explained a bit more... I want to rearm any static weapon within a certain radius, so I need do determine what magazine the given weapon uses, even if the weapon is currently empty. I guess I´ll have to get the classname from the vehicle config but I dunno how... --------------------------- edit: got it working now. thank you W0lle. Edited February 21, 2011 by CptBBQ Share this post Link to post Share on other sites
Big Dawg KS 6 Posted February 22, 2011 _mags = getArray (configFile >> "CfgVehicles" >> typeOf _veh >> "magazines"); For vehicles with multiple turrets a more complicated algorithm is obviously needed. Share this post Link to post Share on other sites
CptBBQ 10 Posted February 23, 2011 I´m pretty shure I´ve tested that syntax. But on e.g. a tow launcher it only returned 'FakeWeapon' ... Share this post Link to post Share on other sites
das attorney 858 Posted February 23, 2011 _mags = getArray (configFile >> "CfgVehicles" >> typeOf _veh >> "magazines"); For vehicles with multiple turrets a more complicated algorithm is obviously needed. I've been looking into that too, with no success. The proper magazines are listed under a "class" derived from the main config. (my terminology isn't good) class Turrets: Turrets {class MainTurret: MainTurret { magazines[] = {"100Rnd_127x99_M2"}; }; How do I getArray for this config entry? Would it be something like this? _mags = getArray (configFile >> "CfgVehicles" >> typeOf _veh >> "class MainTurret" >> "magazines"); Sorry, am at work so I can't check. Share this post Link to post Share on other sites
das attorney 858 Posted February 23, 2011 On reflection, I think it's one of these two: _mags = getArray (configFile >> "CfgVehicles" >> typeOf _veh >> "MainTurret" >> "magazines"); or _mags = getArray (configFile >> "CfgVehicles" >> typeOf _veh >> "Turret" >> "magazines"); Untested. ;) Share this post Link to post Share on other sites
CptBBQ 10 Posted February 24, 2011 I took a look at the cfgVehicles.. according to the class structure given and the syntax you guys are using the right code should be: _mags = getArray (configFile >> "CfgVehicles" >> typeOf _veh >> "Turrets" >> "MainTurret" >> "magazines"); And guess what, it works! At least with a tow launcher, I haven´t tested any other statics or vehicles. Share this post Link to post Share on other sites
das attorney 858 Posted February 24, 2011 Cool - thanks for that. I didn't get time to check it last night so thanks for following it up. Will be useful for a good few things I'm working on. :) Share this post Link to post Share on other sites
CptBBQ 10 Posted February 24, 2011 You´re wellcome =) Though I´d expext some troubles with statics and vehicles with a differing class structure. Share this post Link to post Share on other sites