HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Save Code

12-26-2006, 06:02 AM#1
doctorlee
I am currently working on a little RPG map.
My goal is to make a saving system.
(ex. When I type in "-save", a random code, "D3523KIJ" would come on the screen to load the hero and the items other time one decides to play again.)
I am wondering how I could make a trigger that would give a code that corresponds to one's name so no other person can copy the code and get the exact same character.
I don't even know where to start...
12-26-2006, 06:16 AM#2
Pyrogasm
I would suggest using the "search" bar. There are at least 2 demo save/load code maps hosted here, just look around in the "systems" section (I think that's where they are).
12-26-2006, 11:01 AM#3
rulerofiron99
I think Neostorm over at wc3sear.ch has a good one - it saves hero, items, gold, and stats. The code is as long as you want - depending, of course, on how secure you want it.

It can also easily be customized save codes that will work with that specific map only, and a code can only be loaded by a person with the same username as the person that saved it.

Only negatives are that for importing you need to add every item and hero in this long and boring list.
12-26-2006, 11:17 AM#4
Fireeye
I'm building a Save-System and this is how i save the Playername.
Hope i wrote everything correctly, because my WE is currently broken.
Hidden information:

Collapse JASS:
constant function MaxStringLenghtDecode takes nothing returns integer
    return 62 //Put here the String Lenght of the Decode String, in this example i didn't add symbols like #_-.:,; etc.
endfunction

constant function MaxStringLenghtEncode takes nothing returns integer
    return 62 //Put here the String Lenght of the Encode String 
endfunction
Collapse JASS:
function NumberToLetter takes integer i1 returns string
    //This converts the number we got into a new String
    //max Integer is in this case 62^2 == 3844
    //This should be enough for Units, Items and PlayerNames
    //For Gold there's a seperate function
    local integer i2 = i1/MaxStringLenght()
    local string EncodeString = GetStoredString(udg_gc,"Save","Encode")
    local string s1 = SubString(EncodeString, i2, i2)
    local string s2 = SubString(EncodeString,i1-(i2*MaxStringLenght()), i1-(i2*MaxStringLenght()))
    local string s3 = s1 + s2
    return s3
endfunction
Collapse JASS:
function EncodePlayer takes string PlayerS returns string
    local string s1
    local string s2
    local string s3
    local integer i1 = 0
    local integer i2 = 0
    local integer i3 = 0
    loop
        set s1 = SubString(PlayerS, i1, i1)
        exitwhen s1 == ""
        set i2 = 0
        loop
            set s2 = SubString(GetStoredString(udg_gc,"Save","Decode"),i2,i2)
            set i2 = i2 + 1
            exitwhen (i2 > MaxStringLenght()) or s1 == s2
        endloop
        if i2 <= MaxStringLenght() then
            set i3 = i3 + i2
        else
            set i3 = i3 + 0
        endif
        set i1 = i1 + 1
    endloop
    set s3 = NumberToLetter(i3)
    return s3
endfunction
12-26-2006, 11:28 AM#5
The)TideHunter(
Yes, please use the Search feature, it really saves us all time.

Here is Vexorian's Save/Load system, its really easy to use, and you can set it up how you like.

http://www.wc3campaigns.net/showpost...80&postcount=1
12-30-2006, 01:59 AM#6
doctorlee
Quote:
Originally Posted by Pyrogasm
I would suggest using the "search" bar. There are at least 2 demo save/load code maps hosted here, just look around in the "systems" section (I think that's where they are).
Sorry.
The search was not working at the moment.