So I have some facepaint added to as an integer to playerbase but for some reason extra integers are read when OnStoreLoad triggers, even if my mod is last. To fix this I added a string as follows:
override void OnStoreSave( ParamsWriteContext ctx ) { super.OnStoreSave( ctx ); // store facepaint if ( GetDayZGame().IsServer() && GetDayZGame().IsMultiplayer() ) { ctx.Write( "DUG" ); // bullshit but it works, what a fucking HACK ctx.Write( m_DUGFacePaint ); } } override bool OnStoreLoad( ParamsReadContext ctx, int version ) { if (!super.OnStoreLoad( ctx, version)) return false; if ( GetDayZGame().IsServer() && GetDayZGame().IsMultiplayer() ) { // read facepaint int facepaint = 0; string dugfp = ""; if (!ctx.Read(dugfp)) { return false; } if(!ctx.Read(facepaint)) { return false; } m_DUGFacePaint = facepaint; } return true; }
If I do not read a string I get a random integer, mostly 3 for female characters back? Adding the string DUG fixes the issue with existing characters before that facepaint integer was added. Something in the engine I guess stores an extra integer after everything else? usually 3. Sometimes it something else breaking whatever my integer was supposed to be and crashing people.