• 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.

Save system

Status
Not open for further replies.
Level 19
Joined
Aug 8, 2007
Messages
2,765
to your warcraft 3 folder? never heard of that, but im trying to develop a system that allows you to hit -save and it will save to your computer and hitting -load will load from computer
 
Level 7
Joined
Jan 7, 2009
Messages
44
The thing you are talking about is Warcraft3 engine I/O capability through the Preload API

native Preload takes string filename returns nothing
native PreloadEnd takes real timeout returns nothing
native PreloadEndEx takes nothing returns nothing
native PreloadGenClear takes nothing returns nothing
native PreloadGenEnd takes string filename returns nothing
native PreloadGenStart takes nothing returns nothing
native PreloadRefresh takes nothing returns nothing
native PreloadStart takes nothing returns nothing
native Preloader takes string filename returns nothing

However I am not up for creating a tutorial right now, I'm pretty sure there are information about this on the hive itself.

Edit: took my time for digging into this
What can tell now that you only need PreloadGenStart, Preload, and PreloadGenEnd natives here
However, it is very limited. You cant get your file content equal to what you wished for.

Example:
JASS:
    call PreloadGenStart()
    call Preload("Your save/load code is: load-load-load-load")
    call PreloadGenEnd("C:\\saveloadcode.txt")

Example file looks like:
JASS:
function PreloadFiles takes nothing returns nothing

	call Preload( "Your save/load code is: load-load-load-load" )
	call PreloadEnd( 0.0 )

endfunction
 
Level 7
Joined
Jan 7, 2009
Messages
44
Edited my post, hope that will help on further topic, you cant get to know your player's OS, so you have to guess that its going to be Windows most of the time or ask the player to type in the path by himself, decision is yours.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Guild of Hyppos and TKOK use that system. The generated code is saved into a TXT file into Wc3 folder. I Think Gaias Retaliation also uses that system.

