TheVampire Posted April 19, 2018 Report Share Posted April 19, 2018 I began working on a server the past few weeks again and realised the other day that Epoch doesn't save Headgear and Goggles from being overwritten by the profile settings of the player. I understand when it is just cosmetic items, but my server has gasmasks that occupy the goggles slot. These gas masks are expensive and hard to find, so I need to correct this. Players who have balaclavas in their profile are also losing their saved headgear. Has anyone else already corrected this? Link to comment Share on other sites More sharing options...
Grahame Posted April 20, 2018 Report Share Posted April 20, 2018 This used to have to be changed in EPOCH_server_loadplayer.sqf: if (_x in["Binocular", "Rangefinder","Laserdesignator","Laserdesignator_02","Laserdesignator_03","Laserdesignator_01_khk_F","Laserdesignator_02_ghex_F","CUP_LRTV","CUP_Laserdesignator","CUP_SOFLAM"]) then { _newPlyr addWeapon _x; } else { _newPlyr linkItem _x; }; where you would add in the items that you needed. Assumed that that was not needed since the new schema and the move to setUnitLoadout()? I do have it still in my 1.1 code though... so? Around line 308 Link to comment Share on other sites More sharing options...
TheVampire Posted April 20, 2018 Author Report Share Posted April 20, 2018 Thanks for point to the script Grahame, but your code is currently outdated. That section is now in the Legacy area. Any new saves would be schema 1.0 and they skip that area. _newPlyr = _group createUnit[_class, _location, [], 0, "CAN_COLLIDE"]; if !(isNull _newPlyr) then { // disable AI on temp unit _newPlyr disableAI "ALL"; if (!_alreadyDead) then { // Medical _newPlyr setBleedingRemaining _bleedingRemaining; // _newPlyr setFatigue _fatigue; _newPlyr setOxygenRemaining _oxygenRemaining; _newPlyr setDamage _damage; } else { // player dead use default Data for appearance and loadout data _playerData = _defaultData; }; // disable further damage server side _newPlyr allowDamage false; _newPlyr setDir _dir; _newPlyr setPosATL _location; // set player loadout if (_schemaVersion >= 1.0) then { _playerData params ["","","_appearance","","","_loadout"]; // get current weapon to send to param for selectWeapon _currentWeapon = _appearance param [4,""]; // _newPlyr setUnitLoadout [_loadout, false]; // Workaround for Client / Server synchronizing issue in SetUnitLoadout [_newPlyr,_loadout] call Epoch_server_SetUnitLoadout; diag_log format["DEBUG: loaded player %1 with new schema Version %2", _newPlyr, _schemaVersion]; } else { Looking at the code, it doesn't seem to sanitize the player any. It likely should be wiping the character of any headgear and goggles that code with the default creation of the character. After creation of the character it is going to Epoch_server_SetUnitLoadout. It uses SetUnitLoadout (Command) but I'd wager a guess that the command doesn't overwrite existing items. EDIT: SetUnitLoadout Command in Editor does overwrite items, so that's not it. Link to comment Share on other sites More sharing options...
He-Man Posted April 20, 2018 Report Share Posted April 20, 2018 I have also noted this "bug". I am pretty sure, setunitloadout works correct, but the cosmetic items (glasses) are overwritten when switching into the Unit. But you could Test it by creating a unit, give him a loadout with these goggles and switch into it with selectplayer. Link to comment Share on other sites More sharing options...
Grahame Posted April 20, 2018 Report Share Posted April 20, 2018 Any relevance to this: https://forums.bohemia.net/forums/topic/197298-facewear-not-working/ Related to this: https://feedback.bistudio.com/T126866 He-Man 1 Link to comment Share on other sites More sharing options...
TheVampire Posted April 20, 2018 Author Report Share Posted April 20, 2018 It's related, but if I'm reading the code right the player spawns, and then epoch creates a new player model and transfers the player to it. It also shouldn't matter as SetUnitLoadout should be overwriting any default headgear from the profile. Link to comment Share on other sites More sharing options...
He-Man Posted April 20, 2018 Report Share Posted April 20, 2018 You are talking about goggles or headgear? Headgear should work fine, but not goggles... The Player connect as a "Ghost", then the Server create a new unit and set the loadout on this new unit. At least, the Server trigger it to the Client and the Client switch from the Ghost to the new Unit. I think this "switching" will overwrite the default goggles and take it from the Player profile. Here a small test: http://plays.tv/video/5ada1915ce596f5f3e/selectplayer-goggles Link to comment Share on other sites More sharing options...
He-Man Posted April 20, 2018 Report Share Posted April 20, 2018 Okay, here a small workaround. Please try it out and give me some feedback: https://www.dropbox.com/s/tsrwxqhwt1iqh18/player_login.fsm?dl=0 Link to comment Share on other sites More sharing options...
TheVampire Posted April 21, 2018 Author Report Share Posted April 21, 2018 Yes, I am talking about goggles, but there are also Balaclava's included in that (I believe). I'll test your fix as soon as I can (likely Sunday). Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now