Jump to content
jakes

Eden - Retain custom spawn loadouts after respawn

Recommended Posts

This functionality is truly sorely needed to be part of the vanilla game to be quite honest - and its rather surprising that even after 3 of these games - they have not yet implimented that. Still up to the modders, and the script language boys to figure out.

BIS - come on, for real - give us this functionality as part of the standard game. It would help SOOOO much!

  • Like 1

Share this post


Link to post
Share on other sites

I know those other ways may work but this is simpler and it works with so little text editing.

This is in your description.ext file

respawnTemplates[] = {"MenuInventory","MenuPosition"};

 

This is in your initplayerlocal.sqf file

[player, [missionnamespace, "virtualinventory"]] call Bis_fnc_saveinventory;

 

This is in your onplayerrespawn.sqf

[player, [missionnamespace, "virtualinventory"]] call Bis_fnc_loadinventory;

 

You make sure you click save loadout in the multiplayer section of you missions attributes drop down while editing. Place soldiers on the battlefield, edit their loadout in arsenal, save it or not in arsenal, I save so they can be reused. Save the scenario after leaving arsenal and you are done creating loadouts. If you go back and change the loadout or make even more loadouts to choose from make sure you save. Those loadouts are now saved in the scenario as long as those files above are in your mission folder.

 

You don't even have to care what the soldier started out as when you placed them. After editing his loadout double click him and in the role portion of his attributes you can put a name or even a fairly long description of his loadout so people know what they are getting when they choose it in the lobby.

 

It will throw an error that is meaningless, I think it is because the menu inventory has no other inventories to choose from and the inventory shown is wrong. It doesn't matter you've named or described the the loadout in the role slot of his attributes.

 

I got most of this from one of SayUnkl's videos on youtube.

 

And now I link to my new problem. Vehicle respawn module problem

Share this post


Link to post
Share on other sites

FOR MORONS LIKE ME

Now I've done this which like always has much borrowed stuff in it from those who really know how to do this.

The first file below is your init.sqf file. You can add more than just west1, west2, resistance1 and resistance2 as you need. This is my test scenario so it only has 4. Always post 2 or more  loadouts or other stuff in examples so morons like me can see the structure better. Don't assume we are all gonna learn to write the stuff you do, or can learn to or have time to. I looked over several of the vehicle respawn scripts and I think, did that take a week to write or a month.

 

I always set all the other player respawn stuff in the editor, like delay. Someone told me that respawn on start was a good idea so I did it.

 

respawnOnStart = 1;

[west, "WEST1"] call BIS_fnc_addRespawnInventory;
[west, "WEST2"] call BIS_fnc_addRespawnInventory;
[resistance, "resistance1"] call BIS_fnc_addRespawnInventory;
[resistance, "resistance2"] call BIS_fnc_addRespawnInventory;

This is the one that really needs 2 or more examples, loadouts and stuff in the description.ext file. Those calls in the above init.sqf file will load these inventories. This is with WWII mods installed so you will have to change the weapons and mags. Use whatever you want for the display names. I figure you know how to export the loadout you make out of the arsenal but you cannot paste it in here, it won't work. You have to paste into a text file and then copy and paste individual pieces into this. It does not take as long as you think it might. What I've done is just a template for someone to use. I put this one in a spoiler, which I hope works, this forum has no preview.

 

Spoiler

respawnTemplateswest[] = {"MenuInventory","MenuPosition"};
respawnTemplatesresistance[] = {"MenuInventory","MenuPosition"};
class CfgRoles
{
class west1
{
displayName = "tanker";
};
class west2
{
displayName = "rifleman";
};
class resistance1
{
displayName = "rifleman";
};
class resistance2
{
displayName = "tanker";
};
};






