Save/Load Code, Yet Another

Oh I see it.. Sorry.. I didn't know! Thanks for posting this and helping me countless times! (Your a bloody legend :D)
 
Probably been asked this but how do I save the hero and another unit *IN this case a mount/unit that can carry your hero*
 
This has been asked before, and the reply is still the same.
There's an example trigger that saves several Heroes if you have them.
Change the units that are picked to include your "mount".
 
With your Save Load Code its not sAVing items. its only saving one of the items out of the 6 or how ever many i have.

i tried recopying the code into my map from your demo and the one i copied into my map the 2nd time did the same thing?
 
Warcraft 3 has very limited processing power.

The characters being displayed aren't the problem. It's the calculator being used. At one point, the numbers go beyond the maximum, the loops go beyond the maximum, etc. In truth, it wouldn't crash warcraft 3, but Blizzard supports stability, so in order to stop something that might prove a tiny bit unstable, Warcraft 3 just stops processing the commands all together. This is why your save/load codes won't appear.

Now, what Acehart said was a good idea if you are trying to get around the calculator issue, however.. you need to give the processor a break. It's like running thru 5000 loops. Do you think warcraft 3 will actually run thru all 5000???

Probably not... unless you pause it at some point and give it a break.

What I suggest:
Save portion by portion, maybe even show what's being saved and the %. Store all of the information. When your done saving one chunk, pause, then start the next chunk. When it's all saved, show the code to the player. That will work.

For example:
Now Saving Heroes
Now Saving Items
Now Saving Gold and Lumber

As long as you have MPI (multi-player instance), it should work fine.

You can't go beyond the processing power of what you are using ; )

hope this helps

To jake
Jake, are you sure you are using a loop to save all of the items? If you only save the item in slot 1, it will only save the item in slot 1
You need to do something like a for loop for each slot the hero has from 1 to the maxmum slot. Save the item in slot x, then go on. It sounds like you're just saving the first item ;P


-nes
 
> your Save Load Code is not saving items

In the unlikely event that your item list would be, let's say, over 30, put the 30 most used ones, and forget the others.
They will be saved regardless of being in the list or not.
You'll get a code with a couple extra characters, but it will work.

If that wouldn't be it:
"It doesn't work" is not a very good problem description.
 
I never touched the item part of the save load it says sometine like Saving all items in Integer A . but when i load it only gives me 1 item. i also imported it again into my map without changing anything and even changed the custom script back and it still was only saving 1 item.
 
Warcraft 3 has very limited processing power.

The characters being displayed aren't the problem. It's the calculator being used. At one point, the numbers go beyond the maximum, the loops go beyond the maximum, etc. In truth, it wouldn't crash warcraft 3, but Blizzard supports stability, so in order to stop something that might prove a tiny bit unstable, Warcraft 3 just stops processing the commands all together. This is why your save/load codes won't appear.

Now, what Acehart said was a good idea if you are trying to get around the calculator issue, however.. you need to give the processor a break. It's like running thru 5000 loops. Do you think warcraft 3 will actually run thru all 5000???

Probably not... unless you pause it at some point and give it a break.

What I suggest:
Save portion by portion, maybe even show what's being saved and the %. Store all of the information. When your done saving one chunk, pause, then start the next chunk. When it's all saved, show the code to the player. That will work.

For example:
Now Saving Heroes
Now Saving Items
Now Saving Gold and Lumber

As long as you have MPI (multi-player instance), it should work fine.

You can't go beyond the processing power of what you are using ; )

hope this helps

I assume this was directed at my question.
I thank you for the detailed answer as well, but I don't have much experience with save/load systems. Is there any specific function you would reccomend for "pausing" inbetween the chunks of information I'd be saving?
 
Creating a simple timer to pause the trigger would do the trick, or maybe creating your own unique pauser function. It would be best to mask this as something such as what I said above:
Saving items
Saving hero

etc etc

=)

So, a simple timer would do the trick.

Just pause between each hero

Hopefully this helps =)
 
I changed the triggers a little so that it supopsed to save integers instead of heroes/items and spells. here's how the triggers look.,

Code:
SaveLoad Initialization
    Events
        Map initialization
    Conditions
    Actions
        -------- List of Scores --------
        Set PlayerScore[1] = 0
        Set PlayerScore[2] = 0
        Set PlayerScore[3] = 0
        Set PlayerScore[4] = 0
        Set PlayerScore[5] = 0
        Set PlayerScore[6] = 0
        Set PlayerScore[7] = 0
        Set PlayerScore[8] = 0
        Set PlayerScore[9] = 0
        Set PlayerScore[10] = 0
        Set PlayerScore[11] = 0
        Set PlayerScore[12] = 0
        -------- Number of PlayersScores --------
        Set SaveLoad_LastIndex = 12
        -------- These three lines may be changed if needed --------
        Set Saveload_Alphabet = abcdefghijklmnopqrstuvwxyz1234567890?!@$%^&*()<>[]
        Set SaveLoad_CaseSensitive = False
        Set SaveLoad_UsePlayerName = True
        -------- Required: false --------
        Set SaveLoad_Initialized = False
        -------- Leave as is. Used to autocreate variables when copy & pasting to a new map --------
        Set Code = AceHart
        Set Save[1] = 0
        Set SaveCount = 1
        Set Validate = False
        Set SaveLoad_Compress[1] = 0
        Set SaveLoad_Uncompress[1] = 0

