To start off, Im a new mapper, and started getting into this since the release of SC2. That being said, I have probably logged over 100 hours in the map editor, and close to that much watching tutorials, skimming the web and damn near any other way to find out how to do this stuff. Here is my problem.
Banks - I have been researching these for 3 days now, and so far the only source for a how to is the youtube vid made by Galaxyeditortutorial. I don't know if anyone new to mapping has watched this but its probably the most complex thing on earth (couldn't follow it the second time through, and wasn't any closer). My map is getting to the final stages of development, and I'm to the point where i need to understand how to save data and recall it for 4 players. Trying to apply this video to that situation had been frustrating to say the least. I have a few questions, if someone has the time.
1. The info i found out was MONTHS old, is the 80 total variable limit on saves still in effect? If this is true how wold someone recommend me saving data for 4 possible heroes for 4 possible players. If my math is right, this means i can only save 5 variables per hero, per player, per save data. (4 players, 20 variables each, spread across 4 heroes, 5 blocks per hero).
2. If, for instance, i were to save data for a hero, in a multiplayer setting, and the variables were level and money (i figure if i can learn 2, i can make the link to doing more). Could someone suggest an init setup, load setup, and save setup for these variables?
I understand this might be a dull request for the mappers that get this, but please believe that I'm not a moron or anything, I've actually put together a very nice game with some very cool features relying almost entirely on learning the editor from tutorials. I'm just at the point where i cant delay building a save game system anymore, and the resources on the web have been less that helpful for me. Thanks in advance.
Basically first you have to preload all banks for all players. This is essential to do when you try to use bank in multiplayer.
After that I open the banks for the different players and store them in a variable for easy access.
The last part is an example of retrieving information from the bank. In this case some random integer value.
And this is how the storing and saving looks like: http://img197.imageshack.us/i/unbenanntvei.png/
The first lines saves some integer.
The second part saves the banks. You only need to do this at the end of the map, not everytime you change something in a bank.
The 80-variable limit is still sort-of in place. However, the limit different extremely depending on what variables you store in there. All in all it's most efficient to save Strings instead of integers.
There is a library which you can use to turn all of your integers into one string. Then you can save this string and extract all information out of it again: http://forums.sc2mapster.com/development/galaxy-scripting-and-trigger-lib/5091-library-starcode-v1-2/
I'd advice you to use it if you think that you could hit the variable limit otherwise.
If you have problems with anything in particular (like the idea of having keys and sections or the storing of data in banks) then ask away.
OK, Round one... Heres where i am so far. Your pictures were very helpful. Map initialized, all players preload their data, then one at a time they open the data and save it to their playing game variables. From here the game can refrence the save slots (IE saving variable GOLD from Bank slot [2] that i designated as GOLD in my variable map. I also understand i have to pull that data out of the Bank block using the correct Key and String right? IE when putting the data in to be saved (As if the player were done for the day) it looks like this
Bank - Store Integer (variable for gold) as GOLD in section MONEY in bank P1
Bank - Save Bank P1
<<Question - Doesnt this file need to be a generic file for all player (IE MAIN Bank file). My reasoning here was that If player 1 saves his game to P1, and tomorrow plays in player slot P2, his P2 Variables would not be his P1. Thats why i was thinking this had to be something like this when saving and quitting
Bank - Store Integer (variable for gold) as GOLD in section MONEY in bank MAIN
Bank - Save Bank MAIN
and to pull this integer out of here for use in the game i do something like this:
Open Bank Main for Player 1
Variable - Set GOLD = (Load GOLD in section MONEY from MAIN)
Hmmm, gonna stop there, cause i think im off the reservation. Also i read your post you linked about the SC2 Data Library program (which btw is very sexy). First off, i have no idea how to integrate a .lib file into my map (and didnt see that explained in the comments or tutorial info). I like the idea of taking all of my needed save variables and saving them all to one long string, this way i could have one string for Player 1 Hero 1, one for Player 1 Hero 2, and so on for 4 players with 4 heroes. What i cant wrap my head around is how a string of integers can be unpacked and loaded into about a dozen different variables. Is this something your .lib file does for it? Thanks for bearing with me, i feel one step closer to understanding how this all works.
If player 1 saves his gold in P1, then starts playing another game and becomes player 2, then his bank will be loaded as P2. So there's no problem.
Is it that what you mean?
Remember that every player needs his own bank. I see you using a bank called MAIN which looks a little bit as if you're trying to use one big bank for every player..
About the Library:
To import a library into your map you need to open the trigger editor. Then click on Data->Library->Import Library.
Alternatively you could right-click on the window section in the upper left corner of the trigger editor that has the libraries "Built-In" and "Liberty" in it.
Anyway, after you import the library it'll show up in the upper left part of your trigger editor. You can also use and access all the Library's actions by just searching for them in the list of actions (they all begin with "<STARCODE>").
And yea, the Library takes over the task of mashing all your integers into one long string and turning them back into integers again. You can look at the example map provided in the topic. It contains two example triggers (without the part about saving the string in banks, however).
If player 1 saves his gold in P1, then starts playing another game and becomes player 2, then his bank will be loaded as P2. So there's no problem.
Is it that what you mean?
Actually I believe coronbale is correct in this case.
Right now he is storing Player 1's data in a bank named "P1", player 2's in a bank named "P2", etc.
This means that if, for instance, next game the person that was Player 1 switches to Player 2, it will now attempt to load bank P2 for him, which *does not exist* (his data was saved in P1), and his save data will not be loaded.
He should be using the same bank name for all players, no matter what player # they are.
Along the same lines... would someone mind explaining the point of bank sections.
From what I have gathered from looking at the script it is just partitioning of information. I'm trying to grasp the advantage of this compared to just making different banks. Especially since it seems there are banks size limitations. Wouldn't it be better to just make more banks and comment their purpose than to try to divide up an already restrained data container?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
To start off, Im a new mapper, and started getting into this since the release of SC2. That being said, I have probably logged over 100 hours in the map editor, and close to that much watching tutorials, skimming the web and damn near any other way to find out how to do this stuff. Here is my problem.
Banks - I have been researching these for 3 days now, and so far the only source for a how to is the youtube vid made by Galaxyeditortutorial. I don't know if anyone new to mapping has watched this but its probably the most complex thing on earth (couldn't follow it the second time through, and wasn't any closer). My map is getting to the final stages of development, and I'm to the point where i need to understand how to save data and recall it for 4 players. Trying to apply this video to that situation had been frustrating to say the least. I have a few questions, if someone has the time.
1. The info i found out was MONTHS old, is the 80 total variable limit on saves still in effect? If this is true how wold someone recommend me saving data for 4 possible heroes for 4 possible players. If my math is right, this means i can only save 5 variables per hero, per player, per save data. (4 players, 20 variables each, spread across 4 heroes, 5 blocks per hero).
2. If, for instance, i were to save data for a hero, in a multiplayer setting, and the variables were level and money (i figure if i can learn 2, i can make the link to doing more). Could someone suggest an init setup, load setup, and save setup for these variables?
I understand this might be a dull request for the mappers that get this, but please believe that I'm not a moron or anything, I've actually put together a very nice game with some very cool features relying almost entirely on learning the editor from tutorials. I'm just at the point where i cant delay building a save game system anymore, and the resources on the web have been less that helpful for me. Thanks in advance.
The init and load setup should look about like that: http://img440.imageshack.us/i/unbenanntjz.png/
Basically first you have to preload all banks for all players. This is essential to do when you try to use bank in multiplayer.
After that I open the banks for the different players and store them in a variable for easy access.
The last part is an example of retrieving information from the bank. In this case some random integer value.
And this is how the storing and saving looks like: http://img197.imageshack.us/i/unbenanntvei.png/
The first lines saves some integer.
The second part saves the banks. You only need to do this at the end of the map, not everytime you change something in a bank.
The 80-variable limit is still sort-of in place. However, the limit different extremely depending on what variables you store in there. All in all it's most efficient to save Strings instead of integers.
There is a library which you can use to turn all of your integers into one string. Then you can save this string and extract all information out of it again: http://forums.sc2mapster.com/development/galaxy-scripting-and-trigger-lib/5091-library-starcode-v1-2/
I'd advice you to use it if you think that you could hit the variable limit otherwise.
If you have problems with anything in particular (like the idea of having keys and sections or the storing of data in banks) then ask away.
@s3rius: Go
Thanks so much for the response. Im going to get started on this immediately, and Ill get back on here and post if I running into problems.
@s3rius: Go
OK, Round one... Heres where i am so far. Your pictures were very helpful. Map initialized, all players preload their data, then one at a time they open the data and save it to their playing game variables. From here the game can refrence the save slots (IE saving variable GOLD from Bank slot [2] that i designated as GOLD in my variable map. I also understand i have to pull that data out of the Bank block using the correct Key and String right? IE when putting the data in to be saved (As if the player were done for the day) it looks like this
Bank - Store Integer (variable for gold) as GOLD in section MONEY in bank P1 Bank - Save Bank P1
<<Question - Doesnt this file need to be a generic file for all player (IE MAIN Bank file). My reasoning here was that If player 1 saves his game to P1, and tomorrow plays in player slot P2, his P2 Variables would not be his P1. Thats why i was thinking this had to be something like this when saving and quitting
Bank - Store Integer (variable for gold) as GOLD in section MONEY in bank MAIN Bank - Save Bank MAIN
and to pull this integer out of here for use in the game i do something like this:
Open Bank Main for Player 1 Variable - Set GOLD = (Load GOLD in section MONEY from MAIN)
Hmmm, gonna stop there, cause i think im off the reservation. Also i read your post you linked about the SC2 Data Library program (which btw is very sexy). First off, i have no idea how to integrate a .lib file into my map (and didnt see that explained in the comments or tutorial info). I like the idea of taking all of my needed save variables and saving them all to one long string, this way i could have one string for Player 1 Hero 1, one for Player 1 Hero 2, and so on for 4 players with 4 heroes. What i cant wrap my head around is how a string of integers can be unpacked and loaded into about a dozen different variables. Is this something your .lib file does for it? Thanks for bearing with me, i feel one step closer to understanding how this all works.
@coronbale: Go
If player 1 saves his gold in P1, then starts playing another game and becomes player 2, then his bank will be loaded as P2. So there's no problem.
Is it that what you mean?
Remember that every player needs his own bank. I see you using a bank called MAIN which looks a little bit as if you're trying to use one big bank for every player..
About the Library:
To import a library into your map you need to open the trigger editor. Then click on Data->Library->Import Library.
Alternatively you could right-click on the window section in the upper left corner of the trigger editor that has the libraries "Built-In" and "Liberty" in it.
Anyway, after you import the library it'll show up in the upper left part of your trigger editor. You can also use and access all the Library's actions by just searching for them in the list of actions (they all begin with "<STARCODE>").
And yea, the Library takes over the task of mashing all your integers into one long string and turning them back into integers again. You can look at the example map provided in the topic. It contains two example triggers (without the part about saving the string in banks, however).
Actually I believe coronbale is correct in this case.
Right now he is storing Player 1's data in a bank named "P1", player 2's in a bank named "P2", etc.
This means that if, for instance, next game the person that was Player 1 switches to Player 2, it will now attempt to load bank P2 for him, which *does not exist* (his data was saved in P1), and his save data will not be loaded.
He should be using the same bank name for all players, no matter what player # they are.
@TheFallenOne222: Go
So, if he uses the same bank name for every player. It won't matter which slot you're in, it will automatically load your own save?
Along the same lines... would someone mind explaining the point of bank sections.
From what I have gathered from looking at the script it is just partitioning of information. I'm trying to grasp the advantage of this compared to just making different banks. Especially since it seems there are banks size limitations. Wouldn't it be better to just make more banks and comment their purpose than to try to divide up an already restrained data container?