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!
Even before you have any data you want to store, you need to have
AreasPassedTracking = 0 <Integer>
AreasPassedTrackingBank = No Bank <Bank>
Areas Passed Tracking
Events
Game - Map initialization
Local Variables
Conditions
Actions
Bank - Preload and synchronize bank "AreasPassedTracking" for player 1
Bank - Open bank "AreasPassedTracking" for player 1
Variable - Set AreasPassedTrackingBank = (Last opened bank)
Variable - Set AreasPassedTracking = (Load "MyKey" of section "MySection" from bank AreasPassedTrackingBank as integer value)
That is Preload and Open bank for the player or players should be always on some Map Init event. This tells it to load the data that the Bank contains for the player, so that the map can use it. Also, the variable I will further modify always loads the Data of the Bank where I saved such value.
You can pick all players and open bank for (Picked player) but doing so for Preload won't work. Always Preload with a separate action,
Bank - Preload and synchronize bank "AreasPassedTracking" for player 1
Bank - Preload and synchronize bank "AreasPassedTracking" for player 2 etc.
The first time you run the trigger, the Variable will be 0 as there is no bank to take the data from. The next time, it will load the value from the file that saved in your Banks\ folder.
You save information (integers, reals, strings) in specific Sections under specific Keys. Key is just the name of the value (integer, real etc) that you will store, Section is the location or the line within the Bank where the Key will be stored.
These Keys and Sections are created when you decide to save the bank, like I decide to track how many times I restarted the map, so when the map ends - which happens when I enter a region, I give the triggers to save the bank:
Next Area
Events
Unit - Any Unit Enters Next Area
Local Variables
Conditions
Actions
Variable - Modify AreasPassedTracking: + 1
Bank - Store integer AreasPassedTracking as "MyKey" of section "MySection" in bank AreasPassedTrackingBank
Bank - Save bank AreasPassedTrackingBank
Game - End game in Victory for player 1 (Hide dialogs, Hide score screen)
I increase the variable (which is loaded from the bank or zero if for the first time) every time the map ends, then when the map starts, I have already given it to load the info from the Bank and when it ends again it modifies this value further.
I set all under a single Section, with a Key name the same as the Section. If you got more than 1 Section, that is you set different Keys in different sections or the same Key name in different sections you would get, (e.g save Key: Life in Section HeroStats, save Energy in Section HeroStats in TheSameBank)
Avoid using spaces or numbers, non-letter characters when typing the bank name, while you can for Keys and Sections. A bank must be up to 10KB in size, you could make several banks but that would be inefficient for the same map.
When designing your map it is important to factor in players not being the same slot when replaying the map. This is usually designed by decoupling the bank data from the player slot so that every player gets a compatible bank with every slot.
Of course there are situations where you will not want to do this, such as if a slot has unique save behaviour. In this case you should either use a separate bank or different entries to make sure that there will be no incompatibility with the player playing as other slots in a different session.
Just like in war3, I think it's preferable the periodic event isn't used, especially for saving needlessly more times or missing to save if smth happens during the 5 seconds wait. You could run the actions when with a unit dies event.
Yes, wherever within the triggers you have to type as a text, you have to type the Keys, Sections, especially Bank names accurately, just paste the names.
Here is a map I use Pick Each Integer because idk but sometimes unlike war3 where it runs fine, Pick Each Player basically does actions for ONE OF the players picked like wtf??, rather than for every player, and that's why picked players have to be added to a Player Group and rather pick all players from the Player Group (variable) Players work properly... That's why with Pick Each Integer (or For each integer i..) - works better than Pick each player
Do you want the Bank to store info for all players like you and computers - all on the same bank, or do you want for an online map where every player has his own Bank with his own information only? I will assume you use it for online with other bnet players (because it may be a little different for if you are the only User and all other are computers)
On my Wins-Losses map, it does matter if you will play this with others or with computers, or the information of the Bank may mix. Because if it tells a Computer Player to save the Bank for him, it will save on YOUR Computer, at the same time you are the User of your Computer, so it will overwrite the information - that's why with computers you need to save at different sections.
While if you do it with real Players only, it will load the data from everybody's computer and nothing will overlap, so all will be fine.
Here is a map, the Conditions for Player Status is because it would be pointless to display 0 value for players that are not playing at all.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.