• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Save Load Map

Status
Not open for further replies.
Level 8
Joined
Feb 20, 2020
Messages
207
Hello,
Anyone have a save / load code or map with that code implemented that works for MULTIplayer to save MULTIPLE units?
i already tryed codeless save load... its not what i want...
i need something like monster master code...
Thanks
 

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,391
What does saving multiple units mean? Saving their positions? Levels? Please be more specific.

And codeless save and load can save anything you want.

I attached a map that uses the codeless Save and Load system. I modified it to remove most of the unwanted features.

Press Escape to spawn a random unit from either a Footman, Rifleman, or Knight.

Type -save to save these units. Type -load to load these units.

To properly test it out, spawn a bunch of units using Escape and then type -save. Then restart the map and type -load and you'll get the same units from the previous game. This should work on bnet as well.

Note that the Save and Load system can only save/load Integer values, but with clever use of variables/triggers you can save any type of data you want.
 

Attachments

  • Save and Load Example marcos.w3x
    153.5 KB · Views: 109
Last edited:
Level 8
Joined
Feb 20, 2020
Messages
207
well what i need is... save a bunch of heroes (7 heroes in total)
1 hero, exp, 4 items
6 others heroes, exp 2 items each
gold and lumber
dont need to save position of the heroes
because when you load them, 6 will go to a player area (player 1 - area 1) (player 2 - area 2) and so on
and the last thing i need is the code to be saved in the player warcraft folder
also i need the code to work in multiplayer...
Could you help me with that, please?
 

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,391
I hope you can open this map.

I added everything you listed. Although, I only setup the variables for Player 1 and Player 2.

Look through all of my triggers, see what I did for Player 1 and Player 2, and repeat what I was doing but for the rest of the Players.

You'll have to add the other Players to these triggers:
Set TempHeroes Save
Set TempHeroes Load


And you'll have to modify this trigger, adding variables for all of your Hero Unit-Types and Item-Types as well as keeping track of each Player's Heroes (from 1 to 7):
Setup Save Variables

There's instructions in the triggers, hopefully it's not too confusing.

You should definitely try to learn how to use the system yourself. Look at how I save/load Gold and Lumber since those are lot less complicated than the Heroes. You don't need a deep understanding of how it works in order to use it.
 

Attachments

  • Save and Load Example marcos 2.w3x
    159 KB · Views: 111
Last edited:

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,391
Do you want to save each of the Heroes skills? Like Paladin's Holy Light, Divine Shield, Devotion Aura, etc...? Or just a few hidden skills?

Regardless, it can save just about anything since Integers can be used to represent other types of data. Skills are a bit tricky though.

It would work similar to how I was saving Item-Types. You need to store each Skill that you want to save in an Ability Array.

Set Setup_Total_Skills = X
Set Setup_Skill[1] = Attribute Bonus
Set Setup_Skill[2] = ...
etc...

Then save the Number of skills your Hero has, save the Index [] for each of these skills, and save the Level for each of these skills.
 
Level 8
Joined
Feb 20, 2020
Messages
207
Well i want to save 3 hidden attribute bonus level (for str only, agility only and int only), so 3 integers!
Every hero will have the 3, it will work just like the IV from pokemon... its a random number between 1 and 15... basically i save that hidden "level" and load that level, dont need to save the skill...
I will try something that i used in the other save load i was working... and see if it works...
 

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,391
Alright, I fixed it.

I may have undone some of your work (apologies in advance) but you should be able to copy and paste the missing stuff into this new version.

Some fixes:
-I added my PlayerX_Heroes variables to your New Trainer / Buy Monster triggers.
-I added a new variable, Player_TotalHeroes which keeps track of how many Heroes you have.
-This one is IMPORTANT, I edited the Aerial Shackles ability, do NOT change this ability! You can copy and paste it and create new abilities based on it but don't change the original! The Save and Load system uses this ability.

Keep in mind you never added the 3 Starter Monsters to Setup Save Variables. So make sure to add the 3 starters and then you can test it properly.

It will break if you try to Save anything that isn't added to the variables.

Edit:
Uploaded v2. See if this one works.
 

Attachments

  • LegendaryTamer Uncle 2.w3x
    4 MB · Views: 46
Last edited:
Level 8
Joined
Feb 20, 2020
Messages
207
-I added a new variable, Player_TotalHeroes which keeps track of how many Heroes you have.

well i have already a variable to see that... but doesnot mind.

