Jump to content
gc8

BIS_fnc_saveInventory buggy?

Recommended Posts

Hi

I'm trying to save players inventory using BIS_fnc_saveInventory but for some reason BIS_fnc_saveInventory doesn't store the correct weapon name (primary weapon at least)

Instead it saves the base class of the weapon.

 

For example I have this weapon: "srifle_DMR_02_sniper_AMS_LP_S_F" but the BIS_fnc_saveInventory  saves "srifle_DMR_02_sniper_F" as the weapon.

 

Code used to test:

 

  diag_log format["SAVED WEAPON: %1", primaryWeapon player];
 
 _sv = [ player, [ profileNamespace, "whatevernamehere"], [], false ] call BIS_fnc_saveInventory;
 
 diag_log format["SAVED: %1",_sv];

 

log output:

 

SAVED: [[""U_B_CombatUniform_mcam"",[""FirstAidKit"",""Chemlight_green"",""10Rnd_338_Mag""]],[""V_PlateCarrierGL_rgr"",[""16Rnd_9x21_Mag"",""16Rnd_9x21_Mag"",""1Rnd_HE_Grenade_shell"",""1Rnd_HE_Grenade_shell"",""1Rnd_HE_Grenade_shell"",""1Rnd_HE_Grenade_shell"",""1Rnd_HE_Grenade_shell"",""HandGrenade"",""HandGrenade"",""MiniGrenade"",""MiniGrenade"",""SmokeShell"",""SmokeShellGreen"",""Chemlight_green"",""1Rnd_Smoke_Grenade_shell"",""1Rnd_Smoke_Grenade_shell"",""1Rnd_SmokeBlue_Grenade_shell"",""1Rnd_SmokeGreen_Grenade_shell"",""1Rnd_SmokeOrange_Grenade_shell"",""10Rnd_338_Mag"",""10Rnd_338_Mag"",""10Rnd_338_Mag""]],["""",[]],""H_HelmetSpecB_blk"","""","""",[""srifle_DMR_02_sniper_F"",["""","""","""",""""],""10Rnd_338_Mag""],["""",["""","""","""",""""],""""],[""hgun_P07_F"",["""","""","""",""""],""16Rnd_9x21_Mag""],[""ItemMap"",""ItemCompass"",""ItemWatch"",""ItemRadio"",""NVGoggles""],[]]"

 

So is the function buggy or am I doing / understanding something wrong?

 

thx!

Share this post


Link to post
Share on other sites
1 hour ago, gc8 said:

Hi

I'm trying to save players inventory using BIS_fnc_saveInventory but for some reason BIS_fnc_saveInventory doesn't store the correct weapon name (primary weapon at least)

Instead it saves the base class of the weapon.

 

For example I have this weapon: "srifle_DMR_02_sniper_AMS_LP_S_F" but the BIS_fnc_saveInventory  saves "srifle_DMR_02_sniper_F" as the weapon.

 

Code used to test:

 


  diag_log format["SAVED WEAPON: %1", primaryWeapon player];
 
 _sv = [ player, [ profileNamespace, "whatevernamehere"], [], false ] call BIS_fnc_saveInventory;
 
 diag_log format["SAVED: %1",_sv];

 

log output:

 


SAVED: [[""U_B_CombatUniform_mcam"",[""FirstAidKit"",""Chemlight_green"",""10Rnd_338_Mag""]],[""V_PlateCarrierGL_rgr"",[""16Rnd_9x21_Mag"",""16Rnd_9x21_Mag"",""1Rnd_HE_Grenade_shell"",""1Rnd_HE_Grenade_shell"",""1Rnd_HE_Grenade_shell"",""1Rnd_HE_Grenade_shell"",""1Rnd_HE_Grenade_shell"",""HandGrenade"",""HandGrenade"",""MiniGrenade"",""MiniGrenade"",""SmokeShell"",""SmokeShellGreen"",""Chemlight_green"",""1Rnd_Smoke_Grenade_shell"",""1Rnd_Smoke_Grenade_shell"",""1Rnd_SmokeBlue_Grenade_shell"",""1Rnd_SmokeGreen_Grenade_shell"",""1Rnd_SmokeOrange_Grenade_shell"",""10Rnd_338_Mag"",""10Rnd_338_Mag"",""10Rnd_338_Mag""]],["""",[]],""H_HelmetSpecB_blk"","""","""",[""srifle_DMR_02_sniper_F"",["""","""","""",""""],""10Rnd_338_Mag""],["""",["""","""","""",""""],""""],[""hgun_P07_F"",["""","""","""",""""],""16Rnd_9x21_Mag""],[""ItemMap"",""ItemCompass"",""ItemWatch"",""ItemRadio"",""NVGoggles""],[]]"

 

So is the function buggy or am I doing / understanding something wrong?

 

thx!

 

I stopped using that function when I learned about getUnitLoadout.

  • Like 1

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

×