[General] My very first load/save map

Level 10
Joined
Jun 13, 2010
Messages
398
Hello, so I have never done this before.

What tutorials do you advice me to use and what things do I need?

I see some tutorials tell me to download certain things and enable stuff I don't know what is and don't share instructions on how to do so (because it probably is a basic thing for people to know besides me 😁)

Would someone be kind to provide me like some sort of check list? Go here, read this tutorial, download this and enable that. 😅🙏

It would mean a lot!

I need a load/save system for Heroes, their items and stats.
 
Depends on your game version (1.29, 1.31, latest, etc) and whether you use GUI/Jass/Lua.

There's this save/load system for Jass + GUI users, which is almost guaranteed to be you if you're unsure:
And here's a link to a "barebones" version I made of the above system. Note that I can't promise that either of these still work:

This system in particular can only save Integers, and I think that's the case for basically every Jass save/load system. But an Integer can be used to represent anything you want, so you aren't all that limited if you're clever about it.

Now understand that these systems don't let you LITERALLY save a Hero. Instead, you save all of the details about that Hero, like their Unit-Type, their current Level, their current Experience, each Item-Type they have equipped, and so on. Then you rebuild that Hero upon Loading by creating a new Hero, creating and giving them copies of their old Items, and adding Exp / setting their Level.

For example, if you wanted to Save someone's Hero you would Save the [index] of a Unit-Type Array which points to the type of Hero they're using:
  • Set Variable HeroType[1] = Paladin
  • Set Variable HeroType[2] = Archmage
  • Set Variable HeroType[3] = Mountain King
So by Saving the number 2 you'd be Saving the fact that they're playing as the Archmage since that Hero is stored at index [2].

Also, note that you Save things in a precise order (1 = Hero, 2 = Level, 3 = Exp) and you Load things following that same order. This is how you can map your loaded Integers back to their associated Arrays. Although, in the case of TriggerHappy's system the Loading process is done in reverse order. It's a little confusing but you just have to think in reverse, Exp -> Level -> Hero.

I don't feel like going into much greater detail since I've posted this information in many other threads but that's the gist of it.
 
Last edited:
Depends on your game version (1.29, 1.31, latest, etc) and whether you use GUI/Jass/Lua.

There's this save/load system for Jass + GUI users, which is almost guaranteed to be you if you're unsure:
And here's a link to a "barebones" version I made of the above system. Note that I can't promise that either of these still work:

This system in particular can only save Integers, and I think that's the case for basically every Jass save/load system. But an Integer can be used to represent anything you want, so you aren't all that limited if you're clever about it.

Now understand that these systems don't let you LITERALLY save a Hero. Instead, you save all of the details about that Hero, like their Unit-Type, their current Level, their current Experience, each Item-Type they have equipped, and so on. Then you rebuild that Hero upon Loading by creating a new Hero, creating and giving them copies of their old Items, and adding Exp / setting their Level.

For example, if you wanted to Save someone's Hero you would Save the [index] of a Unit-Type Array which points to the type of Hero they're using:
  • Set Variable HeroType[1] = Paladin
  • Set Variable HeroType[2] = Archmage
  • Set Variable HeroType[3] = Mountain King
So by Saving the number 2 you'd be Saving the fact that they're playing as the Archmage since that Hero is stored at index [2].

Also, note that you Save things in a precise order (1 = Hero, 2 = Level, 3 = Exp) and you Load things following that same order. This is how you can map your loaded Integers back to their associated Arrays. Although, in the case of TriggerHappy's system the Loading process is done in reverse order. It's a little confusing but you just have to think in reverse, Exp -> Level -> Hero.

I don't feel like going into much greater detail since I've posted this information in many other threads but that's the gist of it.
Thanks Uncle you are always abig help!

I actually saw Codeless before posting here - I just understood I had to enable some stuff and install a third party thingy? Or?
 
I think on older versions of Wc3 you had to "Enable local game files", not sure how to do that, but if you're up to date then it's not a thing anymore. There's no 3rd party requirement.

A quick summary on how it works: The system creates a text file in your Documents/Warcraft3/CustomMapData folder. So first you provide a bunch of Integers that you want to Save (Hero, Items, etc), then the system encodes those values into a text file at runtime. This code takes up less space and is more difficult to tamper with. Then when Loading, the system reads the file, decodes the saved code, and gives you back your Integers. You then handle the logic of using those Integers to recreate your Hero, Items, etc.
 
Last edited:
I think on older versions of Wc3 you had to "Enable local game files", not sure how to do that, but if you're up to date then it's not a thing anymore. There's no 3rd party requirement.

How it works: The system creates a text file in your Documents/Warcraft3/CustomMapData folder. So first you provide a bunch of Integers that you want to Save (Hero, Items, etc), then the system encodes those values into a text file. This code takes up less space and is more difficult to tamper with. Then when Loading, the system reads the file, decodes the saved code, and gives you back your Integers. You then handle the logic of using those Integers to recreate your Hero, Items, etc.
Ah okay! Thats great! I am using reforged so I suppose those things are in the past. Thats perfect! I will test it. Thanks!
 
Back
Top