-This one is IMPORTANT, I edited the Aerial Shackles ability, do NOT change this ability! You can copy and paste it and create new abilities based on it but don't change the original! The Save and Load system uses this ability.

humm

Keep in mind you never added the 3 Starter Monsters to Setup Save Variables. So make sure to add the 3 starters and then you can test it properly.

they are all set... :X
 

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,391
-I added a new variable, Player_TotalHeroes which keeps track of how many Heroes you have.

well i have already a variable to see that... but doesnot mind.

-This one is IMPORTANT, I edited the Aerial Shackles ability, do NOT change this ability! You can copy and paste it and create new abilities based on it but don't change the original! The Save and Load system uses this ability.

humm

Keep in mind you never added the 3 Starter Monsters to Setup Save Variables. So make sure to add the 3 starters and then you can test it properly.

they are all set... :X
I don't see their names but maybe I'm just not seeing properly. And unless you edit the system to use YOUR variables you'll have to use the variables I provided, otherwise how will the system know.

Edit: Oh I see now, I was looking for Paladin in the starter name since that's what it says ingame.
 
Level 8
Joined
Feb 20, 2020
Messages
207
  • Setup Save Variables
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Keep track of all of the Heroes --------
      • Set VariableSet Setup_Total_UnitTypes = 42
      • Set VariableSet Setup_UnitType[1] = |cff0000ffAquatic|r / |cff008000Nature|r Coreal
      • Set VariableSet Setup_UnitType[2] = |cff0000ffAquatic|r / |cff008000Nature|r Grejum
      • Set VariableSet Setup_UnitType[3] = |cff0000ffAquatic|r / |cff008000Nature|r Lydreef
      • Set VariableSet Setup_UnitType[4] = |cff0000ffAquatic|r / |cff008000Nature|r Murceres
      • Set VariableSet Setup_UnitType[5] = |cff0000ffAquatic|r / |cffd45e19Beast|r Lobsta
      • Set VariableSet Setup_UnitType[6] = |cff0000ffAquatic|r / |cffd45e19Beast|r Lobstord
      • Set VariableSet Setup_UnitType[7] = |cff0000ffAquatic|r Crabbo
      • Set VariableSet Setup_UnitType[8] = |cff0000ffAquatic|r Cruby
      • Set VariableSet Setup_UnitType[9] = |cff0000ffAquatic|r Froggan
      • Set VariableSet Setup_UnitType[10] = |cff0000ffAquatic|r Froggior
      • Set VariableSet Setup_UnitType[11] = |cff0000ffAquatic|r Froggy
      • Set VariableSet Setup_UnitType[12] = |cff0000ffAquatic|r Golsh
      • Set VariableSet Setup_UnitType[13] = |cff0000ffAquatic|r Kinrub
      • Set VariableSet Setup_UnitType[14] = |cff008000Nature|r / |cff00ffffAir|r Moonfree
      • Set VariableSet Setup_UnitType[15] = |cff008000Nature|r / |cff00ffffAir|r Wespah
      • Set VariableSet Setup_UnitType[16] = |cff008000Nature|r Capod
      • Set VariableSet Setup_UnitType[17] = |cff008000Nature|r Crocun
      • Set VariableSet Setup_UnitType[18] = |cff008000Nature|r Lorvi
      • Set VariableSet Setup_UnitType[19] = |cff008000Nature|r Lurvin
      • Set VariableSet Setup_UnitType[20] = |cff008000Nature|r Trent
      • Set VariableSet Setup_UnitType[21] = |cff008000Nature|r Trentop
      • Set VariableSet Setup_UnitType[22] = |cff008000Nature|r Trentus
      • Set VariableSet Setup_UnitType[23] = |cff008000Nature|r Woonster
      • Set VariableSet Setup_UnitType[24] = |cffff0000Flame|r Anaconas
      • Set VariableSet Setup_UnitType[25] = |cffff0000Flame|r Conas
      • Set VariableSet Setup_UnitType[26] = |cffff0000Flame|r Kenas
      • Set VariableSet Setup_UnitType[27] = |cff00ffffAir|r Brosky
      • Set VariableSet Setup_UnitType[28] = |cff00ffffAir|r Kinsky
      • Set VariableSet Setup_UnitType[29] = |cff00ffffAir|r Resky
      • Set VariableSet Setup_UnitType[30] = |cffff0000Flame|r Peebli
      • Set VariableSet Setup_UnitType[31] = |cffff0000Flame|r Rockli
      • Set VariableSet Setup_UnitType[32] = |cffff0000Flame|r Meteoris
      • Set VariableSet Setup_UnitType[33] = |cff00ffffAir|r / |cff6f2583Shadow|r Batvil
      • Set VariableSet Setup_UnitType[34] = |cff00ffffAir|r / |cff6f2583Shadow|r Gargvil
      • Set VariableSet Setup_UnitType[35] = |cff00ffffAir|r / |cff6f2583Shadow|r Blust
      • Set VariableSet Setup_UnitType[36] = |cff00ffffAir|r / |cff6f2583Shadow|r Spairt
      • Set VariableSet Setup_UnitType[37] = |cff6f2583Shadow|r / |cff00ffffAir|r Jynst
      • Set VariableSet Setup_UnitType[38] = |cff6f2583Shadow|r / |cff00ffffAir|r Spectron
      • Set VariableSet Setup_UnitType[39] = |cffd45e19Beast|r Porcus
      • Set VariableSet Setup_UnitType[40] = |cffd45e19Beast|r Tuskier
      • Set VariableSet Setup_UnitType[41] = |cff00ffffAir|r / |cffd45e19Beast|r Birdra
      • Set VariableSet Setup_UnitType[42] = |cff00ffffAir|r / |cffd45e19Beast|r Garudra
      • -------- --------
      • -------- Keep track of all of the Items --------
      • Set VariableSet Setup_Total_ItemTypes = 29
      • Set VariableSet Setup_ItemType[1] = Claws of Attack
      • Set VariableSet Setup_ItemType[2] = Gauntlets of Strength
      • Set VariableSet Setup_ItemType[3] = Mantle of Intelligence
      • Set VariableSet Setup_ItemType[4] = Old Amulet
      • Set VariableSet Setup_ItemType[5] = Pendant of Energy
      • Set VariableSet Setup_ItemType[6] = Periapt of Vitality
      • Set VariableSet Setup_ItemType[7] = Ring of Protection
      • Set VariableSet Setup_ItemType[8] = Slippers of Agility
      • Set VariableSet Setup_ItemType[9] = Small Ring
      • Set VariableSet Setup_ItemType[10] = Ugly Doll
      • Set VariableSet Setup_ItemType[11] = Wooden Stick
      • Set VariableSet Setup_ItemType[12] = Catchball
      • Set VariableSet Setup_ItemType[13] = Great Catchball
      • Set VariableSet Setup_ItemType[14] = Ultra Catchball
      • Set VariableSet Setup_ItemType[15] = Healing Potion
      • Set VariableSet Setup_ItemType[16] = Greater Healing Potion
      • Set VariableSet Setup_ItemType[17] = Greater Dual Potion
      • Set VariableSet Setup_ItemType[18] = Greater Mana Potion
      • Set VariableSet Setup_ItemType[19] = Mana Potion
      • Set VariableSet Setup_ItemType[20] = Dual Potion
      • Set VariableSet Setup_ItemType[21] = Trainer's Journal
      • Set VariableSet Setup_ItemType[22] = Trainer's Journal
      • Set VariableSet Setup_ItemType[23] = Trainer's Journal
      • Set VariableSet Setup_ItemType[24] = Trainer's Journal
      • Set VariableSet Setup_ItemType[25] = Trainer's Journal
      • Set VariableSet Setup_ItemType[26] = Trainer's Journal
      • Set VariableSet Setup_ItemType[27] = Trainer's Journal
      • Set VariableSet Setup_ItemType[28] = Trainer's Journal
      • Set VariableSet Setup_ItemType[29] = Trainer's Journal
      • -------- --------
      • -------- Keep track of Player 1's 7 Heroes and their Spawn Region --------
      • Set VariableSet Player_Region[1] = Player 1 <gen>
      • -------- --------
      • -------- Keep track of Player 2's 7 Heroes and their Spawn Region --------
      • Set VariableSet Player_Region[2] = Player 4 <gen>
      • -------- --------
      • -------- Keep track of the rest of the Player's Heroes/Regions --------
      • Set VariableSet Setup_Total_HiddenAbilities = 3
      • Set VariableSet Setup_HiddenAbilities[1] = Individual Value (Dexterity)
      • Set VariableSet Setup_HiddenAbilities[2] = Individual Value (Spirit)
      • Set VariableSet Setup_HiddenAbilities[3] = Individual Value (Stamina)
 
