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.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      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