• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Saving a Region with everything in it

Status
Not open for further replies.
Level 8
Joined
May 21, 2019
Messages
435
Saving it to game cache(I think) with a code that you can use to restore your base when you come back
That's not quite what a game cache is. Game caches are used for jumping across multiple maps in a campaign.
What you're looking for is a save system that generates a code for loading a set of variables. These can be exploited if the map isn't protected, and you don't encrypt the codes.

If you are willing to accept that people will abuse the system to load anything into their save, then it's rather easy to make, but otherwise, this is not something that you will easily undertake.
Making reliable and non-exploitable save systems is not an entry-level feat.

Personally, I don't like the idea of protecting maps, and I am a firm believer that anyone who cares enough, will exploit a system one way or another.

Even just setting up a bot to grind a save to a ridiculous level, is a method that's more or less impossible to protect against. So designing this system around an encryption that discourages the youngest players from cheating, should be about 98% effective, since most players capable of working out that encryption or reading the backend, will want to play the map for the experience anyway.
 
Last edited:
Level 8
Joined
May 21, 2019
Messages
435
So, In RPG maps, it's possible to add everything you like to your save code?
How can I set it?
There's no "setting" it.
It's an entirely made up concept.
Lets say that I wanna save a level 3 Mountain King with 20 strength, 11 agility, 9 intelligence, 6 items, and 500 hp (to account for health increasing tomes) and gold.
Then I'd need something that means mountain king... lets say "XYAF".
I'd need something for level 3... lets say "FF8N"
I'd need something for the amount of Str, Int, and Agi... lets say "HAWF", "YAZH", "AHED".
I'd need something for each existing item. Lets say I have items with IDs: "AWAF", "AWAF", "AWAF", "AWAF", "HHJF", and "NAM2". (That's 4 AWAF items in the first 4 slots, and 2 different items in other slots, AWAF could be Claw of Attack +15, for example)
Then I'd need one for HP... lets say "XD43" (4 digits is a max of 1679616 hp)
And one for gold... lets say "FAFG" (4 digits is a max of 1679616 gold)
You can easily make those last 2 five digits and get like 60 million combinations.

Then, combining these values... we get: XYAFFF8NHAWFYAZHAHEDAWAFAWAFAWAFAWAFHHJFNAM2XD43FAFG
Now, this code represents everything that I need to know, to recreate that character. Most young people aren't going to look twice at that code and think "If I put AWAF instead of HHJF and NAM2, I can get Claw of Attack +15 in all 6 slots!", they're just gonna look at that and assume it's too complicated for them to understand. Otherwise, you'd need to have separate codes for items appearing more than once. Also totally possible, but even more complicated.

Does this explain the general concept to you?
 
Level 8
Joined
May 21, 2019
Messages
435
So it's impossibe to save a region that can't changed?
Not sure what you mean by a region.
I'm guessing this relates to the Clash of Clans like map you are making in that other thread... so I guess you mean the base, as in all units in that base, and their positions?
Yeah, that's totally possible to save. What you'd need is a code containing all of your units and their location on the map in coordinates.
 
Level 8
Joined
May 21, 2019
Messages
435
If it's possible can you tell me how?
This would likely be a rather massive undertaking, it's not something that I can type out in a short trigger.
You'd need codes for each type of units, and a formula that encrypts coordinates into code. Then you'd need to string those together, and code an interpretor, that translates the code into data, and loops through it, generating the described structures.

For RPG maps, there's a bunch of different save systems, but almost all of those focus on heroes exclusively.
 
Level 8
Joined
Aug 13, 2018
Messages
338
This would likely be a rather massive undertaking, it's not something that I can type out in a short trigger.
You'd need codes for each type of units, and a formula that encrypts coordinates into code. Then you'd need to string those together, and code an interpretor, that translates the code into data, and loops through it, generating the described structures.

For RPG maps, there's a bunch of different save systems, but almost all of those focus on heroes exclusively.
You can't send me a short example?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,871
Codeless Save and Load (Multiplayer) - v3.0.0
I believe you can use this system by TriggerHappy.

And here's an edit of that Save/Load system. I added a way to store the saved unit's position in the "Save GUI" and "Load GUI" triggers. I'm not sure if I did it properly but it seems to work. This will hopefully give you a better idea of how to do this for yourself.
 

Attachments

  • Codeless Save Load v3.0.0 Uncle.w3x
    178.5 KB · Views: 30
Level 8
Joined
Aug 13, 2018
Messages
338
I believe you can use this system by TriggerHappy.

