System The Shortest Save/Load Code Ever

Sooda

Diversity enchants
Reaction score
318
> my friend Elm St Fred right now made a working save load in my map that uses only 4 triggers...is that smaller than this?

Belive it or not but output counts here.
Chocobo said:
Ricky said:
4. If this is a tutorial shouldn't it be in tutorial submission?
Read the thread?
C'moon it' s Hi~Ricky... he dosn' t need to.

> Kode

It' s like Code ? Nice name, really, sounds like Kodak (To me). Hm shortest possible ?
I got still in my mind compressed save/ load code. Why somebody wouldn' t do program what would allow you to add all your item raw names, charges, abilities, etc. Then it would calculate for you all possibilities what combinations you could have in inventory and abilities. Then you need to save only charges, ability levels, exp, gold, lumber, etc.
I think normal save/ load code should only consist of ABC... 123....
 

Korolen

New User (Why do I keep getting those red bars?)
Reaction score
69
0.2.1

New in this version is the unordered list, which saves code space by applying a very rudimentary "compression" technique. Still, it can be quite effective, especially if the same value is repeated (doesn't have to be in a row, either). And, it can never be BIGGER then without, so there's nothing to lose :p.

> Kode. It' s like Code ? Nice name, really, sounds like Kodak (To me). Hm shortest possible ?

Kode is like a cross between Korolen and Code... only problem is its very similar. I just realised today that this thread was duplicated and put into the FTC section, but the admin that did it put the title as "Code: The shortest save/load code system". Sigh. I think I'm just going to edit that thread to a redirection to this one, as I don't really want to have to keep both of them updated.

And yea, as far as I know, this is the shortest code system ever. See, if you have a certain amount of data, then it can be expressed in a certain amount of possibilities. If a system uses just enough code space to store that data, then it is at 0. If it takes more code space with some of it wasted, then it is above 0. With the addition of the Unordered Lists to Kode, it is now negative, using less code space then it would normally take to store the possibilities. (It does that by losing the data of the order that the list was in – something that doesn't matter, and that would normally be stored in the code – and rearranging them into a order that can then be "compressed" easily.)

EDIT: There aren't actually any examples on the Unordered Lists in the test maps; you'll have to write some test code yourself if you want to see them in action :p
 

Syndrome

You can change this now in User CP.
Reaction score
126
One question, if i add an ability to the unit which it does not usually have through triggers, will that ability be saved?
 

Bomber7

New Member
Reaction score
0
@Geoff
Ummm no. Why not? Simply because Kode saves what you tell it to. The hero saver is an example, it is not to be used as anything BUT an example. You must program your own hero saver, then it well be YOU who decides whether or not it saves abilities not normaly had by a hero/unit.

@Korolen Kode is great, a wonderful peice of work. I plan on using it in an rpg I am making. However I also plan to scramble the data before and after it comes out from Kode so as to make it near impossible for people to use kode to save a hero independently of my map. I congratulate you on your work making this.

Sorry if i'm reviving a very dead thread.
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
my friend Elm St Fred right now made a working save load in my map that uses only 4 triggers...is that smaller than this?

It is possible to have only one "actual" trigger that contains 4 or more/less triggers. In JASS that is.

You could do it with 3 if your only loading simple objects. (gold, wood, etc)

__________________
Hosting Tutorial
Elite Footmen

It doesn't have to be simple objects, it can be anything but be in one simple trigger. JASS trigger, that is. :p

> my friend Elm St Fred right now made a working save load in my map that uses only 4 triggers...is that smaller than this?

Belive it or not but output counts here.

C'moon it' s Hi~Ricky... he dosn' t need to.

Man, that is so fricken' hilarious... I can't stop laughing... :D

Sorry if i'm reviving a very dead thread.

Don't worry, it wasn't dead. ;)
 
E

EmthY

Guest
I need some help configuring a TD with Kode.

I am editing a TD and would like to add a secret builder.
The secret builder will be avaible only for thoose who won the game in the specified difficulty. This is where i want the Kode ,cause i want codes individually. Since the map wont be protected, if i add only 1 code for the secret builder every1 could open and see it...
If i was not enough understandable, than: i want a code to be auto-generated, when the last level is beaten, and i want player's to have code generated by ex: their names.
So i dont want to make the game easier for lamers :shades:

Could you help me plz configure this stuff?
Step-by-step plz, i am newbie at mapmaking, so i need detailed write-off.

Thnx in advance
 

Korolen

New User (Why do I keep getting those red bars?)
Reaction score
69
I need some help configuring a TD with Kode.

I am editing a TD and would like to add a secret builder.
The secret builder will be avaible only for thoose who won the game in the specified difficulty. This is where i want the Kode ,cause i want codes individually. Since the map wont be protected, if i add only 1 code for the secret builder every1 could open and see it...
If i was not enough understandable, than: i want a code to be auto-generated, when the last level is beaten, and i want player's to have code generated by ex: their names.
So i dont want to make the game easier for lamers :shades:

Could you help me plz configure this stuff?
Step-by-step plz, i am newbie at mapmaking, so i need detailed write-off.

Thnx in advance

Similar to ZTD Survivor, say? For a code that enables a user to do something, but doesn't actually contain any information itself except for the fact that the user just typed in a code in the first place, then you code needs the following stuff saved into it:

"doesn't actually contain any information"

Tada!

All you need to do is create a code for the player, without adding any actual data into the code with the Add Integer To Code function. So just prepare the workspace, set your options, and generate a code.

If you don't know how to do that, then you should refer to the examples. Take the "arbitrary number" example, and remove all the parts that add information to the code. I hope your knowledge of triggers will enable you to set which player the code is generated for, and any other configuration you want (like how many bits of security you add to the code, I.E how long the code is for the user, as the code has no other information but the security).

Happy mapping, and remember– don't give up :)
 

Syndrome

You can change this now in User CP.
Reaction score
126
I;m getting 1222 compile errors when I used yours, I copied the Text in the Kode[Gui Friendly] and the Kode group and the Demo Hero thing, but I still got 1222 compile errors....
 

Chocobo

White-Flower
Reaction score
409
I;m getting 1222 compile errors when I used yours, I copied the Text in the Kode[Gui Friendly] and the Kode group and the Demo Hero thing, but I still got 1222 compile errors....

...
The Tutorial says : said:
In the Trigger Editor, click on the very top item on the left (it will be called "Kode.w3x" or "Kode (GUI-Friendly).w3x"). Select everything on the right, and copy it to the clipboard. Select the group named "Kode", and copy that to the clipboard, also. Then, switch to your map.

Make sure the option "automatically create variables when pasting triggers" is set, and paste the group into your map. Then delete the trigger called "GUI Variables". In the map header, paste the text that was copied from Kode.
 

Legacyspy

New Member
Reaction score
19
I get around 1800 errors when I try to save my map after having followed your directions. and YES I did have automatically create variables checked.

I don't understand jass, but basically what happens is every line of gui I have has an error, like "expecting endif" or "invalid something." Its as if adding in your jass throws everything off. No triggers are disabled but I can't create a game with my map.
 

Chocobo

White-Flower
Reaction score
409
I get around 1800 errors when I try to save my map after having followed your directions. and YES I did have automatically create variables checked.

I don't understand jass, but basically what happens is every line of gui I have has an error, like "expecting endif" or "invalid something." Its as if adding in your jass throws everything off. No triggers are disabled but I can't create a game with my map.

Post your full .j file as [noparse]
Code:
[/noparse].
We can't help you if we can't see the source code.
 

NJJ

Cool Member
Reaction score
0
2.2: Transfer
In the Trigger Editor, click on the very top item on the left (it will be called "Kode.w3x" or "Kode (GUI-Friendly).w3x"). Select everything on the right, and copy it to the clipboard. Select the group named "Kode", and copy that to the clipboard, also. Then, switch to your map.

Make sure the option "automatically create variables when pasting triggers" is set, and paste the group into your map. Then delete the trigger called "GUI Variables". In the map header, paste the text that was copied from Kode.
How do i "automatically create variables when pasting triggers"????
 
L

Lord_of_Sausage

Guest
I think that save/load code may be the best i ever seen. Currently im importing it to my RPG but it seems to mess up my inventory system. Hopefully that fix'es itself when ive done importing.
I gave you credits, wrote in my "Read Me" (Comment in my RPG, wich will be unprotected) that you made it, not me ;).
Thanks for a great save/load code.

