• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Save load system by TriggerHapy bug

Level 11
Joined
Jul 17, 2013
Messages
544
Hi im using in my map system by triggerhappy Codeless Save and Load (Multiplayer) - v3.0.1 it works well so far but i have a rare bug. for 2 people so far wins got restarted for some reason. they didnt watch replay of game. at the end of game their wins got increased and saved into the file we have checked date modification of file it looked like it was saved sucesfully, but when they restarted warcraft 3 and played next game they started with 0 wins :( thats really weird i wonder if problem is global or local, before those 2 players were able to win games and save their score sucesfully. bug with their score being ereased hapenned so random. i wonder what can be reason of this i also forgot to mention that these 2 players werent in same game when it hapenned, i just generally mean its second time this bug happens to someone. im sendin photos of my code.
1680304928144.png
1680304958827.png
1680304982647.png


there is also code from players's file whose score got restarted i wish it was possible to analyze it

function PreloadFiles takes nothing returns nothing

call PreloadStart()
call Preload( "" )
call BlzSetAbilityTooltip(1097690227, "Save
Ze$Mb}Jbj>g^g", 1)
//" )
call Preload( "" )
endfunction
function a takes nothing returns nothing
//" )
call PreloadEnd( 0.0 )

endfunction
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,565
Please post your triggers using this, it's easier for you and easier for me to read/edit:
Anyway, I think your triggers are fine, I'm not sure if you deleted anything necessary to the system though. If it works most of the time then it's hard to say.

One possible solution would be to add some time between saving each player.
 
Last edited:
Level 11
Joined
Jul 17, 2013
Messages
544
Please post your triggers using this, it's easier for you and easier for me to read/edit:
Anyway, I think your triggers are fine, I'm not sure if you deleted anything necessary to the system though. If it works most of the time then it's hard to say.

One possible solution would be to add some time between saving each player.
What about trying to save but player left game / is comp / was open slot? can it cause bugs then
 
Level 11
Joined
Jul 17, 2013
Messages
544
The Player Slot Status and Controller Status conditions exist. Just check those conditions before attempting to save.
After getting months of experience i can say that player purple loses his score but that happens only when he plays as eomer if he plays as character boromir then its fine. I thought of installing some debugger to detect when its being ereased. Any idea what can be reason of this? if purple leaves before score gets saved then he does not lose his score.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,565
After getting months of experience i can say that player purple loses his score but that happens only when he plays as eomer if he plays as character boromir then its fine. I thought of installing some debugger to detect when its being ereased. Any idea what can be reason of this? if purple leaves before score gets saved then he does not lose his score.
I believe it's either:
1) You have a trigger related to Eomer which messes things up.
2) Recent patches have created a bug that only happens when the stars align in a certain way.

I'd say it's #1, but I also know that I have had issues with this save/load system in the past and the recent patches most likely made things worse.

Edit: I rephrased my initial comment. It could also be a Player count issue, maybe you're just noticing an unrelated pattern with Eomer. I believe these systems can fail when there's too many Players saving/loading at once.
 
Last edited:
Level 11
Joined
Jul 17, 2013
Messages
544
It's either:
1) You have a trigger related to Eomer which messes things up.
2) Recent patches have created an extremely rare bug that only happens when the stars align in a certain way.

I'd say it's #1, but I also know that I've issues with this save/load system in the past and the recent patches have only made things worse.
i will install command that would help me to debug, no idea what could set integer variable to 0 if its map fault. i even removed varriable in editor and didnt save changes like that i could have seen all references to varriable
 
Level 11
Joined
Jul 17, 2013
Messages
544
The Player Slot Status and Controller Status conditions exist. Just check those conditions before attempting to save.
Hey i have next question, its not about bug anymore but other stuff i didnt create new thread cuz i hoped you would know answer.


my save and load triggers are posted at beginning of this thread. i need to add one more integer varriable that i will save and load. but the question is if i do it and release new version wont it ruin backwards compatiblity? cuz i have noticed that data is saved and loaded in specyfic order. what if someone will play new version for first time and his data will be saved in old order?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,565
As far as I understand, the new save data should always be added to the TOP of the save order list. This way it gets loaded LAST after all of the old data is loaded. For example.

--------------------------
Old map version:
Saves Gold
Saves Lumber

Loads Lumber
Loads Gold
--------------------------
New map version:
Saves Hero Level
Saves Gold
Saves Lumber

Loads Lumber
Loads Gold
Loads Hero Level
--------------------------

The new map version won't cause any problems when loading an old save file because it will have already loaded gold/lumber by the time it reaches Hero Level, and then when it does reach Hero Level it won't find any data for it. It will then return the default value of 0 for that Integer which you can do whatever you want with.

"Oh, this user loaded a Hero Level of 0, they must be using an old save file. I obviously shouldn't try to Set their Hero to level 0 so I just won't do anything at all."

Then when they finally save and overwrite their old file everything should get updated to the correct values.
 
Last edited:
Top