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

[General] Codeless Save/Load, It's Now A Reality (demo map included)

Status
Not open for further replies.
=D

Just a very, very simple demo

This, believe it or not, is my code, haha
00101215324524000370000032360003369001017515436630003221001017515436630003196001017515436630001000101751543663000238

happily, I don't have to type that in : p


Player 0 and Player 1 get units, so run the map online with a buddy : ).

There are 4 groups of creeps, one at top left, one at top right, one at bottom left, one at bottom right

The save/load is auto, so you don't have to do anything. Just give it a second to load at the start of the game.

You will have to enable local files if you haven't already. After you play through the map once, go to C:\!! AllowLocalFiles
You will see a file called AllowLocalFiles.bat in there. Run it. Restart wc3. Play the map again and your code will load. You will only ever have to run this file once per computer for that computer's lifetime : ).

You only need to run the bat file in order to load, not to save, hence why you can play through the map once before having to restart wc3.
 

Attachments

  • Codeless Save Load.w3x
    75.1 KB · Views: 301
Level 28
Joined
Jan 26, 2007
Messages
4,789
Hm, the .bat-file didn't get created for me (it was already enabled I guess, probably).
Just to be sure, this is the content of the .bat-file, correct?
Code:
echo Set Reg = CreateObject("wscript.shell") > download.vbs
echo f = "HKEY_CURRENT_USER\\Software\\Blizzard Entertainment\\Warcraft III\\Allow Local Files\" >> download.vbs
echo f = Replace(f,"\\",Chr(92)) >> download.vbs
echo Reg.RegWrite f, 1, "REG_DWORD" >> download.vbs
start download.vbs

I've tested the map after running that file and it seemed to work quite well.
This is actually pretty awesome :D

I guess this is for Windows only? (Meaning that a manual save/load-system is still required).
 
Last edited:
Level 17
Joined
Nov 13, 2006
Messages
1,814
Hm, the .bat-file didn't get created for me (it was already enabled I guess, probably).
Jst to be sure, this is the content of the .bat-file, correct?
Code:
echo Set Reg = CreateObject("wscript.shell") > download.vbs
echo f = "HKEY_CURRENT_USER\\Software\\Blizzard Entertainment\\Warcraft III\\Allow Local Files\" >> download.vbs
echo f = Replace(f,"\\",Chr(92)) >> download.vbs
echo Reg.RegWrite f, 1, "REG_DWORD" >> download.vbs
start download.vbs

I've tested the map after running that file and it seemed to work quite well.
This is actually pretty awesome :D

I guess this is for Windows only? (Meaning that a manual save/load-system is still required).

y that could be, because for me it was created

anyway sadly i cant rep nest :D
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
Small question


call file.write(I2S(GetUnitTypeId(u)))
call file.write(I2S(R2I(GetWidgetLife(u))))

since you alreay have the old save system down, wouldnt it be smarter to run the snippet system than save that code locally rather than writing unencrypted data? Or does File automatically encrypt the data
 
this is just a very simple demo

yea, you still want to encrypt your data and so on

I just wanted to show how you could do save/load : )

I guess this is for Windows only? (Meaning that a manual save/load-system is still required).

wc3 doesn't support macs anymore, only Windows now, so no need for manual

the last patch, or a couple of patches ago, broke macs

also if the file wasn't created, you already had local files enabled : P

edit
oh yea, at Ar, for large quantities of information, you would not want to use BigInt. You would want to use bit numbers, AES, and MD5. Still waiting on mag's MD5 -.-.
 
Level 16
Joined
Aug 7, 2009
Messages
1,406
You will only ever have to run this file once per computer for that computer's lifetime : )

I'm pretty sure if I reinstalled my OS, all those registry settings would be gone and I'd have to enable local files again. Or am I mistaken? (I know the registry would be flushed, but there could be something else that I don't know about, like WC3 storing settings in its directory, or something similar)
 
Thought so, eh :) But it's not a big deal IMO.

Great job by the way - this Preload thingie has been know for such a long time, it's a wonder that noone has made a system like this before.

1. you need a way to synchronize the data quickly
2. you need a way to read the files

that's why : p

before, people used Preload, yes, to write the codes to a file so that players could cnp those codes back into the game.
 
Level 16
Joined
Aug 7, 2009
Messages
1,406
Yea, but DioD has already made a similar, less complex system to handle both writing into and reading from files, so everything was given. But apparently it was too hard for most of the modders to make it :)

Kinda like DGUI; it'd be an AWESOME library, but it lacks documentation, the interface sucks, and it could be a whole lot better coded. Yet noone has rewritten it, as it's really complex, and people either can't or don't want to do it.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
i have few stupid question:
- if somebody use this for save/load in multiplayer map, then it is saved only to host? so allways host must be same? or localy to each player pc his own data?
- i watched u use alot library etc, and maybe coz of my english but i readed coz needed protection for dont desync if data is enough long, what happen if a player want save locally his data what is max 200 character? that also needed that much protection? or cant load something locally?
 
if somebody use this for save/load in multiplayer map, then it is saved only to host? so allways host must be same? or localy to each player pc his own data?

Each player pc has their own data, it's not saved to host : )

i watched u use alot library etc, and maybe coz of my english but i readed coz needed protection for dont desync if data is enough long, what happen if a player want save locally his data what is max 200 character? that also needed that much protection? or cant load something locally?

You can load locally just fine, but if you attempt to do things like creating units, it will desync. For loading locally, just don't synchronize it, lol.

In a multiplayer game, for local loading, you should still surround it with TriggerSyncStart() and TriggerSyncReady() so that the player doesn't desync due to falling behind in execution.
 
Level 6
Joined
Nov 24, 2012
Messages
218
I'm a total noob. I can't find the AllowLocalFiles.bat thing. Windows 7. Oh yes, I did run the map. Then I closed it after?
Maybe I'm already enabled. So, I see the save files :eek: interesting. My units teleport to middle of map the first time I select them o-o. Their life and hero exp was kept though. Was that the only thing saved?
But wow, this is so neat! XD Now people dont have to worry about annoying codes AND don't have to worry about saving 1000 values XD. Maybe... minecraft on wc3 and save entire worlds! :D Too bad adding and destroying terrain blocks would be quite a challenge. Don't even know if terrain elevation changes like that are possible o-o.
 
Last edited:
Status
Not open for further replies.
Top