• 🏆 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!

Looking to pay for some Lua codefix

Level 13
Joined
Jul 12, 2018
Messages
510
As far as i'm aware, WC3 still lacks a functioning Lua save system.

I asked Uncle to write me one and he did, based on an underlying File I/O type lua system written by Rhobox. It works beautifully in single player.

Here's a thread on it:

Later we discovered there are problems with the File I/O system Rhobox wrote, it causes desyncs in multiplayer. I'm not a coder but here is Uncle's explanation for it.


I know it's been a while, but there are some issues with the current implementation of the save/load system that cause desyncs. I don't think the solution is all that difficult but I'm failing miserably to get anything to work.

Using a Player object as an [index] in a table causes a desync. This is done throughout all of the code.

Iterating over pairs causes a desync. I was doing this myself in my own save/load code to get the different save file names from PlayerData.

If you could help with this that'd be amazing, thanks.

He is unfortunately awol and can't be recruited to rewrite it.

Looking to pay a couple hundred dollars (paypal) to anyone who's competent and willing to rewrite this save/load in a way that functions with multiplayer wc3. Please respond here or by PM.
 
As far as i'm aware, WC3 still lacks a functioning Lua save system.

I asked Uncle to write me one and he did, based on an underlying File I/O type lua system written by Rhobox. It works beautifully in single player.

Here's a thread on it:

Later we discovered there are problems with the File I/O system Rhobox wrote, it causes desyncs in multiplayer. I'm not a coder but here is Uncle's explanation for it.




He is unfortunately awol and can't be recruited to rewrite it.

Looking to pay a couple hundred dollars (paypal) to anyone who's competent and willing to rewrite this save/load in a way that functions with multiplayer wc3. Please respond here or by PM.
Without the fundamental knowledge of why things desync using lua, you will run into this problem again and again.

I have my own save/load system in Lua that I wouldn't mind sharing for free of course.

However it is not gui friendly and I don't have any desire (or time) to make it gui friendly. You can find me on the hive discord or pm me here if you are interested.
 
Level 13
Joined
Jul 12, 2018
Messages
510
Without the fundamental knowledge of why things desync using lua, you will run into this problem again and again.

I have my own save/load system in Lua that I wouldn't mind sharing for free of course.

However it is not gui friendly and I don't have any desire (or time) to make it gui friendly. You can find me on the hive discord or pm me here if you are interested.
Much appreciate the offer, i hope to take you up on it. Personally i just crawled up out of the mud and haven't learned to use fire yet let alone do any real coding, but i'll try to connect you with someone who can make productive use of your generosity.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
I recommend providing an easy to edit form of the "save/load" that needs fixing. This could be a simple map with the scripts in it and some minimal test functionality to verify it still works after changes. The linked topic has scripts all over the place and I think it has implicit dependencies that are not in that topic.

If all that needs to be fixed is what Uncle listed, it should not be too difficult for someone to fix it. The player values as keys can likely be solved by using the classic JASS approach of GetPlayerId(player) as keys. The pair iteration issue could probably be solved by moving to or implementing a list which has a well defined iteration order.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
Going to add that I attempted all of the easy fixes like replacing handles with integers (player -> player id), avoiding the use of os.time (used to display the date in the save file name), and changing all cases of pairs with ipairs. However, these fixes were done in my own code which uses the save/load system.

The actual save/load system was not written by me, but I did attempt to fix it as well. However, I wasn't too sure of myself, that's why it would be great to have the creator of said system step in and address it - or someone else that understands it. To clarify, the way we have everything setup is that hexbound stores all of his data in a GUI Hashtable. Upon running a GUI save event (player types -save), my Lua code runs which gets the data from the Hashtable and saves it. Then upon loading a save file (-load) I repopulate the GUI Hashtable using the loaded data.

Regarding potential desyncs, one thing that I learned recently was how many desyncs can occur when using frames - which are being used in my own code to give the save/load system a nice interface. Perhaps I am creating a desync with my use of frames. Control + F the word "desync" and jump through here: The Big UI-Frame Tutorial

I'm pretty sure I don't use GetLocalPlayer() in an unsafe manner but it's worth checking as well. Also, maybe I'm using bad practices in my Lua code just in general, it would be great to have someone with a deeper understanding go through it all. It sounds intimidating but it's really not that much code. The bulk of it is mainly the getting/setting of Hashtable values which can likely be ignored.
 
Last edited:
Top