class CfgRespawnInventory
{
class west1
{
displayName = "tanker"; // Name visible in the menu
role = "west1";
// Loadout definition, uses same entries as CfgVehicles classes
weapons[] = {
"LIB_M1908"
};
magazines[] = {
"LIB_8Rnd_9x19_P08",
"LIB_8Rnd_9x19_P08",
"LIB_8Rnd_9x19_P08",
"LIB_8Rnd_9x19_P08",
"LIB_8Rnd_9x19_P08",
"LIB_8Rnd_9x19_P08",
"LIB_8Rnd_9x19_P08",
"LIB_m39",
"fow_e_m24",
"fow_e_m24"
};
items[] = {
"FirstAidKit",
"FirstAidKit",
"toolkit"

};
linkedItems[] = {
"V_LIB_GER_TankPrivateBelt",
"H_LIB_GER_TankPrivateCap",
"ItemMap",
"ItemCompass",
"ItemWatch"
};
backpack = "B_LIB_GER_CowBackpack_04";
uniformClass = "U_LIB_GER_Tank_crew_private";
};



class west2
{
displayName = "rifleman"; // Name visible in the menu
role = "west2";
// Loadout definition, uses same entries as CfgVehicles classes
weapons[] = {
"LIB_G43"
};
magazines[] = {
"LIB_10Rnd_792x57",
"LIB_10Rnd_792x57",
"LIB_10Rnd_792x57",
"LIB_10Rnd_792x57",
"LIB_10Rnd_792x57",
"LIB_10Rnd_792x57",
"LIB_10Rnd_792x57",
"LIB_10Rnd_792x57",
"LIB_10Rnd_792x57",
"LIB_10Rnd_792x57",
"LIB_10Rnd_792x57",
"LIB_10Rnd_792x57",
"LIB_10Rnd_792x57",
"LIB_10Rnd_792x57",
"LIB_10Rnd_792x57",
"LIB_10Rnd_792x57",
"LIB_10Rnd_792x57",
"LIB_shg24",
"LIB_shg24",
"LIB_shg24"
};
items[] = {
"FirstAidKit",
"FirstAidKit"
};
linkedItems[] = {
"V_LIB_GER_VestG43",
"H_LIB_GER_Cap",
"ItemMap",
"ItemCompass",
"ItemWatch"
};
uniformClass = "U_LIB_GER_Oberschutze";
backpack = "B_LIB_GER_A_frame";
};


class resistance1
{
displayName = "rifleman"; // Name visible in the menu
role = "resistance1";
// Loadout definition, uses same entries as CfgVehicles classes
weapons[] = {
"fow_w_m1_garand",
"LIB_Binocular_SU"
};
magazines[] = {
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_US_Mk_2",
"LIB_US_Mk_2",
"LIB_US_Mk_2",
"LIB_US_Mk_2",
"LIB_US_Mk_2"
};
items[] = {
"FirstAidKit",
"FirstAidKit"
};
linkedItems[] = {
"fow_v_us_garand",
"fow_h_us_m1",
"ItemMap",
"ItemCompass",
"ItemWatch"
};
uniformClass = "U_LIB_CIV_Functionary_2";
backpack = "B_LIB_US_RocketBag_Vide";
};


class resistance2
{
displayName = "tanker"; // Name visible in the menu
role = "resistance2";
// Loadout definition, uses same entries as CfgVehicles classes
weapons[] = {
"LIB_Colt_M1911",
"LIB_Binocular_SU"
};
magazines[] = {
"LIB_7Rnd_45ACP",
"LIB_7Rnd_45ACP",
"LIB_7Rnd_45ACP",
"LIB_7Rnd_45ACP",
"LIB_7Rnd_45ACP",
"LIB_7Rnd_45ACP",
"LIB_7Rnd_45ACP",
"LIB_US_Mk_2",
"LIB_US_Mk_2",
"LIB_US_Mk_2"
};
items[] = {
"FirstAidKit",
"FirstAidKit"
};
linkedItems[] = {
"V_LIB_US_Vest_45",
"H_LIB_US_Helmet_Tank_AO",
"ItemMap",
"ItemCompass",
"ItemWatch"
};
uniformClass = "U_LIB_USA_NCO_Crew2ndADVbPbCptM1911";
backpack = "B_LIB_USA_Backpack_Vide";
};
};

 

Notice I used functionary clothes on one of them and loaded Japanese weapons, that for some reason he can't use, on another to make sure the game was loading the loadout out of the description.ext file and not using what I left in the editor.

 

Resistance is the side the US is on in the WWII mods, I don't know about the other mods. Anyway I kept getting errors because I tried independent and guerrilla, neither work in these 2 files for me. In other places independent works, independent is how it is listed in the editor but not in these files.

 

Share this post


Link to post
Share on other sites
On 2016. 8. 13. at 8:17 PM, farmboy102 said:

OK I think I'm too noob to understand this. 

 

I created both SQF files as explained with the code copied and pasted, but when I load in my mission I get a error BIS_fnc_loadInventory Inventory "inventory_var" Not Found. 

 

Any ideas? 

 

Does anyone have solution to this?

 

I also get this error box too! :(

 

But this was not done at a vanilla state, I was having 3den enhanced mode on :)

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

×