ALPHIVE 14 Posted October 26, 2019 Hi everybody, I placed some survivors independant and i want that some of them wear different uniform. Problem : at every respawn, they do not keep the uniforms i placed on them before through Eden Editor So how can i do to make them keep their uniform when respawn ? By advance, thank you guys 😉 Share this post Link to post Share on other sites
Robustcolor 31 Posted October 26, 2019 Hi, i use this to save loadout when a player is killed and respawning. OnPlayerKilled.sqf [player, [missionNamespace, "inventory_var"]] call BIS_fnc_saveInventory; And then OnPlayerRespawn.sqf [player, [missionNamespace, "inventory_var"]] call BIS_fnc_loadInventory; Share this post Link to post Share on other sites
ALPHIVE 14 Posted October 26, 2019 But with this command, if the person get a different weapon on the ground, and i respawn, i will keep this different weapon no ? I mean : if im a survivor, and i get AK, with your command, i will respawn with survivor stuff of with the AK too ? Share this post Link to post Share on other sites
Robustcolor 31 Posted October 26, 2019 12 minutes ago, ALPHIVE said: But with this command, if the person get a different weapon on the ground, and i respawn, i will keep this different weapon no ? I mean : if im a survivor, and i get AK, with your command, i will respawn with survivor stuff of with the AK too ? Yes correct, but you can put the first code in Initplayerlocal.sqf instead of OnPlayerKilled.sqf if you only want to save the loadout the player start with but then it wont save the new items picked up. Share this post Link to post Share on other sites
ALPHIVE 14 Posted October 26, 2019 Perfect Robust, i will try that 😉 So i use only this code (not the other one) : OnPlayerKilled.sqf [player, [missionNamespace, "inventory_var"]] call BIS_fnc_saveInventory; And i put in in Initplayerlocal.sqf If i only want to save the loadout the player start with but then it wont save the new items picked up Right ? 🙂 Share this post Link to post Share on other sites
Robustcolor 31 Posted October 26, 2019 Yes correct @ALPHIVE initPlayerLocal.sqf [player, [missionNamespace, "inventory_var"]] call BIS_fnc_saveInventory; OnPlayerRespawn.sqf [player, [missionNamespace, "inventory_var"]] call BIS_fnc_loadInventory; 2 Share this post Link to post Share on other sites
ALPHIVE 14 Posted October 27, 2019 This command doesnt work 😕 Share this post Link to post Share on other sites
Robustcolor 31 Posted October 27, 2019 6 hours ago, ALPHIVE said: This command doesnt work 😕 Yes it does. Make a sqf and name it InitPlayerLocal in your missionfolder. Put this code inside it [player, [missionNamespace, "inventory_var"]] call BIS_fnc_saveInventory; Then make one more sqf and name it OnPlayerRespawn and put this code inside it. [player, [missionNamespace, "inventory_var"]] call BIS_fnc_loadInventory; Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted October 27, 2019 On 10/26/2019 at 1:44 PM, ALPHIVE said: I placed some survivors independant and i want that some of them wear different uniform. On 10/26/2019 at 4:29 PM, Robustcolor said: Hi, i use this to save loadout when a player is killed and respawning. Hello there Guys ! Is this about players only or for ai as well ? It's possible to do this with many ways. Since you are saying about placing units in the editor , ( probably for both players and ai ) , then you can use this : place in the init of any unit : ex: 0 = [this] execVM "GF_Loadout.sqf"; and create an sqf: GF_Loadout.sqf _unit = _this select 0; _unit addEventHandler ["Killed", { params ["_unit", "_killer", "_instigator", "_useEffects"]; [_unit, [missionNamespace, "inventory_var"]] call BIS_fnc_saveInventory; }]; _unit addEventHandler ["Respawn", { params ["_unit", "_corpse"]; [_unit, [missionNamespace, "inventory_var"]] call BIS_fnc_loadInventory; }]; and this way it will keep the current loadout every time that the unit is killed. Share this post Link to post Share on other sites
ALPHIVE 14 Posted October 30, 2019 Hi Georges, but with this system, it keeps the initial stuff (at spawn) ? or it keeps the stuff aquired when the person is killed ? Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted October 30, 2019 On 10/27/2019 at 11:15 PM, GEORGE FLOROS GR said: [_unit, [missionNamespace, "inventory_var"]] call BIS_fnc_saveInventory; This way it will keep the current inventory when you are killed and also the loadout that you have placed in the editor , if this will not be changed. If you want to have a certain loadout , you can export the loadout and add this code in the : On 10/27/2019 at 11:15 PM, GEORGE FLOROS GR said: _unit addEventHandler ["Respawn", { Share this post Link to post Share on other sites