1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  3. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  4. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

CodeGen 1.0.2

Submitted by TriggerHappy
This bundle is marked as approved. It works and satisfies the submission rules.
Introduction

Sometimes you need to transfer data between games in order to keep the progress you've made. For example in RPG maps you probably want to save your hero, levels, gold and items so you can continue next time you play. The way this is done in Warcraft III by generating codes that contain all of your data, which can later be re-entered to restore that saved information. This is nothing new in the modding world however it's commonly asked about and requested yet many people still have issues. This is part of the reason why I decided to create an easy to use, universal, GUI-friendly save and load system which I'm calling the Code Generator.

Main Features
  1. Player-name sensitive (optional).
  2. Highly configurable.
  3. Can be used in the normal World Editor (doesn't require JNGP).
  4. Very easy to use.

Configuration

  • -------- -------------------- --------
  • -------- The below options are for saving load codes to the Warcraft III folder. --------
  • -------- You can modify the file name via the SaveLoad_Filename variable within the save trigger. --------
    • -------- -------------------- --------
    • Set SaveLoad_SaveToDisk = True
    • Set SaveLoad_Directory = Save
    • -------- -------------------- --------
    • -------- Some configurables --------
    • -------- -------------------- --------
    • Set SaveLoad_Alphabet = abcdefghkmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789
    • Set SaveLoad_CheckName = True
    • Set SaveLoad_Security = True
    • Set SaveLoad_HyphenSpace = 4
    • Set SaveLoad_SeperationChar = -
    • Set SaveLoad_Lower = |c002a4580
    • Set SaveLoad_Number = |cffffcc00
    • Set SaveLoad_Upper = |cff008000
    • -------- -------------------- --------
    • -------- Increase the value if you want to save bigger numbers --------
    • -------- Decrease it if you want to generate a smaller save code but only be able to save smaller values --------
    • -------- It's suggested to not increase it above 7 --------
    • -------- -------------------- --------
    • Set SaveLoad_MaxValue = 6
    • -------- -------------------- --------
    • -------- Store all the heroes you want to be able to be saved below. --------
    • -------- -------------------- --------
    • Set SaveLoad_Hero[0] = Blood Mage
    • Set SaveLoad_Hero[1] = Lich
    • Set SaveLoad_Hero[2] = Blademaster
    • Set SaveLoad_Hero[3] = Demon Hunter
    • Set SaveLoad_HeroCount = 3
    • -------- -------------------- --------
    • -------- Store all the abilities you want to be able to be saved below. --------
    • -------- -------------------- --------
    • Set SaveLoad_Abilities[0] = Flame Strike
    • Set SaveLoad_Abilities[1] = Siphon Mana
    • Set SaveLoad_Abilities[2] = Phoenix
    • Set SaveLoad_Abilities[3] = Banish
    • Set SaveLoad_AbilityCount = 3
    • -------- -------------------- --------
    • -------- Store all the items you want to be able to be saved below. --------
    • -------- -------------------- --------
    • Set SaveLoad_Item[0] = (Item-type of No item)
    • Set SaveLoad_Item[1] = Claws of Attack +15
    • Set SaveLoad_Item[2] = Crown of Kings +5
    • Set SaveLoad_Item[3] = Kelen's Dagger of Escape
    • Set SaveLoad_Item[4] = Mask of Death
    • Set SaveLoad_Item[5] = Orb of Frost
    • Set SaveLoad_Item[6] = Ring of Protection +5
    • Set SaveLoad_ItemCount = 6
    • -------- -------------------- --------
    • -------- Don't modify below this line. --------
    • -------- This is just here to copy variables to your map --------
    • -------- -------------------- --------
    • Set SaveLoad_Full = SaveLoad_Alphabet
    • Set SaveLoad_Error = <Empty String>
    • Set SaveLoad_Base = (Length of SaveLoad_Alphabet)
    • Set SaveLoad_Char[0] = <Empty String>
    • Set Load[0] = 0
    • Set LoadCount = 0
    • Custom script: call CodeGen_Init()

Installation
  1. Make sure your settings allow copying variables (Image)
  2. Copy the CodeGen folder over to your map.
  3. Paste the maps script into yours (Image)

How do I use it?

Let's take a look at the most basic example.

  • Set Save[0] = (Player 1 (Red) Current gold)
  • Custom script: set udg_Code = CodeGen_Compile()
  • Game - Display to (Player group((Triggering player))) for 60.00 seconds the text: Code

The above will save Players 1's gold. Simple, isn't it? Now you're probably asking "How do I load it?".

  • -------- Check if load is valid --------
  • Set Code = (Substring((Entered chat string), 7, 999))
  • Custom script: call CodeGen_Load(udg_Code)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • SaveLoad_Valid Equal to False
    • Then - Actions
      • Game - Display to (Player group((Triggering player))) for 10.00 seconds the text: SaveLoad_Error
      • Skip remaining actions
    • Else - Actions
  • Player - Set Player 1 (Red) Current gold to Load[0]

Equally as simple and there are more examples are available in the demo map.

Keywords:
save,load,save load,save and load,code,codegen,code gen,triggerhappy,password,gen,generator,generate,preloadgen,preload,file,io,to,disk
Contents

CodeGen v1.0.2 (Map)

Reviews
Moderator
8 March 2014 PurgeandFire: Approved. Review: http://www.hiveworkshop.com/forums/2496968-post145.html 21 December 2013 Bribe: changed status to needs fix. 8 Sep 2011 Bribe: Deprecated in favor of: Save/Load with Snippets 21:27, 29th Aug...
  1. 8 March 2014
    PurgeandFire: Approved.

    Review:
    http://www.hiveworkshop.com/forums/2496968-post145.html

    21 December 2013
    Bribe: changed status to needs fix.

    8 Sep 2011
    Bribe: Deprecated in favor of: Save/Load with Snippets

    21:27, 29th Aug 2010
    The_Reborn_Devil:

    The coding looks ok and the system is working. Also easy to use.


    Status: Approved
    Rating: Useful
     
  2. Statharas

    Statharas

    Joined:
    Jul 9, 2008
    Messages:
    2,332
    Resources:
    14
    Tools:
    1
    StarCraft II Resources:
    5
    Tutorials:
    8
    Resources:
    14
    Did you test it in Multiplayer?

    [offtopic]I thought this was... EEeew... I won't even dare to touch it after what i've seen D:
    [/offtopic]
     
  3. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    This system works.
    However, this is nothing new and the iGen by Hanky is a lot better.

    Also it broke the rules
     
  4. Zeatherann

    Zeatherann

    Joined:
    Nov 25, 2008
    Messages:
    1,303
    Resources:
    6
    Skins:
    1
    Tools:
    1
    Maps:
    4
    Resources:
    6
    May not be the best but it's not vJass, or cJass.
     
  5. dardas

    dardas

    Joined:
    Sep 12, 2008
    Messages:
    649
    Resources:
    0
    Resources:
    0
    I find this alot easier then the one made by hanky, since hanky's one is for more advanced players.. or atlesat for people with experience with save/load systems.
    since it requires to use alot of stuff. size, SaveSomething(), etc..
     
  6. Kazzo

    Kazzo

    Joined:
    Jun 14, 2009
    Messages:
    428
    Resources:
    15
    Icons:
    6
    Skins:
    9
    Resources:
    15
    It could be usefull for people good job
     
  7. Cweener

    Cweener

    Joined:
    Oct 10, 2009
    Messages:
    1,440
    Resources:
    1
    Maps:
    1
    Resources:
    1
    It didn't brake the rules because Hanky's is vJass, which is a no-go for me, as I cannot use vJass.
    So this system is indeed helpful to people like me.

     
  8. HeroSlayer

    HeroSlayer

    Joined:
    May 14, 2007
    Messages:
    187
    Resources:
    0
    Resources:
    0
    Excellent, i only use normal jass since i dont see the need of using vjass
    Great job :D!!
     
  9. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Huh what, why? Also there are a lot of other JASS/GUI Save/Load-Code systems, they are just not uploaded here because they were rejected because other systems (such as Hankys) have proven to be better, which is why I can't see this should be approved.

    This system for example is in GUI too and has been proven to be a great system you can count on. This one is also good on my first quick look.

    If you still wanna use another system, you should try this one on wc3c.net. Seriously, I think we have enough of these.

    Edit: Or use this one.
     
  10. Marsal

    Marsal

    Joined:
    Jun 24, 2009
    Messages:
    1,345
    Resources:
    15
    Maps:
    1
    Spells:
    14
    Resources:
    15
    uh yeah bullseye

    aawww yeaha again now this is the best GUI/JASS Save/Load system here....


    THE KEYWORD IS HERE
     
  11. Noobsmoke

    Noobsmoke

    Joined:
    Nov 20, 2007
    Messages:
    631
    Resources:
    1
    Spells:
    1
    Resources:
    1
    well .. good system, but if you have like 200 items on your map, you have to add all in the initialization trigger ?! o_O
     
  12. Marsal

    Marsal

    Joined:
    Jun 24, 2009
    Messages:
    1,345
    Resources:
    15
    Maps:
    1
    Spells:
    14
    Resources:
    15
    yeah that's a big problem :S
     
  13. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Others got rejected here because they were not so good as Hankys, this isn't either and is approved. I don't see the logic in here.

    And we don't need 1000 systems on each place. If every community has a good one, that's enough. You can still use the other systems from other communities.
     
  14. Darkzealot_128

    Darkzealot_128

    Joined:
    Jun 29, 2010
    Messages:
    736
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    With this save/load system is it able to save for more than 4 players if you insert more events or do you need to do more than just insert more events?
     
    Last edited: Aug 30, 2010
  15. HeroSlayer

    HeroSlayer

    Joined:
    May 14, 2007
    Messages:
    187
    Resources:
    0
    Resources:
    0
    oh my god...
    anachron please... stop complaining about Cweener's work.
    If you like it you use it.
    If you dont like it then you dont use it, and you shut the FUCK up. Please... getting posts on your account wont get you a life :/
     
  16. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    I brought valid arguments and you do not even care.
    I just gave my feedback, is that forbidden?
     
  17. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    People, I am giving constructive critism.
    Why don't you get that?

    Seriously, why do you think only positive comments help?
    In fact it helps the most if you say whats wrong instead posting f.e.
     
  18. Marsal

    Marsal

    Joined:
    Jun 24, 2009
    Messages:
    1,345
    Resources:
    15
    Maps:
    1
    Spells:
    14
    Resources:
    15
    you just need to add events to save and load triggers
    like if player 2 (blue) enters ....
    if player 3 (teal) enters ....
    etc.
     
  19. medion555

    medion555

    Joined:
    Jun 20, 2008
    Messages:
    467
    Resources:
    0
    Resources:
    0
    I used this system in my not uploaded map and i like it i Made a thread about where is whas becouse i wanted to look for a new version(if there whas one) And i couldn't find it.
    Anachron it is always good to have some variation in systems then people can choose what system they want and i prefer this one :p.