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

[JASS] Save/Load code!

Status
Not open for further replies.
Level 13
Joined
Nov 22, 2006
Messages
1,260
Hello everyone!

Illiterate n00bish question: hi can u plz halp me quiter with onwe save/luod kewd?

Translation: I'm here to ask you an ultra-noobish question that will make me a disgrace to all JASSers in the world: what is a save/load code/system?

Possible reactions:
  • There are 50 fucking threads on this subject already YOU IDIOT!!!
    - reply: Yes, I know, I searched all of them, but nobody there was that noobish to ask what it is
    - linkies: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25....
  • I'm gonna kill you for spamming, you punkass bitch!!
    - reply: Not over forum you won't, if you want my adress......well it's kinda screwy, with croatian letters, ticks and whatnot, so you won't be able to understand it
  • Learn to search, you shit n00b!!
    - reply: Well, I think you use that pretty Search this forum button and you type in what you want to search for
  • (Mod) I gave you neg rep for spamming, learn to search.......<some linky on forum rules>.....blabla
    - reply: Whatever, I don't care, just help me
So please be original when replying ;)

From what I understood it is a way to save stuff in strings, scramble it so it can't be hacked easily (whatever that means) and then load it. It can save hero items, attributes, experience etc. Uses 2 chat keywords: "-save" and "-load".

Can someone help this n00b in trouble?

P.S. I know JASS, don't worry: 1, 2, 3, 4, 5 (leak knowledge), 6, 7, 8, 9.....
 
Level 11
Joined
Feb 18, 2004
Messages
394
a save code is a method of transporting data from one play session to another. This information may be hero stats, score, whatever. Save codes are written down by the user, and input on the next play session.

Data is encoded in to a string, and decoded from it when the user inputs it for his next play session. Its the easiest way to transport data between play sessions in battle.net. Most people don't want simple to edit save codes, so they include junk data or otherwise encode the string in weird ways. some save code systems also include part of the username in the save code. (would be best to just create a hash of the username, encode, decode, rehash, compare)

most save / load code systems encode data using a large number of character glyphs, generating shorter codes. (higher base numbering system = fewer digits)

The method of code output and the method of code input can vary. It doesn't really matter how you output the code or have it input.
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
Umm a code that transfers values
like level of hero
gold of someone
and other things

anyway Idk

<offtopic> approve my spell pack</offtopic>
 
Level 11
Joined
Aug 25, 2006
Messages
971
This is what happens.
When a user types -save
It takes his hero and breaks it down into what actually matters.
Items (6 slots, so this req. at least 6 digits)
Level/XP
etc.

Anyway, it takes these values, and spits out a string.
"3msAs03OdP#" All that data would be inside that string. However the data would be encrypted so that a normal person can't modify it and cheat.

Like if I gave you all your data as in L20G205L306 it wouldn't be hard to guess Level is 20 Gold is 205 and Lumber is 306. Then I could easily modify any of those values before I go to type in -load. So when I did use the modified code, I could be ultimate. This is why they encrypt the data, so a normal user can't read it.

When the user types -load it unencrypts the data and rebuilds the hero.

Why? This is the only method of transferring data through multiplayer games. If you want to consistantly work on the same hero in an online rpg, all you have to do is give it your code. Obviously your code will change everytime your hero does, so you have to get a new one at the end of every game.

Such methods can store more then just a Hero. It can store almost any form of values. Like your gold (which is an integer)
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
Hmmmm..... lets see if I got this right.

EF, by play session, you mean another map? So it's a way to transfer data from one map to another?

Questions:

How does the system know which unit to save when you just type -save?
How does the system know which unit to load when you just type -load?
How does the system know which unit-type to load if you just put its items, exp, level etc. in that string? Do you put the unit-type in the string too?

Well, I think I almost got it.

I'm just wondering how to make a good encryption system.......but that's probably with practice.
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
it convets some data to numbers and letters
and it reads the numbers and datas with the way it convert
(A001 = 15eD <=> 15eD = A001 for example)
Every save/load system uses a different method I guess
why dont you make some investigation on a save/load system
 
Level 11
Joined
Feb 18, 2004
Messages
394
Hmmmm..... lets see if I got this right.

EF, by play session, you mean another map? So it's a way to transfer data from one map to another?

most commonly save / load codes are used to transfer data between two play sessions of the same map, but they can be used to transfer data between play sessions of different maps.

How does the system know which unit to save when you just type -save?
its coded in to the map... usually a unit array pointing to players heroes

How does the system know which unit to load when you just type -load?
you don't just type -load. most systems have you type -load followed by the code it output in the last play session, such as: -load CODE HERE

How does the system know which unit-type to load if you just put its items, exp, level etc. in that string? Do you put the unit-type in the string too?
you don't have to put the unit type in to the string. you can tie rawcodes to smaller numbers for a shorter code.

I'm just wondering how to make a good encryption system.......but that's probably with practice.
more like with math.
 
Level 11
Joined
Aug 25, 2006
Messages
971
You don't have to make your own encryption. Vexorian made a very good system. All you have to do is pass it w/e variables you want it to encrypt, and it'll give you the encrypted string.
 
Level 15
Joined
Aug 18, 2007
Messages
1,390
A save/load code is not a code like L20G205L130 its a code which takes the WC3 code string for the lumber, like BPo12GH for 45 lumber (ok it might only be BP35 or something... whatever) and splits up. when a save/load code saves an item, it takes the ID of the item, not like unroot id, no like which number the spell was made (like u make 3 spells; earth blade, fire blade and frost blade. First u make earth, then fire and last frost. Then Fire will have the ID 278.. why? beacause wc3 already got 276 items, if u understand) This is like spells too if u use a custom spell system (ppl is able to choose their own spells) Hope u got it :)
 
Status
Not open for further replies.
Top