Hi,
I am trying to create a shop where a player can buy upgrades for himself and his creatures. I want to reproduce the behavior of the upgrades just like in engineering bay: once you buy upgrade lvl 1 it disappears from the command card and the same upgrade lvl 2 appears in its position. I have declared two upgrades (lvl 1 and lvl 2), created two different buttons, linked the button with the upgrade in a "research" ability and finally set the command card of the building as follows:
The problem is that when the lvl 1 upgrade is bought, it does not remove itself from the command card in order to leave the place for the lvl 2 upgrade. Am I missing some steps?
If you would like to creat upgrade with a same icons you dont need more then one just set the upgrade max level the level you would like to be a max level (in your in your picture it is 2 so set it 2). If you dont set it the icon stays upgradeble but will not add the function, the max level give him the number that how much upgrade (with function) can be executed. The second part is to hide it and made it unuseable when max level reached:
Creat requriment on requirments tag name it to Increase Armor Reasearch press suggest button to get this ID=IncreaseArmorReasearch Press ok. Then switch to xml view, the xml view is +2 to right from table view that is the default view in editor so possible you are on table view. if you dont have other requirements you will see similar things like this:
Explanation: every created staff is between <Catalog> and </Catalog> (there are different categories by tag unit actor weapon etc) the requiremnet you creat is between <cRequirement id=something> and </Crequirement> and placed in requirements tag's catalog. The editor categories value= can different from it I copied it from my own upgrade(and change thee id), you can change the race and tech type in any time these value not effect its function its just made it easily separate them by type when you browsing among them. Now here is the function you need:
These 2 fields tell the upgrade/reasarch ability to show and make useable the upgrade's icons until Upgrade queue or better(complete) is less then 2, but if reach it hide it and make unusable. Save document, if you copy correctly it let you save, switch back to table view and study the settings.
</Catalog>
if you have other requirements than dont select the xml version and catalog parts just the Crequirement parts or it will overriide the whole requirements tag on your map or mod file. Give this requirement to research ability. Pay attention to your reasearch upgrade id is become equal to IncreaseArmorReasearch until you use my code, after it is done, and you switch back to table view you can rename it, and editor will rewrite the xml too. if your id dont this IncreaseArmorReasearch, dont huge problem just go in the settings with table view and search your upgrade from the list. and press ok and save it.
if everything is ok you will see these settings in table view
Increase Armor Reasearch
Use
And
Less than
2
Show
And
Less than
2
The 'and' part is not required if you use one upgrade, I let it in because you can add other upgrades later on.
Hi, I am trying to create a shop where a player can buy upgrades for himself and his creatures. I want to reproduce the behavior of the upgrades just like in engineering bay: once you buy upgrade lvl 1 it disappears from the command card and the same upgrade lvl 2 appears in its position. I have declared two upgrades (lvl 1 and lvl 2), created two different buttons, linked the button with the upgrade in a "research" ability and finally set the command card of the building as follows:
The problem is that when the lvl 1 upgrade is bought, it does not remove itself from the command card in order to leave the place for the lvl 2 upgrade. Am I missing some steps?
You'll want to look into using requirements. You'll want to use one that hides the button based on whether or not stuff is researched.
@elderuyld: Go
If you would like to creat upgrade with a same icons you dont need more then one just set the upgrade max level the level you would like to be a max level (in your in your picture it is 2 so set it 2). If you dont set it the icon stays upgradeble but will not add the function, the max level give him the number that how much upgrade (with function) can be executed. The second part is to hide it and made it unuseable when max level reached:
Creat requriment on requirments tag name it to Increase Armor Reasearch press suggest button to get this ID=IncreaseArmorReasearch Press ok. Then switch to xml view, the xml view is +2 to right from table view that is the default view in editor so possible you are on table view. if you dont have other requirements you will see similar things like this:
<?xml version="1.0" encoding="us-ascii"?>
<Catalog>
<CRequirement id="IncreaseArmorReasearch">
<EditorCategories value="Race:Neutral,TechType:Ability"/>
</CRequirement>
</Catalog>
Explanation: every created staff is between <Catalog> and </Catalog> (there are different categories by tag unit actor weapon etc) the requiremnet you creat is between <cRequirement id=something> and </Crequirement> and placed in requirements tag's catalog. The editor categories value= can different from it I copied it from my own upgrade(and change thee id), you can change the race and tech type in any time these value not effect its function its just made it easily separate them by type when you browsing among them. Now here is the function you need:
<NodeArray index="Use" Link="AndLTCountUpgradeIncreaseArmorReasearchQueuedOrBetter2"/>
<NodeArray index="Show" Link="AndLTCountUpgradeIncreaseArmorReasearchQueuedOrBetter2"/>
These 2 fields tell the upgrade/reasarch ability to show and make useable the upgrade's icons until Upgrade queue or better(complete) is less then 2, but if reach it hide it and make unusable. Save document, if you copy correctly it let you save, switch back to table view and study the settings.
full code here:
<?xml version="1.0" encoding="us-ascii"?>
<Catalog>
<CRequirement id="IncreaseArmorReasearch">
<EditorCategories value="Race:Neutral,TechType:Ability"/>
<NodeArray index="Use" Link="AndLTCountUpgradeIncreaseArmorReasearchQueuedOrBetter2"/>
<NodeArray index="Show" Link="AndLTCountUpgradeIncreaseArmorReasearchQueuedOrBetter2"/>
</CRequirement>
</Catalog> if you have other requirements than dont select the xml version and catalog parts just the Crequirement parts or it will overriide the whole requirements tag on your map or mod file. Give this requirement to research ability. Pay attention to your reasearch upgrade id is become equal to IncreaseArmorReasearch until you use my code, after it is done, and you switch back to table view you can rename it, and editor will rewrite the xml too. if your id dont this IncreaseArmorReasearch, dont huge problem just go in the settings with table view and search your upgrade from the list. and press ok and save it.
if everything is ok you will see these settings in table view
Increase Armor Reasearch
Use
And
Less than
2
Show
And
Less than
2
The 'and' part is not required if you use one upgrade, I let it in because you can add other upgrades later on.