obrien979 4 Posted January 6, 2018 Is there a way to pull the display names (i.e. "M200 Intervention) for the different types of rifles (sniper, assault, HMG,LMG, etc...) from the configFile using a script or any other method? TIA Share this post Link to post Share on other sites
Tankbuster 1747 Posted January 6, 2018 This function will return the 'displayName' from the config. tky_fnc_getscreenname = { // with thanks to hoverguy and tryteyker private ["_suppliedtype","_type", "_cfg_type","_data", "_ret"]; params ["_suppliedtype"]; if ((typeName _suppliedtype) == "OBJECT") then { _type = (typeof _suppliedtype); } else { _type = _suppliedtype; }; //assume classname is provided. if object is provided, get its classname switch (true) do { case(isClass(configFile >> "CfgMagazines" >> _type)): {_cfg_type = "CfgMagazines"}; case(isClass(configFile >> "CfgWeapons" >> _type)): {_cfg_type = "CfgWeapons"}; case(isClass(configFile >> "CfgVehicles" >> _type)): {_cfg_type = "CfgVehicles"}; case(isClass(configFile >> "CfgGlasses" >> _type)): {_cfg_type = "CfgGlasses"}; }; _ret = getText (configFile >> _cfg_type >> _type >> "displayName"); _ret }; 1 Share this post Link to post Share on other sites
pierremgi 4906 Posted January 7, 2018 Or Bis function. 1 Share this post Link to post Share on other sites