You can easily fix this, with a little bit of commandset switching.
This tutorial will give the American Dozer 2 switchable commandsets.
1st step. Creating the upgrades.
This requires 2 new upgrades. One to move the commandset up, and one to move it back down.
Examples:
;---------------------------- Upgrade Upgrade_USADozerPrimaryCommandSet Type = OBJECT BuildTime = 0.0 BuildCost = 0 ButtonImage = SUFakeToggle; Replace with downwards arrow cameo for best effect. End ;---------------------------- Upgrade Upgrade_USADozerSecondaryCommandSet Type = OBJECT BuildTime = 0.0 BuildCost = 0 ButtonImage = SUFakeToggle; Replace with upwards arrow cameo for best effect. End
2nd step. Creating the commandsets for the dozer:
All you really need to do is create a new commandset, with a button for the upgrade. See below:
CommandSet AmericaDozerCommandSet; This overwrites the original commandset. 1 = Command_ConstructAmericaPowerPlant 2 = Command_ConstructAmericaStrategyCenter 3 = Command_ConstructAmericaBarracks 4 = Command_ConstructAmericaSupplyDropZone 5 = Command_ConstructAmericaSupplyCenter 6 = Command_ConstructAmericaParticleCannonUplink 7 = Command_ConstructAmericaPatriotBattery 8 = Command_ConstructAmericaCommandCenter 9 = Command_ConstructAmericaFireBase 11 = Command_ConstructAmericaWarFactory 12 = Command_ConstructAmericaAirfield 13 = Command_UpgradeUSADozerSecondaryCommandSet; We add this button, which will upgrade the commandset. 14 = Command_DisarmMinesAtPosition End CommandSet AmericaDozerSecondaryCommandSet 1 = Command_ConstructAmericaSupplyDropZone 3 = Command_ConstructAmericaParticleCannonUplink 5 = Command_ConstructAmericaPatriotBattery 7 = Command_ConstructAmericaFireBase 13 = Command_UpgradeUSADozerPrimaryCommandSet;This will change the commandset to the regular one 14 = Command_DisarmMinesAtPosition End
3rd step, creating the upgrade buttons:
You need to make 2 buttons which grant the upgrade for the object, in this case, the dozer. Examples:
CommandButton Command_UpgradeUSADozerSecondaryCommandSet Command = OBJECT_UPGRADE Upgrade = Upgrade_USADozerSecondaryCommandSet TextLabel = CONTROLBAR:UpgradeUSADozerSecondaryCommandSet ButtonImage = SUFakeToggle ButtonBorderType = UPGRADE; Identifier for the User as to what kind of button this is DescriptLabel = CONTROLBAR:ToolTipUpgradeUSADozerSecondaryCommandSet End CommandButton Command_UpgradeUSADozerPrimaryCommandSet Command = OBJECT_UPGRADE Upgrade = Upgrade_USADozerPrimaryCommandSet TextLabel = CONTROLBAR:UpgradeUSADozerPrimaryCommandSet ButtonImage = SUFakeToggle ButtonBorderType = UPGRADE; Identifier for the User as to what kind of button this is DescriptLabel = CONTROLBAR:ToolTipUpgradeUSADozerPrimaryCommandSet End
Now just test it out.
A couple notes:
The AI cannot build the structures in the other commandset via that commandset, so you need to create buttons for those units that only the AI can access.
You can simply copy the button for the building in the secondary commandset, and paste it into the regular commandset. This button has to have a number at least 15 or above.
Lets say you added an Ion Cannon to the secondary commandset. The AI can't build it from there, so you'd add the button to the regular commandset.
CommandSet AmericaDozerCommandSet 1 = Command_ConstructAmericaPowerPlant 2 = Command_ConstructAmericaStrategyCenter 3 = Command_ConstructAmericaBarracks 4 = Command_ConstructAmericaSupplyDropZone 5 = Command_ConstructAmericaSupplyCenter 6 = Command_ConstructAmericaParticleCannonUplink 7 = Command_ConstructAmericaPatriotBattery 8 = Command_ConstructAmericaCommandCenter 9 = Command_ConstructAmericaFireBase 11 = Command_ConstructAmericaWarFactory 12 = Command_ConstructAmericaAirfield 13 = Command_UpgradeUSADozerSecondaryCommandSet 14 = Command_DisarmMinesAtPosition 15 = Command_ConstructAmericaIonCannon; Put the button here. ;The bar only has room for 14 buttons, so you won't see it,but the AI can use it. End