Jump to content
uncookedzebra

How to edit CfgRespawnInventory outside description.ext

Recommended Posts

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 menu
icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa"; // Icon displayed next to the name

// Loadout definition, uses same entries as CfgVehicles classes

magazines[] = {
"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

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
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

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

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

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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×