Keep Items Stored into a Item Array, Save the numbers of the items your character has as integer references to positions in that array, and then refer to the array with that integer to get the actual item. Banks store primitive data, not objects, so you need to be creative in how you use primitive types to get object data like items.
Then if your character has item 4, you store the integer 3 however you wish to do so, then when you load it, you can convert that back into the array to recieve item4;
damn if i were only on my desktop i would so take a look at this :( , if SC2 mapper doesn't get back too you ill look at it when this episode of house ends :P
Keep Items Stored into a Item Array, Save the numbers of the items your character has as integer references to positions in that array, and then refer to the array with that integer to get the actual item. Banks store primitive data, not objects, so you need to be creative in how you use primitive types to get object data like items.
Then if your character has item 4, you store the integer 3 however you wish to do so, then when you load it, you can convert that back into the array to recieve item4;
Yeah, I'm just not sure how to trigger the adding of the items to the array. say if i make exampleItemArray[0] how would i trigger the item into it. I cannot find any triggers that deal with items. or do i just treat them as units?
damn if i were only on my desktop i would so take a look at this :( , if SC2 mapper doesn't get back too you ill look at it when this episode of house ends :P
its mostly all proof of concept stuff in triggers, i am having a very hard time with this though. its had me stumped all day.
also i wanted to elaborate on the problem more, If you save/load in the same map session it works fine. if you close the map and try and load it throws that error. Now when i open the bank XML the information is clearly there. this is my problem.
The Key isn't Player 1 - Hero Name, it's -hero scmapper, so you need to fix that.
Also make sure to add a Map Initialization Trigger that preloads each bank for each player, otherwise you will hit a stump when playing multiplayer and doing bank saves and loads. The reason the load works in game is because you are loading your value "Player 1 - Hero Name", and not the actual value from the bank, but when the game restarts and you try to actually do the load from the Bank you hit the error.
EDIT - About the item question, I haven't played around with items yet so my answer to that was just pure theory, but if theres no ITEM data type, then it must be a form of a unit, so unit type arrays should work.
The Key isn't Player 1 - Hero Name, it's -hero scmapper, so you need to fix that.
Also make sure to add a Map Initialization Trigger that preloads each bank for each player, otherwise you will hit a stump when playing multiplayer and doing bank saves and loads.
Player 1 - Hero name is a variable:
Player 1 - Hero Name = "" <String>
"Also make sure to add a Map Initialization Trigger that preloads each bank for each player, otherwise you will hit a stump when playing multiplayer and doing bank saves and loads."
@Pandaros_Brewmaster: Go
I am out of ideas, it is very difficult for me to check over your code because it isn't meant to be read by someone other then yourself. One last thing I could suggest is trying to store the unit types into a unit array, and try load through the array instead of using the bank unit restoration feature, I don't believe it is fully fleshed out yet because I couldn't get it working properly in my World of Starcraft map as well. If that doesn't work you must have some kind of typo or logical error hidden somewhere in those triggers.
i will be posting the code as a new map to DL this afternoon. It looks like banking information between maps as not been enabled because it flat out dose not work for heroes or items. I will be making updates to the map regularly to refine the system.
i will be posting the code as a new map to DL this afternoon. It looks like banking information between maps as not been enabled because it flat out dose not work for heroes or items. I will be making updates to the map regularly to refine the system.
I dont know why but me for it is not working after reopening the map, i have the same for mine, so i dont know what to do.
In your map for me the buttons for loading hero are empty and i cant load, i cant even delete there are just empty buttons.
Or isnt it possible to reuse a bank after reopening the map yet?
When i restart my map where i saved in a bank before and try to load i get a trigger error and when i save soemthing new to the file it is totally overwritten and old data is lost...
Meanwhile i shortened the map as much as possible... but somehow when i import the working part on my map it stops working even if its totally the same...
When i reload my map i cant load from the saved data and i have no clue why...
Edit: found the reason - whenever you do this file loading in a loop it will make your trigger crash, so you have to load it for every person manually
System is done!
http://www.sc2mapster.com/maps/saveload-system
No one on this?
couldn't you make the items into units as well and then save them in the bank too?
Keep Items Stored into a Item Array, Save the numbers of the items your character has as integer references to positions in that array, and then refer to the array with that integer to get the actual item. Banks store primitive data, not objects, so you need to be creative in how you use primitive types to get object data like items.
Example ->
exampleItemArray[0] = item1;
exampleItemArray[1] = item2;
exampleItemArray[2] = item3;
exampleItemArray[3] = item4;
Then if your character has item 4, you store the integer 3 however you wish to do so, then when you load it, you can convert that back into the array to recieve item4;
@SCMapper: Go
Hey i am having a problem with my loading from the bank could you take a look if possible? it keeps giving me this:
00:01:31.63 Trigger Error in 'gt_Player1BankLoad_Func': Could not get 'bank' from parameter in '' (value: )
damn if i were only on my desktop i would so take a look at this :( , if SC2 mapper doesn't get back too you ill look at it when this episode of house ends :P
Yeah, I'm just not sure how to trigger the adding of the items to the array. say if i make exampleItemArray[0] how would i trigger the item into it. I cannot find any triggers that deal with items. or do i just treat them as units?
its mostly all proof of concept stuff in triggers, i am having a very hard time with this though. its had me stumped all day.
also i wanted to elaborate on the problem more, If you save/load in the same map session it works fine. if you close the map and try and load it throws that error. Now when i open the bank XML the information is clearly there. this is my problem.
Your Player 1 Load Command is:
Bank - Restore Player 1 - Hero Name of section "Hero" from bank (Last opened bank) for player 1 at (Center of Start Zone) facing 0.0
You tell it to Restore "Player 1 - Hero Name", as the key for your bank section called "Hero".
But here's what your Bank structure looks like in the XML...
<?xml version="1.0" encoding="utf-8"?>
<Bank version="1">
<Section name="Hero">
<Key name="-hero scmapper">
<Type string="Lightning"/>
<Shields fixed="0"/>
<Life fixed="700"/>
<Energy fixed="0"/>
</Key>
</Section>
</Bank>
The Key isn't Player 1 - Hero Name, it's -hero scmapper, so you need to fix that.
Also make sure to add a Map Initialization Trigger that preloads each bank for each player, otherwise you will hit a stump when playing multiplayer and doing bank saves and loads. The reason the load works in game is because you are loading your value "Player 1 - Hero Name", and not the actual value from the bank, but when the game restarts and you try to actually do the load from the Bank you hit the error.
EDIT - About the item question, I haven't played around with items yet so my answer to that was just pure theory, but if theres no ITEM data type, then it must be a form of a unit, so unit type arrays should work.
@SCMapper: Go
Player 1 - Hero name is a variable:
Player 1 - Hero Name = "" <String>
"Also make sure to add a Map Initialization Trigger that preloads each bank for each player, otherwise you will hit a stump when playing multiplayer and doing bank saves and loads."
I think i already have this trigger
[reply=73381]
Oh found some stuff on the items this neat trigger:
I am going to see what i can do with this
@Pandaros_Brewmaster: Go I am out of ideas, it is very difficult for me to check over your code because it isn't meant to be read by someone other then yourself. One last thing I could suggest is trying to store the unit types into a unit array, and try load through the array instead of using the bank unit restoration feature, I don't believe it is fully fleshed out yet because I couldn't get it working properly in my World of Starcraft map as well. If that doesn't work you must have some kind of typo or logical error hidden somewhere in those triggers.
@SCMapper: Go
yeah i cant seem to save string or text to it, i think it's bugged.
@Pandaros_Brewmaster: Go
HOLY COW! i got the items into the XML! one step closer to hero item save load! well the save part is done!
Check it out!
Returns in the bank:
@Pandaros_Brewmaster: Go
GOOD NEWS! the save/load system is WORKING!
i will be posting the code as a new map to DL this afternoon. It looks like banking information between maps as not been enabled because it flat out dose not work for heroes or items. I will be making updates to the map regularly to refine the system.
@Pandaros_Brewmaster: Go
GOOD NEWS! the save/load system is WORKING!
i will be posting the code as a new map to DL this afternoon. It looks like banking information between maps as not been enabled because it flat out dose not work for heroes or items. I will be making updates to the map regularly to refine the system.
@Pandaros_Brewmaster: Go
Updated top post!
@Pandaros_Brewmaster: Go
I dont know why but me for it is not working after reopening the map, i have the same for mine, so i dont know what to do. In your map for me the buttons for loading hero are empty and i cant load, i cant even delete there are just empty buttons.
Or isnt it possible to reuse a bank after reopening the map yet?
When i restart my map where i saved in a bank before and try to load i get a trigger error and when i save soemthing new to the file it is totally overwritten and old data is lost...
Meanwhile i shortened the map as much as possible... but somehow when i import the working part on my map it stops working even if its totally the same... When i reload my map i cant load from the saved data and i have no clue why...
Edit: found the reason - whenever you do this file loading in a loop it will make your trigger crash, so you have to load it for every person manually