Code:
SaveLoad Save
    Events
        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
    Conditions
    Actions
        -------- Those values need saving --------
        Set Save[1] = PlayerScore[1]
        Set Save[2] = PlayerScore[2]
        Set Save[3] = PlayerScore[3]
        Set Save[4] = PlayerScore[4]
        Set Save[5] = PlayerScore[5]
        Set Save[6] = PlayerScore[6]
        Set Save[7] = PlayerScore[7]
        Set Save[8] = PlayerScore[8]
        Set Save[9] = PlayerScore[9]
        Set Save[10] = PlayerScore[10]
        Set Save[11] = PlayerScore[11]
        Set Save[12] = PlayerScore[12]
        -------- The number of values we have --------
        Set SaveCount = 12
        -------- Turn values into code --------
        Custom script:   set udg_Code = SaveLoad_Encode()
        -------- Show code to player --------
        Quest - Display to (Player group((Triggering player))) the Secret message: Your code:
        Game - Display to (Player group((Triggering player))) for 900.00 seconds the text: Code
        Game - Display to (Player group((Triggering player))) for 900.00 seconds the text: Tip: Write down or ...

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
    Conditions
        (Substring((Entered chat string), 1, 6)) Equal to (Matched chat string)
        (Length of (Entered chat string)) Greater than 6
    Actions
        -------- Try to decode what was typed --------
        Set Code = (Substring((Entered chat string), 7, (Length of (Entered chat string))))
        Custom script:   set udg_Validate = SaveLoad_Decode( udg_Code )
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Validate Equal to True
            Then - Actions
                -------- It worked, let's do something with it --------
                For each (Integer A) from 1 to SaveCount, do (Actions)
                    Loop - Actions
                        Game - Display to (Player group((Triggering player))) the text: (Decode:  + (String(Save[(Integer A)])))
            Else - Actions
                -------- Invalid code --------
                Game - Display to (Player group((Triggering player))) the text: Invalid Code

and i copied the custom script thingwhere you click on the map name in the trigger editor in the same place in my map,

it basicly, whenever i save, (the map), it saves the map, but it gives me lots of compile errors, and when i try to test, it just goes to the main menu, and i cant enable the triggers...so, what did i do that messed it up?
 
> some example?

yeah, so theres 260 and here's one on 142 (expected a name)

Code:
        exitwhen i > udg_SaveLoad_Heroes_LastIndex

145 (Expected 'endloop')
Code:
        endif

156 (Expected 'endif')
Code:
    endif

it doesnt highlight anything for 159, but it says need return value in function

161 (Expected end of line)
Code:
    local integer i = 0

194 (Expected a variable name)
Code:
        set i = i + 1

and i copied all the custom script
thats just some of the 260 errors, one of each diffrent type that i got
i don't really no what those errors are talkinga bout

what happen ?
 
Ah... yes. Of course.

There's a reason why the "Initialization" trigger, even in the "Basic" category, has those Hero and Item variables... it's because they are expected to be there.


Open the save / load map, take one of the "init" triggers, rename it to something you're sure not to have in your map,
copy & paste it into your map to create all variables.
Remove the trigger...

Alternatively, create the Heroes and Items variables by hand... (copy&paste is easier. And faster)
 
On my map i figured out how to make it save integers.
Actions
-------- Prepare the save array with this player's Hero --------
Set SaveCount = 0
Set SaveCount = (SaveCount + 1)
Set Save[SaveCount] = PlayerXPshow[(Player number of
(Triggering player))]
-------- Turn values into code --------
Custom script: set udg_Code = SaveLoad_Encode()
-------- Show code to player --------
Quest - Display to (Player group((Triggering player))) the Secret message: Your code:
Game - Display to (Player group((Triggering player))) for 60.00 seconds the text: Code


idk if thats helpful but i didnt put it in initlization or anything.

Then Load
Actions:
-------- Try to decode what was typed --------
Set Code = (Substring((Entered chat string), 7, (Length of (Entered chat string))))
Custom script: set udg_Validate = SaveLoad_Decode( udg_Code )
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Validate Equal to False
Then - Actions
-------- Invalid code --------
Game - Display to (Player group((Triggering player))) the text: There's some error ...
Skip remaining actions
Else - Actions
-------- It worked, let's do something with it --------
-------- Load EXP --------
Set SaveCount = 0
Set SaveCount = (SaveCount + 1)
Set PlayerXPshow[(Player number of (Triggering player))] = Save[SaveCount]


