In order to get save/load with snippets working, you need to cnp the libraries that you are going to use.
At the top of the demo is a list of resources that it uses (library names). You have to go to the various triggers that contain those libraries and cnp them into the target map.
I believe, if I organized it correctly, that most, if not all of the required resources are in 1 folder. The optional ones (some of them used by the demo) are in a separate folder.
Once you get that down, you are set =).
However, given that you are having a difficult time porting it over, I believe that you are going to find catalog design very, very difficult >.<.
Rather than give up and have people give you AceHart's with a SaveHDD function, you should ask what resources are required for the demo, and then ask about catalog design and so on. No, I wasn't willing to go through and list out all of the resources required, that woulda been a waste of my time >.<.
You also need to be experienced in vJASS to use it. The only super user friendly GUI systems atm is Acehart's. One that is very GUI friendly in use but not in installation is the codeless save/load one :\.
What are you going to get in Acehart's save/load system?
Saved values will be split up, making the code longer and less secure
Code will have no hash, any hash will be split off and will be weak (code data validation)
Code will have no encryption (code mix up)
Code will have no CRC (code length validation)
Code will not be player unique unless the player's name is stored in the code, which makes it longer
save/load with snippets features
knuth checksum hash
scrambler encryption (player unique)
constant crc
merging values
codeless save/load features
MD5 (player unique)
AES (player unique, layered with bounds protection)
bitwise (fast, values at bit level, not perfectly merged though so slight bloat)
You can use either File IO or SaveCodeToHD. File IO is a DC system in Spells and SaveCodeToHD is included in the save/load with snippets map.
function SaveCodeToHD takes string mapname, string mapver, integer playerId, string filename, string saveCode returns nothing
library SaveCodeToHD
globals
private string array playerName
private boolean isGameOnline
endglobals
private function WriteLine takes string line returns nothing
call Preload("\")\r\n\t\t"+ line +"\r\n\t//(\"")
endfunction
constant function GetSaveGameFolder takes nothing returns string
return "Savegames"
endfunction
function SaveCodeToHD takes string mapname, string mapver, integer playerId, string filename, string saveCode returns nothing
local string onlineFolder = ""
if (isGameOnline) then
set onlineFolder = "Online"
else
set onlineFolder = "Offline"
endif
call PreloadGenClear()
call PreloadGenStart()
call WriteLine("-load "+saveCode)
call PreloadGenEnd(GetSaveGameFolder()+"\\"+mapname+"\\v"+mapver+"\\"+playerName[playerId]+"\\"+onlineFolder+"\\"+filename+".txt")
endfunction
private module Init
private static method onInit takes nothing returns nothing
local integer i = 11
loop
set playerName[i] = GetPlayerName(Player(i))
exitwhen 0 == i
set i = i - 1
endloop
set isGameOnline = not ReloadGameCachesFromDisk()
endmethod
endmodule
private struct InitS extends array
implement Init
endstruct
endlibrary
call SaveCodeToHD("my map name", "version of map", playerId, "file name of file (hero name?)", "this-isac-ode")
The SaveCodeToHD thing is just a function. Save/Load With Snippets is not a system, it is a collection of systems and functions that make save/load easier. SaveCodeToHD is one such function. I think it just takes a string, but it might take a BigInt.
But yea, File IO is the full blown system for reading/writing files.
edit
You want full blown File IO or a simple write function? Save/Load With Snippets, like I said, is just a collection of functions to aid in save/load : |. The demo uses a lot of those functions, it is not a system >.<.
This is one such library from the map.
function SaveCodeToHD takes string mapname, string mapver, integer playerId, string filename, string saveCode returns nothing
JASS:library SaveCodeToHD globals private string array playerName private boolean isGameOnline endglobals private function WriteLine takes string line returns nothing call Preload("\")\r\n\t\t"+ line +"\r\n\t//(\"") endfunction constant function GetSaveGameFolder takes nothing returns string return "Savegames" endfunction function SaveCodeToHD takes string mapname, string mapver, integer playerId, string filename, string saveCode returns nothing local string onlineFolder = "" if (isGameOnline) then set onlineFolder = "Online" else set onlineFolder = "Offline" endif call PreloadGenClear() call PreloadGenStart() call WriteLine("-load "+saveCode) call PreloadGenEnd(GetSaveGameFolder()+"\\"+mapname+"\\v"+mapver+"\\"+playerName[playerId]+"\\"+onlineFolder+"\\"+filename+".txt") endfunction private module Init private static method onInit takes nothing returns nothing local integer i = 11 loop set playerName[i] = GetPlayerName(Player(i)) exitwhen 0 == i set i = i - 1 endloop set isGameOnline = not ReloadGameCachesFromDisk() endmethod endmodule private struct InitS extends array implement Init endstruct endlibrary
So you could literally do
call SaveCodeToHD("my map name", "version of map", playerId, "file name of file (hero name?)", "this-isac-ode")
Save/Load with Snippets is essentially a giant pack of snippets that can be used to make a save/load system, hence the name "Save/Load with Snippets" lol.
function SaveCodeToHD takes string mapname, string mapver, integer playerId, string filename, string saveCode returns nothing
call SaveCodeToHD("my map name", "version of map", playerId, "file name of file (hero name?)", "this-isac-ode")
call SaveCodeToHD("my map name", "version of map", playerId, "file name of file (hero name?)", "this-isac-ode")
GetUnitName
nop, lol
You need to have experience with JASS to use this =)
Drop the v also in version, it's added inside of the function.