And here's an edit of that Save/Load system. I added a way to store the saved unit's position in the "Save GUI" and "Load GUI" triggers. I'm not sure if I did it properly but it seems to work.
Is there any way to transfer variables between games? This is just what I need.
And for your edit: Thanks but I want a system that save every building in a region with their and when you load them, just a copy of them appears
I really don't know anything from save/load systems if you can edit it to what I told, it will be great
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,871
You're going to need to learn how to do it yourself or you'll be stuck here asking questions for eternity. The system has instructions and it's done in GUI. It looks intimidating at first but once you learn how it works then you can easily take advantage of it. Here's an example that is used in the System. It stores the Unspent Skill Points of a Hero so that they can be loaded in the future. You can find these actions in the "Save GUI" and "Load GUI" triggers:

  • Save Actions
    • Events
    • Conditions
    • Actions
      • Note that SaveTempUnit = The Hero you want to save
      • -------- ------------------- --------
      • -------- Save Skill Points --------
      • -------- ------------------- --------
      • Set SaveCount = (SaveCount + 1)
      • Set SaveValue[SaveCount] = (Unspent skill points of SaveTempUnit)
      • Set SaveMaxValue[SaveCount] = 999
  • Load Actions
    • Events
    • Conditions
    • Actions
      • Note that SaveTempUnit = The Hero you want to save
      • -------- ------------------- --------
      • -------- Load Skill Points --------
      • -------- ------------------- --------
      • Set SaveCount = (SaveCount + 1)
      • Set SaveMaxValue[SaveCount] = 999
      • Custom script: call SaveHelper.GUILoadNext()
      • Hero - Modify unspent skill points of SaveTempUnit: Set to 0 points
      • Hero - Modify unspent skill points of SaveTempUnit: Set to (SaveValue[SaveCount] - (Unspent skill points of SaveTempUnit)) points
So you store the Unspent Skill points of your Hero as SaveValue[SaveCount] (after increasing SaveCount by 1). Then when you load the Hero, you load this information by referencing SaveValue[SaveCount] again.

There's obviously more to it than that but hopefully you get the idea. I recommend creating an Integer variable and setting it to an arbitrary number like 15 for example. Then try to save and load it and display this number using Text Messages to see if it was Saved/Loaded properly between different games. Once you've got that figured out the rest should start to make sense.
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,871
Try out the map I attached below. It's a basic example of what you're trying to do and should get you started in the right direction. The main triggers that you need to worry about are in the "Uncle Save and Load Triggers" folder.

To test it out, build some Scout Towers/Farms with the Peasant and type -save. Then type -load to load your most recent save.

EDIT: Uploaded Save and Load v.3. It's now codeless. Simply type -load to load your most recent save. There's still an issue that prevents you from saving more than ~40 buildings at a time. I have no idea why this happens.

EDIT 2: Uploaded v.5. I tried to reduce the number of variables that I was saving. Didn't really make a difference. The Unit-Types still randomly get mixed up after saving/loading a few times (I had this same problem in v.3). However, I noticed that the mix ups NEVER happen the first time I save/load so that's something. Also, the Unit limit is still there.

EDIT 3: Re-uploaded v.5/v.3. Fixed the unit-type mix up. The last issue left is the unit limit. I get an error saying Invalid character code when I try to load a save that has more than ~108 units (number might be less in v.3). The SaveMaxValue is 256 so that's not the issue.
 
Last edited:
Try out the map I attached below. It's a basic example of what you're trying to do and should get you started in the right direction. The main triggers that you need to worry about are in the "Uncle Save and Load Triggers" folder.

To test it out, build some Scout Towers/Farms with the Peasant and type -save. Then type -load to load your most recent save.

EDIT: Uploaded Save and Load v.3. It's now codeless. Simply type -load to load your most recent save, no code required. There's still an issue that prevents you from saving more than ~40 buildings at a time. I have no idea why this happens.

I presume it has something to do with either system limit or max save setting. Perhaps @TriggerHappy can give some insight.
 
Level 8
Joined
Aug 13, 2018
Messages
338
Try out the map I attached below. It's a basic example of what you're trying to do and should get you started in the right direction. The main triggers that you need to worry about are in the "Uncle Save and Load Triggers" folder.

To test it out, build some Scout Towers/Farms with the Peasant and type -save. Then type -load to load your most recent save.

EDIT: Uploaded Save and Load v.3. It's now codeless. Simply type -load to load your most recent save. There's still an issue that prevents you from saving more than ~40 buildings at a time. I have no idea why this happens.

EDIT 2: Uploaded v.5. I tried to reduce the number of variables that I was saving. Didn't really make a difference. The Unit-Types still randomly get mixed up after saving/loading a few times (I had this same problem in v.3). However, I noticed that the mix ups NEVER happen the first time I save/load so that's something. Also, the Unit limit is still there.
It happens agian: I can't open your maps becuse of patches... :goblin_jawdrop:
If you tell me a little about custom scripts may be I can create system
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,871
I figured I'd finish what I started and i'm pretty happy with the results. When you do feel like patching you should give it a try, I think it does exactly what you wanted.

Unfortunately, the save system stops working around ~100 units saved (per player) but that's probably more than enough depending on how your map works. And it SHOULD be MUI, but I couldn't test it to find out.
 

Attachments

  • Save and Load v.8.w3x
    161 KB · Views: 34
Last edited:
Level 8
Joined
Aug 13, 2018
Messages
338
I can't open it correct?
But there is two ways to open it:
1.You can copy triggers to a map with base patch 1.24-1.28(when you edited "codeless save\load v1.39", there wasn't any problem for me to open it
2.You share triggers with me to create them myself
If you do any of this, you maked me happy a lot
 
Status
Not open for further replies.
Top