//Lord_of_Sausage (it was too big :(, so im lord_of_Saus... what a dumb name :p)

How do i "automatically create variables when pasting triggers"????

Files>Preferences>Automaically Create Unkown Variables When Pasting Triggers.

Hope that helped :)

Ok, it did not fix itself.
Ive importet theese from the GUI-freindly map (damn i gotta learn some more jass...)

Kode Group - Deleted the Variable trigger which were un-enabled.

The Gui-freindly Functions trigger - deleted nothing.

The Demo3 Group, i did'nt understand your "how to launch the start thingy" as i sucks at jass. I've also changed the text typed in from -savehero and -loadhero to -save and -load as im not going to use damage done in saves.
ive also changed all the Demo_ variables so they fit in my map.

BUT
when i start the map it gives a few errors in your Kode scripts, and nearly all lines are error'ed in my inventory script (http://www.hiveworkshop.com/resources_new/spells/183/
)
Ive seen that with the error before, but everything fixed itself after i added the Game cache (for the inventory).

Please would you help? i cant see what should make the errors...

Thanks in Advance

//Lord_of_Saus AKA Lord_of_Sausage ;)



oh, and how do you edit? i dont know how :p
 

Blackrage

Ultra Cool Member
Reaction score
25
I thought there was already a "shortest" save/load code system in the system section called Kode?
 

