Save/Load Code

Jonhpath

New Member
Reaction score
2
Effane, can you add a function to your save/load please, i need it realy... and i bet lot of people do also. The function you need to add have to save ability (spell or skill, call it what you wan) that you buy during game. i explain:

When you play, there's a shop with tomes. Tomes give you a spell like blizzard or something but when you use the book, it destroy it (the item) and add the spell to your comand box (where attack, defence, patrol and all theyse things are).

it would by verry nice if you can add it because its now like 3 day am looking for one but... you, aceharth, neostorm, mr.maestro and all other that i tryed, dont work or dont have it.

P.S. Sry for my english...
 

DaChOseNone1

New Member
Reaction score
0
One question

Thanks so much Effane your name is on the credits with huge thanks :D , but one question. How do I configure the save/load trigger to make it save abilities?
 
I

icearrow

Guest
Ya Effane's trigger isn't meant for advanced save/load codes, it is for teaching you how they work and to successfully create them (which is awesome since no other comprehensive save/load tutorials exist). I think Effane's does an excellent job in showing how save/load works the way it does AND demonstrating it. Once you know how it works, all you have to do is encrypt anything else you want into the data.

For me, I simply added something that saves to the users player name in my RPG to prevent code stealing. While I could have never done this before, Effane's tutorial teaches how to encrypt data and then unencrypt it. Once you learn this you can encrypt anything you want.

