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!
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
Player-name sensitive (optional).
Highly configurable.
Can be used in the normal World Editor (doesn't require JNGP).
Very easy to use.
-------- -------------------- --------
-------- 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
Make sure your settings allow copying variables (Image)
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...
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..
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.
TriggerHappy said:
"Resources should be unique." There's a difference between being repetitive and offering variety.
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.
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
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.
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?
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.
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 :/
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?
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 .
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 .
In your face Anachron! (no offence)
And yes, i will choose this over the other systems that are not even in this website. (Cause this one is very GUI friendly )
its a nice simple system, though I wont probably use it since I've grown accustomed to another one... and its really useful for those who wants simple code gens...
its inferior to Hanky's in a advanced perspective but there isn't a rule which says that systems inferior to others should be rejected...
triggerhappy i use this system in my orpg (click on sig) i use the prev version and i have to ask: how can i add to the code that the backpack items and hero abilities are saved? i use the backpack as a hero
The system is obviously useful for a certain type of users, and it's a fairly different system from Hanky's. Each have their own strong points and users will pick which they feel works best for them. Stop complaining and trying to start an argument. Oh, and there's a difference between being repetitive and offering variety, so this system complies with all of the site rules.
I won't be replying to anymore of your posts here Anachron, quit spamming my thread.
It worked fine on my ORPG until recently, was it deactivated or something? (How that would affect me, if even possible, makes no sense at all).
Nevertheless, this system is useful and I'm glad it's approved.
Keep up the good work TriggerHappy, however I do have one question. When you say, it saves the player's name, you mean that when I save my hero with the name Vital_Sin, and I try to load the hero with the name Arkon_Kaos, it won't work. Right?
I tested the map, and tried to figure that out, but I couldn't tell if I was typing the code wrong or if it saved to the player name, as the code would dissapear faster than I can type it three times.
Excellent system, and Thanks,
-Arkon Kaos (A.K.A. Vital_Sin)
well to make it ORIGINAL... add in to your code abilities. This can be done the same way as you do items.
A good save/load system contains:
EXP (x)
Items (x)
Gold (x)
Lumber (x)
Abilities (n/a)
Extra Optional Integers (n/a)
Although your system could easily have added the optional integers some people don't quite have the experience in triggers to do so themselves.
But other than that I like how short the code is so you deserve a 4/5 because of how tedious making one of these systems can be, but until there are abilities it wont be a 5/5
Hey first off i want to say thank you alot for this. It works 100%. I just have a request if you do not mind. Is there any way to make the save/load CODE the player uses have a SET length. IE: Make the code LENGTH always 16? Thanks. I give your trigger system a 4/5 for it could use some more features and its not 100% pefect but its usable i use it and i like it personally. Thanks.
You can only hold so much data in every character... For really big games that save EVERYTHING... 16 might not be enough... You might want to take that into consideration and look at what all you're saving.
dude i got a problem
call me a noob, call me an idiot but i don't care just help me
i copy and paste the triggers in my map and when i try to save i get an error
what do i have to do to import the triggers successfully?
i would appreciate any help asap ty ;p
This System works fine and all, very GUI-user friendly (unlike iGen -sigh-)
But there are stil a few things i can't get working.... like saving the amount of charges an item has. a lot of Save/Load systems neglect putting it in the standard triggers =\
At the moment i'm stil trying to fix that but i can't seem to find out what the problem is. if anyone can help me?
This System works fine and all, very GUI-user friendly (unlike iGen -sigh-)
But there are stil a few things i can't get working.... like saving the amount of charges an item has. a lot of Save/Load systems neglect putting it in the standard triggers =\
At the moment i'm stil trying to fix that but i can't seem to find out what the problem is. if anyone can help me?
its not that they forget, its just that they don't really need to... since the things that needs to be saved/loaded should be configured by the user of this system... those save-load triggers are just for examples on how to use the code generator...
Player - Player 1 (Red) types a chat message containing -save as An exact match
Player - Player 2 (Blue) types a chat message containing -save as An exact match
Player - Player 3 (Teal) types a chat message containing -save as An exact match
Player - Player 4 (Purple) types a chat message containing -save as An exact match
Player - Player 5 (Yellow) types a chat message containing -save as An exact match
Player - Player 6 (Orange) types a chat message containing -save as An exact match
Player - Player 7 (Green) types a chat message containing -save as An exact match
Player - Player 8 (Pink) types a chat message containing -save as An exact match
Conditions
Actions
-------- Find the players hero, and save it. I realize it leaks but it's just for demonstration. --------
Set SaveCount = 0
Unit Group - Pick every unit in (Units owned by (Triggering player) matching ((Matching unit) Equal to Player_Hero_Array[(Player number of (Triggering player))])) and do (Set Hero = (Picked unit))
Custom script: set udg_Save[udg_SaveCount] = CodeGen_ConvertUnit(GetUnitTypeId(udg_Hero))
Set SaveCount = (SaveCount + 1)
-------- Save players gold. --------
Set Save[SaveCount] = ((Triggering player) Current gold)
Set SaveCount = (SaveCount + 1)
-------- Save players lumber. --------
Set Save[SaveCount] = ((Triggering player) Current lumber)
Set SaveCount = (SaveCount + 1)
-------- Save heroes EXP. --------
Set Save[SaveCount] = (Hero experience of Hero)
Set SaveCount = (SaveCount + 1)
-------- Save heroes items. --------
Set Save[SaveCount] = (Number of items carried by Hero)
For each (Integer Integer_A_Replacement) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item carried by Hero in slot Integer_A_Replacement)) Not equal to (Item-type of No item)
Then - Actions
Set SaveCount = (SaveCount + 1)
Set Item = (Item carried by Hero in slot Integer_A_Replacement)
Custom script: set udg_Save[udg_SaveCount] = CodeGen_ConvertItem(GetItemTypeId(udg_Item))
Set SaveCount = (SaveCount + 1)
Set Save[SaveCount] = (Charges remaining in (Item carried by Hero in slot Integer_A_Replacement))
Else - Actions
-------- Show Code --------
Custom script: set udg_Code = CodeGen_Compile()
Game - Display to (Player group((Triggering player))) for 60.00 seconds the text: Code
SaveLoad Load
Events
Player - Player 1 (Red) types a chat message containing -load as A substring
Player - Player 2 (Blue) types a chat message containing -load as A substring
Player - Player 3 (Teal) types a chat message containing -load as A substring
Player - Player 4 (Purple) types a chat message containing -load as A substring
Player - Player 5 (Yellow) types a chat message containing -load as A substring
Player - Player 6 (Orange) types a chat message containing -load as A substring
Player - Player 7 (Green) types a chat message containing -load as A substring
Player - Player 8 (Pink) types a chat message containing -load as A substring
Conditions
(Substring((Entered chat string), 1, 6)) Equal to -load
Actions
-------- 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: Invalid code.
Skip remaining actions
Else - Actions
-------- Start loading, load the hero first. --------
Set LoadCount = 0
Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Unit - Remove (Picked unit) from the game)
Unit - Create 1 SaveLoad_Hero[Load[LoadCount]] for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
Set Hero = (Last created unit)
Selection - Select (Last created unit) for (Triggering player)
-------- Now load players gold --------
Set LoadCount = (LoadCount + 1)
Player - Set (Triggering player) Current gold to Load[LoadCount]
-------- Now load players Lumber --------
Set LoadCount = (LoadCount + 1)
Player - Set (Triggering player) Current lumber to Load[LoadCount]
-------- Load heroes EXP --------
Set LoadCount = (LoadCount + 1)
Hero - Set Hero experience to Load[LoadCount], Hide level-up graphics
-------- Now items --------
Set LoadCount = (LoadCount + 1)
For each (Integer Integer_A_Replacement) from 0 to Load[LoadCount], do (Actions)
Loop - Actions
Set LoadCount = (LoadCount + 1)
Hero - Create SaveLoad_Item[Load[LoadCount]] and give it to Hero
Set LoadCount = (LoadCount + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Load[LoadCount] Greater than 0
Then - Actions
Item - Set charges remaining in (Last created item) to Load[LoadCount]
Else - Actions
-When you have 6 different potions with different amounts of charges, it saves/loads perfectly.
-when you have 5 different potions with different amounts of charges and + 1 non-chargable item (its in the 6th slot). only the 5 potions will be saved/loaded
-when you move the non-chargable item to lets say.. the 3rd slot, everything after the 3rd slot wont get saved/loaded.
so yes, i did what you said a long time ago lolz, its just not working.
dude i got a problem
call me a noob, call me an idiot but i don't care just help me
i copy and paste the triggers in my map and when i try to save i get an error
what do i have to do to import the triggers successfully?
i would appreciate any help asap ty ;p
did you read: How to Install
Copy the maps header into your maps (click the CodeGen 0.06.w3x in the trigger editor).
Copy the CodeGen folder into your map.
Make sure "Automatically create unknown variables when pasting trigger data" is checked in your editors preference.
ani666 your problem is that when you put the non charge able item in the 3rd slot it still increases the save count even if the item doesnt have charges and it sets charges still. Hard to judge this on a phone i take a closer look back home but the key to use this system is to save all stuff in the way you load them. So with pots it works as the order is correct, with other items the order fucks up. This might not be the problem but i think it is.
Yeah only for stuff that is useful. If the item doesn't have charges, don't store the charges. I guess you can just check this when you load that if the item is "non-chargeable" you keep the load going. Although I'll see what I can mixture up.
did you read: How to Install
Copy the maps header into your maps (click the CodeGen 0.06.w3x in the trigger editor).
Copy the CodeGen folder into your map.
Make sure "Automatically create unknown variables when pasting trigger data" is checked in your editors preference.
hey dude i noticed something
i saved my hero with a pot of healing that had 12 charges and when i loaded it only had 1
can you pls make it able to also save charges of items?
hey dude i noticed something
i saved my hero with a pot of healing that had 12 charges and when i loaded it only had 1
can you pls make it able to also save charges of items?
hey dude i noticed something
i saved my hero with a pot of healing that had 12 charges and when i loaded it only had 1
can you pls make it able to also save charges of items?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.