NJJ

Cool Member
Reaction score
0
How do i make -save/loadhero be used by all 12 players? and how to make it so player can only have 1 hero at a time instead??
 

Korolen

New User (Why do I keep getting those red bars?)
Reaction score
69
Across all the different sites where Kode is uploaded, I probably have about 2,000 downloads! Let us celebrate.

As someone on the Hiveworkshop page for Kode pointed out, you will get compile errors when using the GUI-Friendly version because I forgot to include a couple of variables in the GUI Variables trigger. I added the variables to the trigger so everything should work now. The fixed version is called "Kode GUI-Friendly 0.2.1b.w3x"

NJJ said:
How do i make -save/loadhero be used by all 12 players? and how to make it so player can only have 1 hero at a time instead??

This isn't really a Kode question but a basic mapping question.
 

Bomber7

New Member
Reaction score
0
My only gripe with KODE, is the weird way it displays in TESH. Unless your fanatic about line spacing, their must be a problem with the carriage returns you put in. Look at the screenshot, theres at least 1 carriage returns between each line.

Of course that problem is very minuscule and doesn't really effect anything.
 

Korolen

New User (Why do I keep getting those red bars?)
Reaction score
69
My only gripe with KODE, is the weird way it displays in TESH. Unless your fanatic about line spacing, their must be a problem with the carriage returns you put in. Look at the screenshot, theres at least 1 carriage returns between each line.

Of course that problem is very minuscule and doesn't really effect anything.
Interesting. My best guess is that TESH displays a newline for both \r and \n, and the newlines are marked in the map with \r\n (possibly because it was saved on my computer, which is a mac). Too minor to really bother with, though :p.

EDIT: By the way, it looks like you put the Kode code in a trigger called "KODE"; if you're not using vJASS then that will cause bugs later on (because WE will put the code half-way through the merged map file and only code that comes after that will work). Generally it's safer to put it in your map header.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top