I've been able to get upgrades to work beautifully, but for some reason this one won't budge. Here is the relevant code:
Code:
CommandButton Command_PurchaseUpgradeISD1
Command = OBJECT_UPGRADE
Upgrade = Upgrade_ImperatorISD1
Options = OK_FOR_MULTI_SELECT CANCELABLE
TextLabel = CONTROLBAR:UpgradeISD1
ButtonImage = UIISD1
ButtonBorderType = UPGRADE
DescriptLabel = CONTROLBAR:ToolTipUpgradeISD1
InPalantir = Yes
End
This is the button for the upgrade that is in the units commandset which references to:
Code:
Upgrade Upgrade_ImperatorISD1
DisplayName = UPGRADE:ISD1
Type = OBJECT
Tooltip = TOOLTIP:ISD1
BuildCost = 5
BuildTime = 10.0
ResearchSound = UpgradeFlamingArrows
UpgradeFX = FX:GenericBuildingUpgrade
End
And finally the code within the units ini file:
Code:
;;;;;;;;;;;;;;;;;;;;;Class I Upgrade;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Behavior = SubObjectsUpgrade ModuleTag_ShowISD1
TriggeredBy = Upgrade_ImperatorISD1
ShowSubObjects = QUADL QUADR ISD1
End
Behavior = WeaponSetUpgrade WeaponSetUpgradeModuleTag
TriggeredBy = Upgrade_ImperatorISD1
End
And heres a bit that hides the subobjects so the upgrade can show them.
Code:
Behavior = SubObjectsUpgrade ModuleTag_HideUpgrades
TriggeredBy = Upgrade_StructureLevel1
HideSubObjects = QUADL QUADR ISD1 ISD2
End
Ok, the problem is the upgrade button is greyed out. Here are things i have tried:
- Changed it from an OBJECT upgrade to a PLAYER upgrade. This made the button clickable, but you could click it indefinitely and nothing would happen.
- I tried each of the behavior modules seperately, but no combination worked, and without any modules the button of course says "this unit cannot recieve this upgrade".
I've tried numerous other things, but nothing has worked. What could possibly be wrong? Did I forget something?