Level 8
Joined
Feb 20, 2020
Messages
207
well it loaded other stuff... :X
i will take a look at the triggers and see why its loading the trainer at the "monsters" region
and loaded another monster...
idk why its not working :/
 
Last edited:

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,391
I added Trainer to the variables. Figured you want to load that as well.

You'll have to tweak some of the triggers if you don't want to save the Trainer.

I set it so Trainer is ALWAYS Player_Hero[1] and the Monsters are [2]+

You'll need to remove the Player_Hero stuff from the Trainer trigger and adjust the Player_Hero stuff in the Monster trigger. You should see something like Player_Hero[MonsterCount+1]. Remove the arithmetic (+1) from it.
 
Last edited:

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,391
Try this version (v3).

I removed the Trainer from the saved list of Player_Heroes. Test it out before you try to make any changes just to see if it works first.

I tested it with 3 starters and it saved everything properly.
 

Attachments

  • LegendaryTamer Uncle 3.w3x
    4 MB · Views: 31
Last edited:

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,391
I never tested it on other players, so it's possible that there's some messed up variable for p2. I'll test it out.

Edit:
Tested it in a private game on bnet as Player 2. It saved and loaded the Trent Hero properly.

I'm not sure why it wouldn't work for you o_O Unless you're trying to save stuff that hasn't been added to the variables.
 
