Save/Load Code

> it is the best protection for very small save load codes

A001-BC23-DEF4 doesn't make any more or less sense than 4FED-32CB-100A.
Is also isn't any safer. Or easier to guess.
 
I mean save load codes with only strings like aa ab ac ad ae af ag... zx zy zz.

Example your map is openable with jass shop pro, it will be easy to guess what type of hero you want, what items you want, and what level you want.

Code:
Setup
Events
Game - Time elasped 0.00 seconds of game-time

Conditions
None

Actions
Set ItemSetup[0] = no item
Set ItemSetup[1] = <whatever item1>
Set ItemSetup[2] = <whatever item2>
..
Set ItemCode[0] = ia
Set ItemCode[1] = ai
Set ItemCode[2] = kl
..
Set HeroSetup[1] = <whatever hero1>
Set HeroSetup[2] = <whatever hero2>
..
Set HeroCode[1] = a
Set HeroCode[2] = i

Code:
Save
Events
....

Conditions
....

Actions
....
....
<I wrote it on 2 min>
For Each Integer A from 1 to 2, Do Actions
       If (Hero type of (Hero[Player number of (Triggering player)]) Equal to HeroSetup[Integer A])
       Then Set ItCd[1] = (Integer A)
       Else //Do Nothing
For Each Integer A from 1 to 2, Do Actions
       For Each Integer B from 1 to 6, Do Actions
             If (Item type in slot (Integer B) of (Hero[Player number of (Triggering player)])) Equal to ItemSetup[Integer A])
             Then Set ItCd[Integer B] = (Integer A)
             Else //Do Nothing
Set SaveCode1 = (IC[ItCd[1]] + IC[ItCd[2]] + IC[ItCd[3]] + IC[ItCd[4]] + IC[ItCd[5]] + IC[ItCd[6]] + IC[ItCd[7]]
For Each (Integer A) from 0 to ((Length of SaveCode1) - 1), do (Actions)
       Set SaveCode2 = (SaveCode2 + (Substring(SaveCode1, ((Length of SaveCode1) - (Integer A)), (((Length of SaveCode1) - (Integer A))))))
Game - Display... Your loading code is : SaveCode2

:D Guess the code!

-load lkaiialkaiiai :nuts: :banghead:
 
I dont know why this has been a contest for you Chocobo. :) Writing more obscure code isnt going to stop someone from breaking the map encryption, then looking for what they want and getting it. There is only ONE way to protect the encryption, and that is you have to protect the code in the map itself from any access, and no one can do that with what WC3/Blizzard has given us. :banghead:

Just going step by step through with a pen and a paper anyone who knows what he is looking at will be able to break it. :eek:

The answer is Hero 2, Item1, No item, Item 2, Item 1, No item, Item 2, BTW. It took me about 3 mins to crack it. :cool:

And looking at the code, its much easier to crack yours than others I have seen. took three steps, flip the code around. Break it down into groups of the variable size, then convert to the right variables. And the worst thing about your code, you have to pre create massive arrays and its not scalable on the fly, so in order to change the number system, you would have to retype everything by hand. Thats not creating secure code, thats wasting time.
Lets say a map maker has 20 heroes, and 150 items. That means they have to enter by hand 170 entries X 2. And all the time, keeping track of the characters hoping they dont accidently enter the same character set twice, wouldnt that be a fun bug to chase, 170 entries for a wrong character.

If I wanted I could make the Code totally convoluted for encryption I could do this. :nuts: Check for player name, hash code it out. Compress it into the Checksum, then double encrypt the whole thing, insert a password that the player has to type in by hand, finally check for spoofing playernames. But what would that accomplish, it would cost me 3X more time. The player would hate typing in the password. And odds are they would type it into the playerchat anyways, screwing the whole concept. As long as we cant encrypt the information in the map with a true encryption, then there is no point. :mad: @ Blizzard
 
