Frostello 0 Posted March 10, 2022 (edited) Hi all, I've been working on a mission description.ext file and I'm at the stage of using CfgRespawnInventory for player loadouts. Now I know in all likelihood it's an issue on my end, however, I've noticed that whatever I set as a loadout through CfgRespawnInventory, the loadout isn't being picked up by the relevant function. At first, I figured it was a formatting issue on my end, but even using the examples on the Description.ext and addRespawnInventory command pages doesn't work. Spoiler class CfgRespawnInventory { class bluCom { displayName = "Commanding Officer"; icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\major_gs.paa"; role = "Command"; weapons[] = { "arifle_MXC_F", "hgun_Pistol_heavy_01_F", "Rangefinder" }; 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_Tracer", "30Rnd_65x39_caseless_mag_Tracer", "30Rnd_65x39_caseless_mag_Tracer", "30Rnd_65x39_caseless_mag_Tracer", "30Rnd_65x39_caseless_mag_Tracer", "11Rnd_45ACP_Mag", "11Rnd_45ACP_Mag", "11Rnd_45ACP_Mag", "MiniGrenade", "MiniGrenade", "MiniGrenade", "SmokeShell", "SmokeShellPurple", "SmokeShellOrange" }; items[] = { "FirstAidKit" }; linkedItems[] = { "H_HelmetSpecB", "V_PlateCarrier1_rgr", "ItemGPS", "ItemMap", "ItemCompass", "ItemWatch", "ItemRadio" }; uniformClass = "U_B_CombatUniform_mcam_tshirt"; }; }; In this case, I had [west, "bluCom"] call BIS_fnc_addRespawnInventory in the mission Init.sqf to test if it worked. But like I said, this yielded no results. I kept receiving the same error, which was the function saying that bluCom wasn't in cfgRespawnInventories. "Does anyone have any suggestions for me? Sorry if this is a stupid question or anything, I just can't see where I've gone wrong, especially when not even the examples worked. Thanks for any help! Edited March 11, 2022 by Frostello Share this post Link to post Share on other sites
zikofrap 0 Posted March 24, 2022 Hello. I have a great inventory respawn system and it works great in MP.1. In the mission folder create a folder "mis_funcs"2. Create a file there "fn_preinit.sqf" and add this: Serp_unitprocessor = compileFinal preprocessFileLineNumbers "Equipment\unitprocessor.sqf"; 3. In the mission folder create a folder "Equipment"4. Create a file there "unitprocessor.sqf" and add this: _unit = _this select 0; _faction = _this select 1; _loadout = _this select 2; _item_processor = { removeAllItems _this; removeAllWeapons _this; removeAllItemsWithMagazines _this; removeAllAssignedItems _this; removeUniform _this; removeBackpack _this; removeGoggles _this; removeHeadgear _this; removeVest _this; }; _unit call _item_processor; _svn = format ["SerP_equipment_codes_%1_%2",_faction, _loadout]; if (isNil _svn) then { missionNamespace setVariable [_svn, compile preprocessFileLineNumbers format ["Equipment\%1\%2.sqf", _faction, _loadout]]; }; [_unit] call (missionNamespace getVariable [_svn, {}]); 5. In the "Equipment" folder create two folders, "opfor" and "blufor"6. Now, you can create a file, for example in the opfor folder, with the name "MyOpforUnit.sqf" and put there what you would like to see in the inventory. For example: comment "Add Items, map, compass, watch and walkie-talkie"; _unit linkItem "ItemMap"; _unit linkItem "ItemCompass"; _unit linkItem "ItemWatch"; _unit linkItem "ItemRadio"; comment "Adding a uniform"; _unit forceAddUniform "RM_SWAT_Uniform_02"; _unit addGoggles "G_RM_SWAT_Bandana"; _unit addHeadgear "RM_SWAT_Helmet_01"; _unit addVest "RM_SWAT_Vest_01"; comment "Adding Items to the Uniform"; _unit addItemToUniform "ACE_epinephrine"; _unit addItemToUniform "ACE_EarPlugs"; _unit addItemToUniform "ACE_tourniquet"; for "_i" from 1 to 2 do {_unit addItemToUniform "ACE_morphine"; }; for "_i" from 1 to 2 do {_unit addItemToUniform "ACE_fieldDressing"; }; _unit addItemToUniform "ACE_elasticBandage"; _unit addItemToUniform "ACE_quikclot"; _unit addItemToUniform "ACE_packingBandage"; comment "Adding items to the backpack"; for "_i" from 1 to 5 do {_unit addItemToVest "rhs_mag_30Rnd_556x45_M855A1_Stanag"; }; for "_i" from 1 to 3 do {_unit addItemToVest "rhsusf_mag_17Rnd_9x19_JHP"; }; for "_i" from 1 to 2 do {_unit addItemToVest "ACE_M84"; }; _unit addItemToVest "SmokeShell"; _unit addItemToVest "rhs_mag_m67"; _unit addItemToVest "rhsusf_acc_nt4_black"; comment "Adding the main weapon and accessories to it"; _unit addWeapon "rhs_weap_m4a1_carryhandle"; comment "Adding secondary weapons and accessories to it"; _unit addWeapon "rhsusf_weap_glock17g4"; _unit addHandgunItem "rhsusf_acc_omega9k"; Ready. In the init of the unit we write: call{if ( local this ) then { [this,"opfor","MyOpforUnit"] call SerP_unitprocessor; }; if ( isServer ) then { this addMPEventHandler ["MPRespawn", { params ["_unit", "_corpse"]; [_unit, "opfor", "MyOpforUnit"] call SerP_unitprocessor; }]; }; Share this post Link to post Share on other sites
zikofrap 0 Posted March 24, 2022 Oh. Forgot. You still need to include this function in description.ext Create in the mission folder "description.ext" and paste there: class CfgFunctions { class mis { class Main { file="mis_funcs"; class preinit { preInit=1; postInit=0; }; }; }; }; Share this post Link to post Share on other sites
Frostello 0 Posted March 25, 2022 Thanks for your help zikofrap, turns out it was a combination of formatting issues (with other loadouts) plus I realised that I didn't spell description properly in the filename. CfgRespawnInventories does work, I just can't spell. Share this post Link to post Share on other sites