I'm trying to figure out how to keep completed upgrades between maps in a campaign, I knew how to setup retaining resources, but I can't figure out how to set the trigger to keep upgrades.
EX: When the player uses a resource to buy a permanent tech upgrade that carries over the rest of the campaign.
An upgrade is defined by a level represented by an integer.
You can save this integer in a bank with as key the name of the upgrade and as value this integer.
At the start of your maps, you load the bank and retrieve the key / value. Then for each upgrade, you set the value.
I recommend you to create an array of all upgrades you want to affect. Like that, you copy/paste that array from a map to another.
And in a loop, set the upgrade to its correct retrieved value from the bank for the owner of the bank.
Advanced notes :
> If your upgrades are in a mod, you can create the script in that mod. No need to copy/paste the array.
> Use "Convert Game Link To String" and "Convert String To Game Link", this should make the job. If not, don't rely on the upgrade name solely.
> You can do lots with bank. Open in a text editor (like Notepad++) the bank to see how the file is (basically an XML file). Default path is "Documents/Starcraft II/Banks".
I'm trying to figure out how to keep completed upgrades between maps in a campaign, I knew how to setup retaining resources, but I can't figure out how to set the trigger to keep upgrades.
EX: When the player uses a resource to buy a permanent tech upgrade that carries over the rest of the campaign.
bump
Hello.
An upgrade is defined by a level represented by an integer.
You can save this integer in a bank with as key the name of the upgrade and as value this integer.
At the start of your maps, you load the bank and retrieve the key / value. Then for each upgrade, you set the value.
I recommend you to create an array of all upgrades you want to affect. Like that, you copy/paste that array from a map to another.
And in a loop, set the upgrade to its correct retrieved value from the bank for the owner of the bank.
Advanced notes :
> If your upgrades are in a mod, you can create the script in that mod. No need to copy/paste the array.
> Use "Convert Game Link To String" and "Convert String To Game Link", this should make the job. If not, don't rely on the upgrade name solely.
> You can do lots with bank. Open in a text editor (like Notepad++) the bank to see how the file is (basically an XML file). Default path is "Documents/Starcraft II/Banks".
Have a nice day.
Thanks