Jump to content
  • 0

Sometimes character stops updating after skin change


f3cuk

Question

Since updating to 1051 several people have been complaining that sometimes their character seemed to go back in time after they had logged in. Untill today I couldn't pinpoint what was happening but now i think i found it. Sometimes when a player changes skin, his or her character stops updating from that point on. Resulting in progress loss when they logout and log back in, even simply going in and out the lobby will "reset" their character to the state they were in just before they changed clothes.

 

One user even reported that he died » ragequit » after logging back in a few hours later, was alive and had most of his gear back. He asked me if i did a rollback on the database, which we did not. It did not make sense to me but now i'm figuring he had probably just changed skins before and got reset to that.
 

Could anyone confirm this issue? Or did i mess it up all by myself :P

Link to comment
Share on other sites

Recommended Posts

  • 0

Ah okay. You should know that player_switchmodel.sqf is also run when you login (without the humanitymorph.sqf). This is why i had to put in _charidchanged stuff which you have taken out again.

Try something like this.

 

player_humanityMorph.sqf

 

  Reveal hidden contents

 

player_switchmodel.sqf

  Reveal hidden contents

 

That should work better.

Link to comment
Share on other sites

  • 0

I thought of that myself but I figured that charidchanged was the equivalent of Zupa's fix. That's what I get for assuming things before reassuring I guess. Anyway thanks for the fix, will give it a try right now.

 

Edit// Yup, seems to be doing the trick. Thanks!

Link to comment
Share on other sites

  • 0

I didnt mean any disrespect, could be an older version, but i had that issue with dzgm, which i quicly fixed.

 

It didnt made the whole array a null. But sometimes ( i dont knwo what triggered it), probably somebody changes clothes while being in a group. Then for example u had this 

 

["35","36",<null>]

 

The 201 call fails to execute that, so your character never updated it.

 

SOme modifications to the dzgm fixed that issue for me.

 

Maybe it's some other script interfering, but mainly that was the only script using the friendly array ( plotMagement uses a different array).

 

For example the following guy had the same problem:

 

http://epochmod.com/forum/index.php?/topic/16113-force-update-on-logout/?hl=%2Bdze_friendlysaving+%2Bfalse%3B#entry121723

 

Look at the friendly array in his 201 call.

Link to comment
Share on other sites

  • 0
  On 9/8/2014 at 2:48 PM, f3cuk said:

Yeah the current fix i posted is overly complicated, but there is no part you should leave out. I'll do a new - more simple - one tonight. It only involves changing 4 files (player_wearclothes.sqf, player_humanitymorph and player_switchmodel.sqf and server_playersync.sqf). I'll use the default 1051 files as a reference.

so in message #101 you mentioned you were gonna do a write up later tonight. that is still happening right?

still looking forward to a complete solution to this issue...

Link to comment
Share on other sites

  • 0
  On 9/8/2014 at 11:08 PM, f3cuk said:

Find

[_newUnit] joinSilent createGroup WEST;

Add below

_newUnit setVariable["CharacterID",_charID,true];

 

Just to clarify, you probably picked this up from my file. The original player_switchModel.sqf doesn't have that line:

[_newUnit] joinSilent createGroup WEST;

But it doesn't hurt to add either. I added it because my clothing script had the slight possibility of changing sides from BLUFOR to something else when changing skins.

 

 

For guys missing the joinSilent line you can just add the "_newUnit setVariable["CharacterID",_charID,true];" line under:

_newUnit setDir _dir;
Link to comment
Share on other sites

  • 0

Also another thing is that you put the _inTransit calls in player_wearClothes.sqf. This works fine for regular players and not very heavily modified Epoch but if you're an admin and don't actually use the clothing items to change skins but instead a menu of some sort then the _inTransit method won't work. That's because admin menus and scripts like that don't call out player_wearClothes to change skins. They go straight for the humanityMorph. The way you helped me with my files should work the best I think.

Link to comment
Share on other sites

  • 0
  On 9/8/2014 at 11:08 PM, f3cuk said:

Sorry mate, kinda got sidetracked tonight by a friend tonight. Really tired right now so I'll do a quick writeup which should fix the issues. (@ebaydayz: Like you i feel this is a workaround, but it is a decent working one and debugging the backpack drove me crazy).