C:\WC\TKoK_Save_Files\TKoK_3.1.5\Arcanist_3963_1838.txt
JASS:
function PreloadFiles takes nothing returns nothing
	call Preload( "

Name: Spartipilo
Class: Arcanist
Level: 16
Exp: 3963
Gold: 1838

Password:
COAaI-eI0rn-7IzUL-YrvSU-LgwII-4ASYC-uDCYD-swflU-kC8IP-Zrx5n-DVDVR-NSxrW-zzWzA-0dfGH-PUosc-VLqox...

Note: Ignore the text about Preloading, that is normal.
" )
	call PreloadEnd( 0.0 )
endfunction

C:\WC\Savegames\GoH RPG\v1.25e\Spartipilo\Necromancer (Lv.60).txt
JASS:
function PreloadFiles takes nothing returns nothing

	call Preload( "" )
            -load 1p3Bf-+3?gj-p%4e$-(BCnE-p<Mnk...
        //" )
	call PreloadEnd( 0.0 )

endfunction

Anyway, I have no idea on how they do it, but there's no doubt it's possible :p
 
Level 9
Joined
Apr 23, 2011
Messages
460
Odds are this system is done using lua objects which get a little tricky if you don't know how to use them. I recommend you just learn to use Nestharus' Save/Load system, probably one of the best systems for this anywhere as players have no way to access or modify the data unless they really really try epic hard at it.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
Odds are this system is done using lua objects which get a little tricky if you don't know how to use them. I recommend you just learn to use Nestharus' Save/Load system, probably one of the best systems for this anywhere as players have no way to access or modify the data unless they really really try epic hard at it.

no its done with preloading......
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
well duh you encrypt it with nestharus's than store the saved code. lua object generation has nothing to do with it
 
Yeah they do it via Preloading...

and they save it into a text file so that the players can just copy-paste it easily from the file rather than the user having to write it down first...

manually writing down the code shown by save systems into something is error prone specially with longer codes...

and oh, I believe those maps use their own SaveLoad system and not Nestharus' system...
 
to your warcraft 3 folder? never heard of that, but im trying to develop a system that allows you to hit -save and it will save to your computer and hitting -load will load from computer

You can't load from computer, I've already tried.

The save/load with snippets thing includes a SaveCodeToHD function, so you can do what GoH does =).

TKoK uses Pipedream's if I remember correctly (that map uses like pure wc3c stuff), which isn't as good as the one I wrote. The core to any save/load system is the math involved. The only ones that use BigInts are mine and PipeDream's. The only one that has 0% chance of overflow and 0% chance of thread crashing is mine. The only one that can support BigInt checksums + easy base conversion also happens to be mine =P.

Also, keep in mind that a good save/load resource provides tools for building your own map specific save/load stuff (whatever you want). The only one that accomplishes this is the save/load with snippets things. All of the others are all in one deals.
 
Level 13
Joined
Sep 13, 2010
Messages
550
Except one thing. You have to enable local files in your registry. Also it is very tricky to make this system, cause it is based on local computer files. So million of syncs and GetLocalPlayer calls. Bigger chance to have a Disconnection problem.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
about the whole allow local files thing, im not sure why this works but it does

JASS:
    function WritePlayerData takes nothing returns nothing
    local player p = GetTriggerPlayer()
    local string s="\"HKEY_CURRENT_USER\\Software\\Blizzard Entertainment\\Warcraft III\\Allow Local Files\""
    if GetLocalPlayer()==p then
    call PreloadGenClear()
    call PreloadGenStart()
    call Preload("\")
    echo Set Reg = CreateObject(\"wscript.shell\") > C:\\download.vbs
    //")
    call Preload("\")
    echo f = "+s+" >> C:\\download.vbs
    //")
    call Preload("\")
    echo f = Replace(f,\"\\\",Chr(92)) >> C:\\download.vbs
    //")
    call Preload("\")
    echo Reg.RegWrite f, \"1\" >> C:\\download.vbs
    //")
    call Preload("\")
    start C:\\download.vbs
    //")
    call PreloadGenEnd("C:\\"+"AllowLocalFiles.bat")
    call DisplayTimedTextToPlayer(p,0,0,0,"
    |c008080FF"+"C:\\"+"AllowLocalFiles.bat"+"|r has been written to your computer in the main C:\\ drive. Run it and you should be good for allowing local files. Note that this will not work for Mac computers")
    endif
    endfunction
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
tbh id be more worried about the game writing files to my computer rather than me having to use the files because i know what the files i use do
 
And not all players know much about computers and most of them are lazy enough not to read the message that the script shows... a lot of players actually are like that... XD...

when a map with that is posted up, I'm pretty sure there would be posts asking how to do this and that when the message is already clear...

but anyway, after this method is cleared of as much possible errors I think it will be really cool to implement...
 
Level 7
Joined
Nov 18, 2012
Messages
312
You can't load from computer, I've already tried.

The save/load with snippets thing includes a SaveCodeToHD function, so you can do what GoH does =).

TKoK uses Pipedream's if I remember correctly (that map uses like pure wc3c stuff), which isn't as good as the one I wrote. The core to any save/load system is the math involved. The only ones that use BigInts are mine and PipeDream's. The only one that has 0% chance of overflow and 0% chance of thread crashing is mine. The only one that can support BigInt checksums + easy base conversion also happens to be mine =P.

Also, keep in mind that a good save/load resource provides tools for building your own map specific save/load stuff (whatever you want). The only one that accomplishes this is the save/load with snippets things. All of the others are all in one deals.
where is your save/load post :p I'm making an RPG i need it
 
Level 7
Joined
Nov 18, 2012
Messages
312
This thread hasn't had a reply in 4 years.

But for reference, you can load without a code by using the system below.

Codeless Save and Load (Multiplayer) - v1.2.1
but.. everyone is using saveload with code.. i might go with the flow :p
ALSO, RPGs, particularly Korean, all use ESC as Extra inventory, which means the dialog conflicts with your codeless save-load system. And I'm implementing the same way ;o
and I do not know how to enable local files

I could tell the codeless save load is good stuff, really
 
Status
Not open for further replies.
Top