When i paste the triggers onto my map, the hero doesn't spawn? and when i do -save it's always like 3-AAAA-AAAA-AAAA-AAAA-AAAA-A :(
 
Sounds like your variables arent loading with the right player info. Your basically getting Encryption Set 3, and All 0s across the board. So its getting NULL set for everything.

Now, I bet when you create your hero your not setting that unit to a variable to track that hero. Check out the Random Trigger for info about creating the hero with the tracking element.
 
Eggz said:
When i paste the triggers onto my map, the hero doesn't spawn? and when i do -save it's always like 3-AAAA-AAAA-AAAA-AAAA-AAAA-A :(
I just love these kind of posts :D He tried so hardly to understand it poor him :( ( I' m just- sarcasm )
 
Well I did warn them the Tutorial was Intermediate level. This isnt stuff for unexperienced trigger makers to try and tackle. Caches are about the only thing I can think of harder to do than maybe the upper level JASS stuff.
 
Help!

Hello. I am relatively new to the mapping as well as the forum. I copied over your triggers and all of the variables, but everytime I choose a character and try to save it, I get the same problem as Eggz. For almost the whole thing i get A's.
EX(2-AAAA-AAAA-AAAA-AAAA-ACE2-AAAA-G) [not sure about the last character]

When I use your -random test code, it works and I get a hero. When I try to save, it also works and the characters are things other than A. Do you have any idea why this would be happening? I dont understand why it doesnt work if I dont random :(

In addition, where it says SaveLoadHeroesStored = Paladin etc, do i have to make more of those depending on how many heroes I have? Im going to post my map in case you are able to analyze the problem. Thanks for any help you can give me. ;)
 

Attachments

  • Fantastic 6 Fighers Beta.w3x
    171.5 KB · Views: 711
Effane can u plz alter the code a bit for me to save 250 items, up to 7000 lumber and also can u fix or explain how to fix the problem where when we save a non random hero it shows mostly A's? thx for the help and kickass save/load code.
 
Sorry for the few day responce. I dont work in the same town as my wife and son live in, I take off weekends for time with them and I dont touch the computer during that.

-------------------------------------------------------------

Okay, going to add this to the FAQs, but I will explain it here. Alot of people are stuck on this one thing, and I assumed it was obvious. When you get that many PMs, its definetly not obvious. :p

Code:
CreateSingleStuff
    Events
        Player - Player 1 (Red) types a chat message containing -Random as An exact match
        Player - Player 2 (Blue) types a chat message containing -Random as An exact match
        Player - Player 3 (Teal) types a chat message containing -Random as An exact match
        Player - Player 4 (Purple) types a chat message containing -Random as An exact match
    Conditions
    Actions
        Set SaveLoadHasLoaded[(Player number of (Triggering player))] = True
        Unit - Create 1 SaveLoadHeroesStored[(Random integer number between 1 and SaveLoadMaxHeroesStored)] for (Triggering player) at (Center of Regions[(Random integer number between 1 and 9)]) facing Default building facing degrees
        Set SaveLoadPlayerHeroSingle[(Player number of (Triggering player))] = (Last created unit)
        Hero - Set SaveLoadPlayerHeroSingle[(Player number of (Triggering player))] Hero-level to (Random integer number between 1 and 10), Hide level-up graphics
        Set IntegerC = (Random integer number between 2 and 6)
        For each (Integer A) from 1 to IntegerC, do (Actions)
            Loop - Actions
                Hero - Create SaveLoadItemsStored[(Random integer number between 1 and SaveLoadMaxItemsStored)] and give it to SaveLoadPlayerHeroSingle[(Player number of (Triggering player))]
        Player - Set (Triggering player) Current gold to (Random integer number between 100000 and 1000000)
        Player - Set (Triggering player) Current lumber to (Random integer number between 100000 and 1000000)

This is a code example from the Demo Map. Now, here is how the map "Remembers" which player has which hero. Tracking variables are very powerful and I recommend everyone use them. They also kill leaks. This following section is the heart of this problem.

Code:
Set SaveLoadHasLoaded[(Player number of (Triggering player))] = True
        Unit - Create 1 SaveLoadHeroesStored[(Random integer number between 1 and SaveLoadMaxHeroesStored)] for (Triggering player) at (Center of Regions[(Random integer number between 1 and 9)]) facing Default building facing degrees
        Set SaveLoadPlayerHeroSingle[(Player number of (Triggering player))] = (Last created unit)

Whats happening here is first it sets the SaveLoadHasLoaded, this is to stop people from loading over and over, that would be bad. Then you are creating a hero. That we all should have mastered by now, if your map starts with a hero on it, then instead assign all player heroes to a tempUnitGroup and then use pick all in group and perform multiple actions.

Now, each hero needs to be put into another variable to track them. This is a powerful and fast way to get them without any craziness later.

Notice the following.
Code:
        Set SaveLoadPlayerHeroSingle[(Player number of (Triggering player))] = (Last created unit)

This basically grabs the last created unit, the hero. And then finds out what hero it is and assigns that hero to a unit array with the index (spot its stored in) as the player number.

Then to retrieve that hero all you do is access the Array with the player number and viola, you got your hero without using pick/unitgroups and all the leaks/processor cycles.


So to wrap this up, make sure you assign any heroes created to the correct array slot, that shoudl fix most of your issues with the 3-AAAA... ... ...

-------------------------------------------------------------------

Now the issue with getting 3-AAAA-AAAA-AAAA-AAAA-AAAJ-AAAH-T or something like that. Its an easy answer and its not a terribly unsecure result.
The first set of 4 chars is the hero level and hero type. You will need to refer to above answer for that fix.


The 3 middle sets of 4 chars are the items slots. The above issue will cause this, or you probly dont have anything in them at the time of saving. Looking at your result I suspect its the first problem.

Now if its the empty item slot issue, then thats normal results. They are just encrypted versions of the number 0. Now this isnt a encryption security issue for the most part. Why? Because we dont really care if they can make 0s, they still will not know how to create items, and also they still have to get around the checksum. Both will be a total nightmare for the novice to crack from the outside.
 
It's cool Effane,i waited for this for weeks,look much better than elil save code,hope that it get with other official tutorials.
 
Last post was a month ago, I hope youll answer this.

You said (in page 2) that you created a 2 digit system to store up to 50 heroes.

now am I misunderstanding the system completely but doesnt 2 slots give you up to 1296 heroes?

does the same go for items?

and by the way, you should edit your FAQ, it took me a couple hours to implement your codes because I needed to edit all the 'auto created variables' to have the correct amount of array sizes. for example, I have 8 players so I needed to change a couple array sizes, and they all default to 1, so that confused me a little.

I got it to work eventually... and now im gonna try to set it up so it can store more info. can you add on a little tutorial on how to add and load more variables? (like for example, I set up an array with abilities same as items, and 2 of them get saved. how do I add on 2 more slots and load them?)

thanks. (+ rep for help of course)
 
1 digit: 36 possibilities
2 digits: 1296 possibilities
3 digits: 46556 possibilities
;) Access to the code and modify it directly.
 
I used a 2 digit system so people could have a default system capable of 50 heroes.

You kinda took this out of context. When ever creating anything its best to say to yourself. "What do I want this to be able to do?"

I decided when I first sat down for the Tutorial I wanted a code that would save 50 heroes, 100 levels, 6 items on the hero, Default Max Gold and Max Lumber, also creating a simple method to ensure the code is good with a checksum.

If you read Part 4, in the FAQ section, you will see the list of what it can really handle by default.

Q. How large of numbers can this thing handle? By Default? With simple Modifications?

A. 1295 Heroes, Levels, and Items. 1.6 mill gold and lumber. You can go as large as the integer system will allow though for the items. But I doubt you would go beyond 46655 for items, heroes, levels, and other small things, thats just 3 slots for each item. While gold and lumber I could see going till 5 or 6 slots in some maps. Thats easy for the code to handle by just changing Slots variables in the Initialization trigger.

Notice it even mentions where you can change the size of stuff stored!!!

[beginrant]

This is why I am frustrated with this topic. Alot of people send me messages without reading the entire article, or they are reading it once, then sending questions without reading it again for better comprehension. I spend plenty of time sending quotes, links and pointing out the obvious. I actually have a 1.01 version of the SaveLoad code BTW, but I know posting it (It has a ton of advanced and extra triggers and sample codes in it) will result in more obvious or grossly uneducated questions. One of the biggest pet peeves is people sending PMs when they dont even understand the basics of triggers and map making.

So please, in the future. Learn the basics of triggers first, read the article more than once for comprehension (If youre one of those people that cant read a computer screen slowly, print it out). Then if you cant find anything about what youre asking in the tutorial (Especially in the FAQ section) by all means send me a PM. You wouldnt want me to ask you a question because I didnt want to take the time to read all the info posted, would you?

[endrant]
 
***Attached is the SaveLoadCode.W3X map. You can copy anything you see in the map, but make sure to always give credit please.***[/QUOTE]

This prettymuch sums up the whole thing. Thanks for the trigger(s). :D
 
I was wondering if this save/load tutorial would end up working/save hero spellbooks. For example, in my map each hero has spellbooks. If I implement this, will the spellbooks be saved in the code?

I just wanted to ask before I set this whol thing up and then it ending up not working.

edit: I copied and pasted into my map from the demo map you provided. It works well after adding my heroes and items to the triggers. One thing, though. When I -save, then -load and it says something along the lines of "You can't load, but we can check your code to see if it works." and it always says Load Unsuccessful, even if I quit, restart, type in my code, and it works.

Also, I'm using an Equipment spellbook in which your items get equipped to so there's more room in the inventory for other stuff. Is there a way I could get that spellbook's info saved, too? Right now, the loading/saving screws up my equipment spellbook.
 
I just asked a question about it, but I realized I could figure it out from the tutorial map. I have to edit it because I can't delete it... I feel like such a douche...
 
Guys i have little error here...i save my char...it save it's awesome good work Effane...so let's go to problem...first i copy and paste everything with the variables(WE function you know :) ) and test the map i saved it and restart...i type load code but nothing...i told my self hmm...let's see the triggers...i saw the trigger that spawns the hero...i had change the region to existing one but...when i load it up...my hero didn't spawns anywhere...oh and i copy only the SaveLoadEngine category....

Sorry for my bad english :(

EDIT: here is the link to my map.If anyone want's to see what i had done http://www.thehelper.net/forums/showthread.php?t=42728
 
Hey effane,could it be possible that you add player specific?I must admit this is great work but people tend to borrow/steal codes and it change the lenght of the game.
 
Is there a way to prevent item duplication abuse? I figure saving the playername might help, but it's not 100% protective, any other suggestions?
Great tutorial by the way.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    We have some elderly guests that regularly come hang out at the bar at the end of the night, and every once in a while we don't see someone for a few weeks and then someone shows up with their obituary.
  • Varine Varine:
    We usually let them do their memorials there in the morning if they want to and I'll make them some snacks and drinks. There was one guy named Tom that came in like every night and would sit by himself and get a bunch of soup and a glass of wine. idk why but he LOVED our fucking soup, like he would order a fucking quart of it at a time and would always get so sad when we stop doing it for the summer.
    +1
  • Varine Varine:
    But he also loved our calamari, which is another thing I hate but it sells super well so I can't change it. There was one day he came in and was asking me how to make it, because he tried to at home once in the off season when we stop running it and he really wanted it lol
  • Varine Varine:
    I think he's one of the only people I've made recipes for for free because he really wanted a broccoli cheddar, and it was like dude I don't have a recipe, it's just whatever I have, but here, this is how you do it
  • Varine Varine:
    I don't think he ever figured out how to do the calamari in a pan though, like idk how to do that either. He was afraid of the at home deep fryers though and it's like yeah, that's fair, I am too
  • Varine Varine:
    He was just such a sweet old man, we had two servers pregnant and they held a baby shower together, he was soooooo fucking excited to get to see a baby. Unfortunately he died a month or so before they were born
  • The Helper The Helper:
    So I decided to Google some people that I had not seen or heard from in a while and sure enough one of my old best friends, we had a falling out years ago but whatever, find out he died of Pancreatic Cancer in January. I have also lost a few of my closer acquaintances from growing up the last year. Getting old - people die - I kinda thought it was going to be this way a few years ago....
    +2
  • The Helper The Helper:
    Forum running super slow again
  • Ghan Ghan:
    Not really clear from the stats as to what is causing the slowness.
  • Ghan Ghan:
    We get a lot of guest traffic so it may just be the load is getting too high and not from any particular source.
  • Ghan Ghan:
    Looks like the server is maxed out on CPU.
  • Ghan Ghan:
    Oh it looks like a lot of the traffic is Silkroad Forums. That domain isn't protected by Cloudflare.
  • Ghan Ghan:
    But the old Silkroad site is still on its own server. I just had a test site set up on this server for it.
  • Ghan Ghan:
    I just disabled that test site. Let's see if that helps the load.
  • Ghan Ghan:
    Looks much better already.
  • The Helper The Helper:
    I had actually forgot about the Silkroad site. I had asked
  • The Helper The Helper:
    SD Ryoko about it and he said the couple of people left on there really like it, that was a few years ago, maybe I should check back
  • jonas jonas:
    I guess when you're getting old, and the last day of soup season draws near, you start wondering
  • jonas jonas:
    will I make it to the start of the next season? or was this the last time I'll ever have my favorite dish?
  • The Helper The Helper:
    I am doing my first Vibe Coding project. In installed the environment and tools according to instructions but it is all chat doing this for me at my direction. It is fun really and holy shit I might finish in 2 hours what it would have taken a day to in my Access and this would be an electron app complete new
  • Ghan Ghan:
    Good stuff.
  • Ghan Ghan:
    Just make sure it is secure. :)
    +1
  • The Helper The Helper:
    It will only be on internal network
  • jonas jonas:
    Man the AI is good about gaslighting about security though. I've had several times where I pointed out security problems and it tried to convince me that with a tiny tweak it suddenly becomes secure
  • jonas jonas:
    Like using a distrobox as a "secure" container, and when I point out that's not secure at all, it claimed that specifying home will make it secure

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials
      Top