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.
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/
  • The Helper The Helper:
    Happy Thursday!
  • Ghan Ghan:
    I'm not so sure, there's still a lot of Thursday left for it to become unhappy.
    +3
  • The Helper The Helper:
    still a few hours
  • The Helper The Helper:
    Its Friday!!!!
    +1
  • Ghan Ghan:
    Thursday 7/10 would Thursday again
    +3

      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