<snip>

 

  On 9/9/2014 at 12:29 AM, Rocu said:

Just to clarify, you probably picked this up from my file. The original player_switchModel.sqf doesn't have that line:

<snip>

 

Thanks a lot guys! I will try this ASAP. Expect question bombardment if it doesn't work :D

Link to comment
Share on other sites

  • 0

@Rocu: Thanks for noticing :), updated my post.

 

  On 9/9/2014 at 7:14 AM, mgm said:

Thanks a lot guys! I will try this ASAP. Expect question bombardment if it doesn't work :D

 

Good luck, needless to say -> Test this on a dev server first :)

Link to comment
Share on other sites

  • 0

You will need to modify scripts.txt if you have this filter: 5 "call player_humanityMorph"

I haven't done so yet but just noticed while testing.

Also getting errors following your instructions.

11:27:27 Error in expression <_name) + " as no characterID");

};

if (_inTransit) exitWith {

diag_log ("NOTICE>

11:27:27 Error position: <_inTransit) exitWith {

diag_log ("NOTICE>

11:27:27 Error Undefined variable in expression: _intransit

11:27:27 File z\addons\dayz_server\compile\server_playerSync.sqf, line 39

11:27:29 Error in expression <_name) + " as no characterID");

};

Link to comment
Share on other sites

  • 0
  On 8/20/2014 at 6:24 PM, f3cuk said:

Okay i have asked our players and none have experienced issues the last couple of days. Although I'm still not confident if the changes really fix the issue, I'm pretty sure they won't do any harm either. If anyone wants to test here goes.

--

Files that are changed with this.

  • player_humanityMorph.sqf
  • player_switchModel.sqf
  • player_monitor.sqf (/dayz_code/system/player_monitor.sqf)
  • player_monitor.fsm (/dayz_code/system/player_monitor.fsm)
  • server_playerSync.sqf (/dayz_server/compile/server_playerSync.sqf)
  • compiles.sqf (/dayz_code/init/compiles.sqf)
  • init.sqf
1.) In your mission folder create a folder called "reset_fix" inside your custom folder.

 

2.) Copy over the following files into that folder (Skip if you already have these in your mission pbo)

  • player_monitor.sqf (/dayz_code/system/player_monitor.sqf)
  • player_monitor.fsm (/dayz_code/system/player_monitor.fsm)
  • compiles.sqf (/dayz_code/init/compiles.sqf)
3.) Open your init.sqf

 

Find

call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";
Replace

call compile preprocessFileLineNumbers "custom\reset_fix\compiles.sqf";
4.) Open compiles.sqf

 

Find

player_switchModel =        compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_switchModel.sqf";
 

Replace with

player_switchModel =        compile preprocessFileLineNumbers "custom\reset_fix\player_switchModel.sqf";
 

Find

player_humanityMorph =        compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_humanityMorph.sqf";
 

Replace with

player_humanityMorph =        compile preprocessFileLineNumbers "custom\reset_fix\player_humanityMorph.sqf";
 

Find

_model call player_switchModel;
 

Replace with

[_model] call player_switchModel;

5.) Open player_monitor.sqf

Find

_id = [] execFSM "\z\addons\dayz_code\system\player_monitor.fsm";
Replace with

_id = [] execFSM "custom\reset_fix\player_monitor.fsm";

6.) Open player_monitor.fsm

Find

"_model call player_switchModel;" \n
 

Replace with

"[_model] call player_switchModel;" \n
 

7.) Create a file called player_humanityMorph.sqf and place it in the reset_fix folder

 

Add this

  Reveal hidden contents

 

8.) Create a file called player_switchModel.sqf in your reset_fix folder

 

Add this

 

  Reveal hidden contents

 

9.) Open your /dayz_server/compile/server_playerSync.sqf

Replace with

 

  Reveal hidden contents

 

 

 

10.) Repack your mission and dayz_server pbo

 

 

 

I followed this and tested with a few characters on my test server and NO lose of location or lose of gear or roll back. Tested with one of my regular players also. Tested ai skins from the take cloths script.

 

I did receive a few of these:

 

17:52:17 "Player is Null FAILED: Exiting, player sync: <NULL-object>"
17:52:18 "NOTICE: Cannot update Detour, player is in transit"

 