So my short answer to that question is, you simply have to encrypt the abilities learned (if you dont know how to encrypt look over effane's tutorial again or another one on data encryption). Then that way you can make a trigger as part of your load code that adds abilities.
 

DaChOseNone1

New Member
Reaction score
0
Well yea i know how to put it into the initialization database, but how do I save it? I know that you have to make it search through the abilities with Integer A, but all that other math stuff seems complicated. Do I basically have to do the same thing except make it save the ability? Meaning make a slot variable for abilities (SaveLoadAbilitySlots), and then save it through all that stuff?
 
G

goon94

Guest
More Varriables

Ive been trying to add more integer varriables to your save/load and ive been trying to change everything to fit in. insted of saving 151 strength it saved 10368 and i dont get it! please help me or show me what all i need to do to add more varriables. heres what the outcome looks like:

---


EDIT:
Removed: some insanely long trigger mess.
Nothing can be expected from there.

Fortunately, the problem seems to be solved.
 
G

goon94

Guest
I went wrong!!

i had all the numbers and functions right... but!!! their allignment in the trigger was screwed up!!! thats why i was getting some obseen agi/str/int levels. thank you effane for your code... it tought me alot!
 
P

PeppeJ

Guest
World Editor Disabling your triggers

Hi i did copy your triggers and i checked them they all ware correct it said no errors or anything. But when i want to test them my World Editor Say Error !!
And disable them.....:nuts: WHY ?!?!? I cheked all Variables and even read trough your notes but still it disable them:banghead:
 

Effane

Save/Load Code Tutorial
Reaction score
51
Did you use the automatic variable creation?

Somethings were disabled in the code from the beginning though, like the in game messages that were used for debugging. If the entire code is disabled then I suspect you have some other issue. Try bringing it over again into your map.
 
F

Flame_Emblem

Guest
So Im Guessing Theres No Way That Can Simply Be Put In a Map For Most Anyone To Understand With Directions On How To Modify It For Rpg Maps Purposes On Saving-Loading Characters Items And Money :banghead:
Why Cant I Find Something Similiar To MasterCrafters Save-Load But with Gold and Lumber!I know why Because I Cant Understand This!I found a Tutorial which i understand but it is for saving and loading while in game and not to start wherer you left off on a rpg :(
 

muddy19

New Member
Reaction score
1
(null)

Can someone help me. When i try to save in my map it sais (null). It hates me. Can someone help?:banghead:
 
Z

Zaifix

Guest
Wow?! :s

i cant understand all that text..:eek: do you got a Tuturial game you could send me?:confused: cause im making an RPG... and i really need a save/load code..:D plzz write back. if you want you can email me at [email protected]
15 hours! long time!! still dont get how peaple can get the idea of creating things like that :banghead:
 
M

MicroXen

Guest
When i save a hero i get a bunch of 00's on the side and 3 36 long codes for my hero. And the load code wont work.
 

Tiber

Member
Reaction score
4
I'm trying to learn this system for an upcoming ORPG. While reading I noticed an error.

During the second part, at "4. Setting up a Save Code Trigger", you mentioned a variable, "SaveLoadPlayerHeroSingle", which is a Unit-Type variable I'm guessing. You didn't mention it in the first part and it needs to be declared, and I don't know where.

Also, you should have declared all variables before starting the trigger, a list of all the variables we are using. An explanation of every variable would be great too. I'm having a slightly hard time figuring out what type of variable is each.

Needs a wee bit polishing, but otherwise your guide has been very helpful.
 

1337moo

New Member
Reaction score
0
Variables

Yo, for the list of variables, you should point out that the variable array called "SaveLoadHeroesStored" is a Unit-Type array and not a Unit array. :p The way the list sets it up is confusing. NOW TIME TO ACTUALLY LOOK INTO THE TUTORIAL IN-DEPTH! :V

EDIT: The variable for SaveLoadItemsStored is also missing.

EDIT 2: If you were to make a game that has more than four people, I would think variables that are arrays are the only ones you would change, correct? That would be these:

-String types: SaveLoadCharacterNumbers[100], SaveLoadEncryptionNumbers[100], SaveLoadEncryptionSet[10], SaveLoadTempStrings[100]
-Integer Type: SaveLoadVariablesStored[24]
-Unit Types: SaveLoadHeroesStored[100], SaveLoadHeroSingle[4]
-Region Type: Regions[9]
-Boolean Type: SaveLoadHasLoaded[4]

Of them, you would only need to change SaveLoadHeroSingle and SaveLoadHasLoaded to the number of players, right? Just a check.

EDIT 3: Wow, so many edits. Anyways, I was wondering that if you simply changed the placement of the variables in SaveLoadVariablesStored, would it be enough to re-arrange the code?

Also, what's the purpose of the Regions variable?

EDIT 4: Okay, everytime I load, nothing happens. >_>
 
H

Helium6234

Guest
Im using this trigger in my map, and its working great, thanks alot Effane. Im wondering about something tho. Im not really that good at this save/load triggers yet and i want to add to my map that it saves the hero's abilities aswell. Each ability has 3 levels and i would like to it save it so, that when u load u, for an example have (x) in lvl 3 and (y) in lvl 2. Can anyone experienced help me on how to get it in with the triggers Effane made? I appreciate any help.
 
G

Googlieeyes

Guest
Sorry for the few day responce. I dont work in the same town as my wife and son live in, I take off weekends for time with them and I dont touch the computer during that.

-------------------------------------------------------------

Okay, going to add this to the FAQs, but I will explain it here. Alot of people are stuck on this one thing, and I assumed it was obvious. When you get that many PMs, its definetly not obvious. :p

Code:
CreateSingleStuff
    Events
        Player - Player 1 (Red) types a chat message containing -Random as An exact match
        Player - Player 2 (Blue) types a chat message containing -Random as An exact match
        Player - Player 3 (Teal) types a chat message containing -Random as An exact match
        Player - Player 4 (Purple) types a chat message containing -Random as An exact match
    Conditions
    Actions
        Set SaveLoadHasLoaded[(Player number of (Triggering player))] = True
        Unit - Create 1 SaveLoadHeroesStored[(Random integer number between 1 and SaveLoadMaxHeroesStored)] for (Triggering player) at (Center of Regions[(Random integer number between 1 and 9)]) facing Default building facing degrees
        Set SaveLoadPlayerHeroSingle[(Player number of (Triggering player))] = (Last created unit)
        Hero - Set SaveLoadPlayerHeroSingle[(Player number of (Triggering player))] Hero-level to (Random integer number between 1 and 10), Hide level-up graphics
        Set IntegerC = (Random integer number between 2 and 6)
        For each (Integer A) from 1 to IntegerC, do (Actions)
            Loop - Actions
                Hero - Create SaveLoadItemsStored[(Random integer number between 1 and SaveLoadMaxItemsStored)] and give it to SaveLoadPlayerHeroSingle[(Player number of (Triggering player))]
        Player - Set (Triggering player) Current gold to (Random integer number between 100000 and 1000000)
        Player - Set (Triggering player) Current lumber to (Random integer number between 100000 and 1000000)

This is a code example from the Demo Map. Now, here is how the map "Remembers" which player has which hero. Tracking variables are very powerful and I recommend everyone use them. They also kill leaks. This following section is the heart of this problem.

Code:
Set SaveLoadHasLoaded[(Player number of (Triggering player))] = True
        Unit - Create 1 SaveLoadHeroesStored[(Random integer number between 1 and SaveLoadMaxHeroesStored)] for (Triggering player) at (Center of Regions[(Random integer number between 1 and 9)]) facing Default building facing degrees
        Set SaveLoadPlayerHeroSingle[(Player number of (Triggering player))] = (Last created unit)

Whats happening here is first it sets the SaveLoadHasLoaded, this is to stop people from loading over and over, that would be bad. Then you are creating a hero. That we all should have mastered by now, if your map starts with a hero on it, then instead assign all player heroes to a tempUnitGroup and then use pick all in group and perform multiple actions.

Now, each hero needs to be put into another variable to track them. This is a powerful and fast way to get them without any craziness later.

Notice the following.
Code:
        Set SaveLoadPlayerHeroSingle[(Player number of (Triggering player))] = (Last created unit)

This basically grabs the last created unit, the hero. And then finds out what hero it is and assigns that hero to a unit array with the index (spot its stored in) as the player number.

Then to retrieve that hero all you do is access the Array with the player number and viola, you got your hero without using pick/unitgroups and all the leaks/processor cycles.


So to wrap this up, make sure you assign any heroes created to the correct array slot, that shoudl fix most of your issues with the 3-AAAA... ... ...

-------------------------------------------------------------------

Now the issue with getting 3-AAAA-AAAA-AAAA-AAAA-AAAJ-AAAH-T or something like that. Its an easy answer and its not a terribly unsecure result.
The first set of 4 chars is the hero level and hero type. You will need to refer to above answer for that fix.


The 3 middle sets of 4 chars are the items slots. The above issue will cause this, or you probly dont have anything in them at the time of saving. Looking at your result I suspect its the first problem.

Now if its the empty item slot issue, then thats normal results. They are just encrypted versions of the number 0. Now this isnt a encryption security issue for the most part. Why? Because we dont really care if they can make 0s, they still will not know how to create items, and also they still have to get around the checksum. Both will be a total nightmare for the novice to crack from the outside.

i've tired this and i don't understand where i need to add
Code:
Set SaveLoadHasLoaded[(Player number of (Triggering player))] = True
        Unit - Create 1 SaveLoadHeroesStored[(Random integer number between 1 and SaveLoadMaxHeroesStored)] for (Triggering player) at (Center of Regions[(Random integer number between 1 and 9)]) facing Default building facing degrees
        Set SaveLoadPlayerHeroSingle[(Player number of (Triggering player))] = (Last created unit)
into or which trigger to make it with and besides that i love this save/load it's really nice and my heros are from a tavern with a trigger making them go to th center of region (1) yeah could use som help
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top