Last edited:

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,391
Alright, here's what I added:

-Saves Tamer now (Exp + Items)
-Saves Tamer's Item Charges (Needed for the charges on his items - Not sure if Monsters use Item Charges so I didn't add this feature for them)
-Can only load once a game
-Made sure all Evolve forms were saved to the system and all caught Monsters (Didn't test but it should work)

So as of right now it works.

You can save whenever you want as many times as you want, but you can only load once a game. Players could just load over and over again and generate infinite items so it makes sense to have strict limitations on this.
 

Attachments

  • LegendaryTamer Uncle 4.w3x
    4 MB · Views: 30
Level 8
Joined
Feb 20, 2020
Messages
207
Well the save and load seens to work... but i cant set the monsterlist for the player right...
so i cant summon any monster... :X
need to find where in your trigger it really set the monsters and set that to the monster list like this :


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SaveLoadEvent_Player Equal to Player 3 (Teal)
Then - Actions
Set VariableSet MonsterListPlayer3[Integer] = Temp_Heroes[(Integer A)]
Else - Actions

i did others minor changes to the map too, to fix the load, it was just loading 1 hero, now it is loading everyone alright...
just need to fix the right place to set this condition to summon the monsters and i think we are done!
 

Attachments

  • LegendaryTamer Uncle 4.w3x
    4 MB · Views: 24
Last edited:

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,391
The issue was the Index you were using:
MonsterListPlayer3[Integer]

Integer is equal to a number between 1 and Setup_Total_UnitTypes (42 as of right now)

That's why when I create the Unit i'm creating Setup_UnitType[Integer].

ReverseLoop is the index you wanted to use: MonsterListPlayer3[ReverseLoop]. This is a number between 1 and 6 (total Monsters possible).
 
Last edited:

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,391
Hmm, ran into some bugs after testing.

Edit: Think I found the issue.

Try this version out (v6). I'm not sure if I fixed the bug but it SEEMS to work under the correct conditions. I properly saved and loaded multiple times with 3 Monsters and different sets of Items.
 

Attachments

  • LegendaryTamer Uncle 6.w3x
    4 MB · Views: 32
Last edited:
Level 8
Joined
Feb 20, 2020
Messages
207
Well almost everything working... one last problem when i load and capture a new monster, it replace the last loaded monster... example
i have 4 monsters loaded, if i capture a new one it replace the 4th
so the array monster list counter or something is not counting +1...
 

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,391
Weird, I'm testing it again and have 6 monsters saving and loading properly.

I made a trigger like this:
  • Untitled Trigger 001
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Game - Display to (All players) for 30.00 seconds the text: ============
      • Game - Display to (All players) for 30.00 seconds the text: (Total Monsters: + (String(Player_TotalHeroes[1])))
      • For each (Integer A) from 1 to Player_TotalHeroes[1], do (Actions)
        • Loop - Actions
          • Game - Display to (All players) for 30.00 seconds the text: ((Proper name of Player1_Heroes[(Integer A)]) + ( - Level: + (String((Hero level of Player1_Heroes[(Integer A)])))))
      • Game - Display to (All players) for 30.00 seconds the text: ============
It displays my Total Monsters and the names of Monsters 1 to 6 at all times. Everything seems to be working fine, the variables all change accordingly.

Did you release any of your Monsters? Because that would definitely cause some problems.

For example:
1) You have 6 Monsters and you release Monster[1]
2) MonsterCounter gets reduced from 6 to 5
3) When you capture a new 6th Monster it will be set as Monster[6] REPLACING your previous Monster[6], when you really needed it to replace Monster[1]
 