my variable was a integer - Array
 
Can I set:
Code:
For Each Integer A from 1-100 do Actions:
Set Save [Integer A] to Ability [Integer A]
Set Save [Integer A + 100] to Level of Ability [Integer A]

And that is ALL I have to do? Nothing else?
 
> Set Save [Integer A + 100]

This would mean to save more than 100 values... which is 1. impossible, 2. would give an insanely long code.
Have a look at the example...
 
Help Please:(

Eerm, may i ask how do you modify the trigger so that a player is only allowed to load his/her character twice? Thanks in advance.
 
Add something like this to the beginning of the "load" trigger:

Set TempInteger = Player number of (Triggering player)
If LoadCount[TempInteger] greater than or equal to 2
- Game - Display to (Player goup (Triggering player)): Sorry, too many loads.
- Skip remaining actions
Set LoadCount[TempInteger] = LoadCount[TempInteger] + 1


With "LoadCount" being a variable of type "Integer", with a check in "array" and a size of 12.
 
None of the custom scripts are working.

I only took Save Load Hero with Items.

Just wondering if i needed any other ones?
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    A probate is usually done with a will, yes? If so I am sorry for your loss
    +1
  • The Helper The Helper:
    Yeah Tom, me too sorry for your loss buddy my mom told me she finds out her olds friend died from Google searching them. She had not talked to one of her old friends in a year and found out she died from Google. Also another one in the same session. RIP all of them my sincere condolences Tom
    +1
  • Varine Varine:
    We have some elderly guests that regularly come hang out at the bar at the end of the night, and every once in a while we don't see someone for a few weeks and then someone shows up with their obituary.
  • Varine Varine:
    We usually let them do their memorials there in the morning if they want to and I'll make them some snacks and drinks. There was one guy named Tom that came in like every night and would sit by himself and get a bunch of soup and a glass of wine. idk why but he LOVED our fucking soup, like he would order a fucking quart of it at a time and would always get so sad when we stop doing it for the summer.
    +1
  • Varine Varine:
    But he also loved our calamari, which is another thing I hate but it sells super well so I can't change it. There was one day he came in and was asking me how to make it, because he tried to at home once in the off season when we stop running it and he really wanted it lol
  • Varine Varine:
    I think he's one of the only people I've made recipes for for free because he really wanted a broccoli cheddar, and it was like dude I don't have a recipe, it's just whatever I have, but here, this is how you do it
  • Varine Varine:
    I don't think he ever figured out how to do the calamari in a pan though, like idk how to do that either. He was afraid of the at home deep fryers though and it's like yeah, that's fair, I am too
  • Varine Varine:
    He was just such a sweet old man, we had two servers pregnant and they held a baby shower together, he was soooooo fucking excited to get to see a baby. Unfortunately he died a month or so before they were born
  • The Helper The Helper:
    So I decided to Google some people that I had not seen or heard from in a while and sure enough one of my old best friends, we had a falling out years ago but whatever, find out he died of Pancreatic Cancer in January. I have also lost a few of my closer acquaintances from growing up the last year. Getting old - people die - I kinda thought it was going to be this way a few years ago....
    +2
  • The Helper The Helper:
    Forum running super slow again
  • Ghan Ghan:
    Not really clear from the stats as to what is causing the slowness.
  • Ghan Ghan:
    We get a lot of guest traffic so it may just be the load is getting too high and not from any particular source.
  • Ghan Ghan:
    Looks like the server is maxed out on CPU.
  • Ghan Ghan:
    Oh it looks like a lot of the traffic is Silkroad Forums. That domain isn't protected by Cloudflare.
  • Ghan Ghan:
    But the old Silkroad site is still on its own server. I just had a test site set up on this server for it.
  • Ghan Ghan:
    I just disabled that test site. Let's see if that helps the load.
  • Ghan Ghan:
    Looks much better already.
  • The Helper The Helper:
    I had actually forgot about the Silkroad site. I had asked
  • The Helper The Helper:
    SD Ryoko about it and he said the couple of people left on there really like it, that was a few years ago, maybe I should check back
  • jonas jonas:
    I guess when you're getting old, and the last day of soup season draws near, you start wondering
  • jonas jonas:
    will I make it to the start of the next season? or was this the last time I'll ever have my favorite dish?
  • The Helper The Helper:
    I am doing my first Vibe Coding project. In installed the environment and tools according to instructions but it is all chat doing this for me at my direction. It is fun really and holy shit I might finish in 2 hours what it would have taken a day to in my Access and this would be an electron app complete new
  • Ghan Ghan:
    Good stuff.
  • Ghan Ghan:
    Just make sure it is secure. :)
  • The Helper The Helper:
    It will only be on internal network

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials
      Top