uncookedzebra 13 Posted January 22, 2016 Hey guys I am wondering on how you can edit pieces of the CfgRespawnInventory class outside the description.ext. This is what I have to start. class CfgRespawnInventory{class test{displayName = "Infantry"; // Name visible in the menuicon = "\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa"; // Icon displayed next to the name// Loadout definition, uses same entries as CfgVehicles classesmagazines[] = {"30Rnd_65x39_caseless_mag","30Rnd_65x39_caseless_mag","30Rnd_65x39_caseless_mag","30Rnd_65x39_caseless_mag","30Rnd_65x39_caseless_mag","30Rnd_65x39_caseless_mag","30Rnd_65x39_caseless_mag","30Rnd_65x39_caseless_mag","30Rnd_65x39_caseless_mag","30Rnd_65x39_caseless_mag","30Rnd_65x39_caseless_mag","30Rnd_65x39_caseless_mag","30Rnd_65x39_caseless_mag","30Rnd_65x39_caseless_mag","30Rnd_65x39_caseless_mag","30Rnd_65x39_caseless_mag","30Rnd_65x39_caseless_mag","30Rnd_65x39_caseless_mag","16Rnd_9x21_Mag","16Rnd_9x21_Mag","16Rnd_9x21_Mag","RPG32_F","MiniGrenade","MiniGrenade","MiniGrenade","MiniGrenade","Laserbatteries","SmokeShell","SmokeShell","SmokeShell","SmokeShell"};weapons[] = {"arifle_MXC_F","hgun_P07_F"}; items[] = {"FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit"};linkedItems[] = {"V_PlateCarrierSpec_rgr","H_HelmetB_light","optic_Hamr","acc_pointer_IR","ItemMap","ItemCompass","ItemWatch","ItemRadio","NVGoggles","ItemGPS"};uniformClass = "U_B_CombatUniform_mcam_tshirt";backpack = "B_Kitbag_rgr";}; }; I would think by having userweapon = "arifle_MXC_F"; in the description before the class CfgRespawnInventory and then editing weapons[] = {userweapon,"hgun_P07_F"}; or weapons[] = {"userweapon","hgun_P07_F"}; would have the same effect as the original but it doesn't seem to like that. Also if you guys would like to show me how to edit weapons[]=...... in script that would be amazing. Thanks ahead of time :) Share this post Link to post Share on other sites
uncookedzebra 13 Posted January 24, 2016 Gonna bump this. Share this post Link to post Share on other sites
dreadpirate 173 Posted January 24, 2016 Near the top of description.ext #define userweapon "arifle_MXC_F" In the CfgRespawnInventory section: weapons[] = {userweapon,"hgun_P07_F"}; Share this post Link to post Share on other sites
TedHo 53 Posted January 24, 2016 If your purpose is to make it easier to swap out the entry "arifle_MXC_F", You could use a macro. On the top of description.ext (when the file processed, USERWEAPON is replaced with "arifle_MXC_F"): #define USERWEAPON "arifle_MXC_F" And then in your CfgRespawnTemplates: weapons[] = {USERWEAPON, "hgun_P07_F"}; Share this post Link to post Share on other sites
uncookedzebra 13 Posted January 24, 2016 Thank you. How would I edit "userweapon" in a script outside desciption.ext so that the CfgRespawnTemplates would be updated during mid game? Share this post Link to post Share on other sites
dreadpirate 173 Posted January 24, 2016 Thank you. How would I edit "userweapon" in a script outside desciption.ext so that the CfgRespawnTemplates would be updated during mid game? I could be wrong, but I think that description.ext is just a header file that passes variables to the mission, not a regular script file. So you would need to have all the possible loadouts in the description.ext and use BIS_fnc_addRespawnInventory and BIS_fnc_removeRespawnInventory to swap loadouts in and out. Share this post Link to post Share on other sites
TedHo 53 Posted January 27, 2016 Thank you. How would I edit "userweapon" in a script outside desciption.ext so that the CfgRespawnTemplates would be updated during mid game? It is not possible to edit contents within description.ext (or any other config file) on-the-fly via script. I would recommend checking out the two functions mentioned by dreadpirate as well. Share this post Link to post Share on other sites
uncookedzebra 13 Posted January 29, 2016 How I went around this is to create all the allowed load-out combinations I wanted. Although this was A LOT (14000+ lines of code) of work it was worth it. Now I have created a dialog that pops up asking which "Slot" you want to edit. It tests the kind of unit player is then made another dialog that gives the allowed weapons and optic for that particular "Unit" and "Side". Once selected it modifies the load-outs that a player can select in the Respawn template "MenuInventory". Thanks for helping me understand what routes I could take. As my game type is still in alpha I am not going release what i wrote this moment, but will later if requested. Share this post Link to post Share on other sites