Last edited:

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,391
Alright, here is version 8. I tested it and it seems to work great. I can't find any bugs but there's bound to be 1 or 2 hidden away somewhere.

What I did:
I went through all of the triggers and cleaned them up.
I removed the majority of the leaks.
I fixed a lot of bugs.
I deleted most of the unused triggers/variables.
I modified the Evolution system to make it cleaner using Arrays.

Note that the Save+Load setup trigger is still missing some Monsters (it only has 42 right now).

Another thing, I recommend adjusting the Experience system to use much smaller numbers.

Right now it takes 200 Exp to get to level 2 but I think it should be more like 20 Exp instead.

This will help prevent you from going over the limit in what you can Save.
 

Attachments

  • LegendaryTamer Uncle 8.w3x
    3.8 MB · Views: 70
Last edited:
Level 8
Joined
Feb 20, 2020
Messages
207
Nice idea, i will do that to readjust the exp table, first need to do the math at excell!!
well i tested and:
- the summon was bugged, i could summon more than 3 monsters...
- it is not returning the monsters (both return skills not working)...
- and when i start a new game the first monster is not set in the variable, the 2nd monster i catched worked fine...
what i did
- started a new game,
- played a little
- loaded my code

i'm looking right now at the code to see if i can fix it.
maybe this is bugging in (Summon monster cancel)

tryed again...
started a new game, and again the summon did not worked...

If - Conditions
MonsterOutsideBall[PN] Less than 3

it shoul be greater or equal to 3 no?
 
Last edited:

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,391
No, it should be less than 3. I think I forgot to add a "Stop" order to the Else, that's what's needed to cancel the ability.

I'll test the return stuff, it was all working last I tried.

Edit: Found the bugs. When typing -new I wasn't resetting any of the important variables like MonsterCount and clearing the MonsterList. This was definitely the problem.

Try this v.9. I'm fairly confident this should work!
 

Attachments

  • LegendaryTamer Uncle 9.w3x
    3.8 MB · Views: 28
Last edited:

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,391
Also, I noticed in your Catch Monster trigger you have this:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • KindofPokeballused Equal to Pokeball
    • Then - Actions
      • Set VariableSet CaptureChanceTotal = (CaptureChanceTotal + 0.15)
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • KindofPokeballused Equal to Greatball
        • Then - Actions
          • Set VariableSet CaptureChanceTotal = (CaptureChanceTotal + 0.21)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • KindofPokeballused Equal to Ultraball
            • Then - Actions
              • Set VariableSet CaptureChanceTotal = (CaptureChanceTotal + 0.28)
            • Else - Actions
But it's not being used since KindofPokeballused is never set nor is Pokeball/Greatball/Ultraball. Do you want me to add this to the system?
 

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,391
Alright, here's v.10. I continued to fix things up.

What I added:
1) You can no longer summon Monsters indoors (I figured since you can't bring them indoors you shouldn't be able to summon them indoors as well).
2) If you try to use an ability like Release Monster, Return All Monsters, Summon Monster, and it fails, the ability doesn't go on cooldown.
3) I made the Catch Monster trigger use the Monster Rarity/Catchball variables that you had. Not sure how this will affect things since it was working without them. You'll probably want to take a hard look at this. Note that I only have the Catchball, Great Catchball, and Ultra Catchball added at the moment.
4) I cleaned up some more leaks and small bugs.

Feel free to change this stuff, it's your map after all! I can revert the changes back for you, of course.

Hopefully everything works and I can leave the rest to you :D
 

Attachments

  • LegendaryTamer Uncle 10.w3x
    3.9 MB · Views: 34
Last edited:
Level 8
Joined
Feb 20, 2020
Messages
207
Hey dude my notebook is back!! sorry for the late answer!
well i tested it and well the load doesnot worked...
the other things seens to work
i had 4 monsters
kenas, redsky, lorvi and a fearven...
when i loaded, i got many items, others monsters... wtf
im taking a look at the code right now..
 

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,391
Alright, I fixed these:
-Fix insect quest
-Fix Release monster
-Glow for monsters
-Add Player leave trigger
-Remove monster dying message

Didn't fix:
fix monster Starting level at graveyard
 

Attachments

  • LegendaryTamer Uncle 12.w3x
    3.9 MB · Views: 70
Status
Not open for further replies.
Top