Jump to content
hoizen

BIS_fnc_loadInventory and JIP

Recommended Posts

Hey all,

I have lost my marbles over this. I am currently using BIS_fnc_loadInventory in each unit's individual init field with the line:

[this,["missionconfigfile","BluGear","B_RS_TL"]] call BIS_fnc_loadInventory;

with a "riflesquad.cpp" file in my mission folder with class definitions such as this example of the B_RS_TL class:

      class B_RS_TL
       {
               Items[] = {"AGM_Bandage","AGM_Bandage","AGM_Bandage","AGM_Bandage","AGM_Bandage","AGM_Bandage","AGM_Bandage","AGM_Bandage",
                                       "AGM_Morphine","AGM_Morphine","AGM_EarBuds","RH_SFM952V"};
               linkedItems[] = {"US_2010_Multicam_PlateCarrier","US_2010_Multicam_ACHHelmet1",
                                               "ItemMap","ItemCompass","ItemWatch","NVGoggles","G_Combat","RH_peq2","tf_anprc152","RH_ta31rco_2d"};
               magazines[] = {
                       "30rnd_556x45_STANAG",
                       "30rnd_556x45_STANAG",
                       "30rnd_556x45_STANAG",
                       "30rnd_556x45_STANAG",
                       "30rnd_556x45_STANAG",
                       "30rnd_556x45_STANAG",
                       "30rnd_556x45_STANAG",
                       "30rnd_556x45_STANAG",
                       "30Rnd_556x45_Stanag_Tracer_Red",
                       "Chemlight_green",
                       "HandGrenade",
                       "HandGrenade",
                       "SmokeShell",
                       "SmokeShell",
                       "SmokeshellRed",
                       "SmokeShellOrange",
                       "Chemlight_green",

               };
               backpack = "US_2010_Multicam_Carryall";
               uniformClass = "US_2010_Multicam_FieldUniform2";
               weapons[] = {"RH_M4A1_ris","Binocular","Throw","Put"};
       };

When players slot up and load in, Everything is super dandy. Everyone's gears there and everyone's happy. Dance party.

Problem is: As soon as the server gets a JIP, everyone's gear gets wiped. Turns into pants off dance off and the only person with gear is the JIP. The Mission has a respawn_west marker with respawn = 3 for BASE respawn.

Respawners go to a spectator jail where they can action menu launch a spectator script so this custom gear loadout only needs to load when they first come in.

I would extremely appreciate any assistance anyone can offer to try to get this fixed. It is putting a huge limitation on my large scale missions without JIP and custom loadouts.

Share this post


Link to post
Share on other sites

Same problem here, but if 2 players join at the same time we are both in our underwear at start. It only works if 1 player joins at start and no JIP.

I'm also using BIS_fnc_initRespawn = {true}; in the init to prevent random spawn with random kit.:confused:

I've tested with the console in-game, 2 players connected to a dedicated server.

_cfgEcho4 = missionconfigfile >> "cfgrespawninventory" >> "ECHO4"; [this, _cfgEcho4] call bis_fnc_loadinventory;

Server button = nothing

Global button = you see the uniform load for a second and then back to underwear

Local button = the kit loads as expected

So it seems that the function has to be called locally. And I am not sure but the unit init must be firing the function globally/publically which must somehow affect the other kits and you can't put local variables in the unit init (example _cfg instead of cfg).

I tried running BIS_fnc_loadInventory in initPlayerLocal.sqf but no go.

when I put _cfg = missionconfigfile >> "cfgrespawninventory" >> "ECHO4"; [unitNameHere, _cfg] call bis_fnc_loadinventory; into the initServer for non-playable units, it works as intended.

EDIT: corrected error in code for initServer

Edited by sarlack

Share this post


Link to post
Share on other sites

how to use bis_fnc_loadinventory with array gotten from bis_fnc_saveinventory without links to namespaces?

Share this post


Link to post
Share on other sites

Use initplayerlocal.sqf In your missionfolder. Then the code Will only run on the player connecting and not all clients every time a jip joins

Thats how i fixed the problem in our milsim grp.

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

×