Seems to have worked, at least in a test environment. Will put on my live later. 

 

Thanks for this. Has plagued my players for awhile!! 

Link to comment
Share on other sites

  • 0
  On 9/9/2014 at 2:55 PM, justchil said:

You will need to modify scripts.txt if you have this filter: 5 "call player_humanityMorph"

I haven't done so yet but just noticed while testing.

Also getting errors following your instructions.

11:27:27 Error in expression <_name) + " as no characterID");

};

if (_inTransit) exitWith {

diag_log ("NOTICE>

11:27:27 Error position: <_inTransit) exitWith {

diag_log ("NOTICE>

11:27:27 Error Undefined variable in expression: _intransit

11:27:27 File z\addons\dayz_server\compile\server_playerSync.sqf, line 39

11:27:29 Error in expression <_name) + " as no characterID");

};

 

  On 9/10/2014 at 4:56 AM, Anarior said:

Yeah I'm getting massive rpt spam with that too.

 

Ugh, sorry guys! Missed a step :(

 

In server_playerSync.sqf

Find

_humanity             = 0;

Add below

_inTransit             = _character getVariable ["inTransit",false];
Link to comment
Share on other sites

  • 0
  On 9/12/2014 at 12:52 PM, f3cuk said:

Hey guys, if any of you could confirm this as a working fix I'll update the OP and title.

 

 

Worked for me for a day or two until I changed the clothing thing completely so the inTransit wasn't needed anymore.

(Had some duping issues, simply forced players to re-log when changing clothes, temporary solution until I find a better one :/ )

Link to comment
Share on other sites

  • 0

It fixed the character not updating bug, but now getting lots of complaints of people just randomly losing their backpacks.

 

We are using Zupa's clothing script but I'm not sure if that conflicts with this fix. Either way there were no backpack issues before I added in

_inTransit             = _character getVariable ["inTransit",false];
Link to comment
Share on other sites

  • 0

A note:

 

in player sync you do

_inTransit             = _character getVariable ["inTransit",false];

now, as of experience i know IF this variable is not set, _InTransit is empy, and the default value FALSE is not passed in the variable.

 

I only see you setting this variable in humanitymorph. ( OR does this get called when you llogin, i dont know this by head ^^ ).

 

This will let the following if crashes your whole player_sync? ( i presume)

if (_inTransit) exitWith {
diag_log ("NOTICE: Cannot update " + (_name) + ", player is in transit");
};

i recommand the following

if ( !(isNil "_inTransit") && _inTransit) exitWith {
    diag_log ("NOTICE: Cannot update " + (_name) + ", player is in transit");
};
Link to comment
Share on other sites

  • 0

You sure about that Zupa? I've never seen it do anything else then set the variable to false. I think you might confuse it for "nil" which behaves in the way you explain?

--

@Anarior: Could you post the code of that script? It seems like something that might interfere.

Link to comment
Share on other sites

  • 0
  On 9/12/2014 at 3:45 PM, f3cuk said:

You sure about that Zupa? I've never seen it do anything else then set the variable to false. I think you might confuse it for "nil" which behaves in the way you explain?

--

@Anarior: Could you post the code of that script? It seems like something that might interfere.

 

It's this one here: 

 

I haven't had any issues with it, all has been running fine but when I added the new line to playersync, things started getting weird with backpacks.

Link to comment
Share on other sites

  • 0
21:21:05   Error position: <private ["_inTransit","_empty","_name",">
21:21:05   Error Local variable in global space
21:21:05 File z\addons\dayz_server\compile\server_playerSync.sqf, line 1
21:21:05 Error in expression <z_server\compile\server_playerSync.sqf"
 
 
Getting this spammed alot.. Whats messed up?
Link to comment
Share on other sites

  • 0
  On 9/13/2014 at 7:22 PM, Kimzer said:

 

21:21:05   Error position: <private ["_inTransit","_empty","_name",">
21:21:05   Error Local variable in global space
21:21:05 File z\addons\dayz_server\compile\server_playerSync.sqf, line 1
21:21:05 Error in expression <z_server\compile\server_playerSync.sqf"
 
 
Getting this spammed alot.. Whats messed up?

 

 

Remove the "_inTransit" from your private variable list?

So it's just like: private ["_empty","_name", etc...

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
×
×
  • Create New...