Dreamscape
05-08-2011, 11:01 AM
Hi guys,
I've run into a little problem when trying to create a tech level upgrade. The tech structure in one of our factons is required to build second tier units, and you can purcahse an upgrade from this tech structure to further access the third tier units.
The first part was easy enough, but creating the third tier tech upgrade has cause some problems.
Currently, the code within the structure for the upgrade is as follows:
<TechUpgrade
id="ModuleTag_TechUpgrade_Tech3"
Radius="390.0"
DistanceType="RECTANGULAR">
<TriggeredBy>Upgrade_UCTech3</TriggeredBy>
<ObjectFilter
Rule="ANY"
Relationship="SAME_PLAYER" >
<IncludeThing>UBAirfield</IncludeThing>
<IncludeThing>UBBarracks</IncludeThing>
<IncludeThing>UBNavalYard</IncludeThing>
<IncludeThing>UBWarFactory</IncludeThing>
</ObjectFilter>
</TechUpgrade>
And also the button code for this upgrade:
<ButtonSingleStateData
id="ButtonStateUpgradeUCTech3">
<State
Image="UU_Button_RippeGrinder"
Title="NAME:UpgradeUCTech3"
Description="DESC:UpgradeUCTech3" />
</ButtonSingleStateData>
<UnitAbilityButtonTemplate
id="MouseButtonUpgradeUCTech3"
LogicCommand="Command_PurchaseUCTech3">
<Data>
<ObjectUpgrade StateData="ButtonStateUpgradeUCTech3"/>
</Data>
</UnitAbilityButtonTemplate>
Within an upgrade.xml I have:
<UpgradeTemplate id="Upgrade_UCTech3"
inheritFrom="BasePurchasableUpgrade"
DisplayName="UpgradeName:UCTech3"
AcquireHint="UpgradePrereq:UCTech3"
TypeDescription="UpgradeType:UCTech3"
Description="UpgradeDesc:UCTech3"
Type="OBJECT"
BuildTime="1.0s"
BuildCost="150"
IconImage="Button_UpgradeMortar"
Options="OBJECT_UPGRADE_PROJECTED">
</UpgradeTemplate>
And within the unit itself I have:
<GameDependency>
<NeededUpgrade>Upgrade_UCTech3</NeededUpgrade>
</GameDependency>
I also have the following logic commands:
<LogicCommand
Type="OBJECT_UPGRADE"
id="Command_PurchaseUCTech3">
<Upgrade>Upgrade_UCTech3</Upgrade>
<AISpecialPowerInfo Heuristic="UPGRADE" Manager="BUILDER"/>
</LogicCommand>
<LogicCommandSet
id="UBTechLabCommandSet">
<Cmd>Command_PurchaseUCTech3</Cmd>
</LogicCommandSet>
The button works and you can purchase the upgrade. An EVA message is displayed when the upgrade has been purchased, is signalled on the minimap, and the button greys out.
However the unit within the war factory still remains disabled and says the purchase of the upgrade is still required.
I think it's got something to do with the fact that it's not transferring the upgrade data to the war factory, because I've used the code from the Allied outpost as a basis but it's not showing the 'link' between structures.
Have I missed something obvious? I would really appreciate your help.
Please note the purchase times and costs are for testing purposes only.
Many thanks
I've run into a little problem when trying to create a tech level upgrade. The tech structure in one of our factons is required to build second tier units, and you can purcahse an upgrade from this tech structure to further access the third tier units.
The first part was easy enough, but creating the third tier tech upgrade has cause some problems.
Currently, the code within the structure for the upgrade is as follows:
<TechUpgrade
id="ModuleTag_TechUpgrade_Tech3"
Radius="390.0"
DistanceType="RECTANGULAR">
<TriggeredBy>Upgrade_UCTech3</TriggeredBy>
<ObjectFilter
Rule="ANY"
Relationship="SAME_PLAYER" >
<IncludeThing>UBAirfield</IncludeThing>
<IncludeThing>UBBarracks</IncludeThing>
<IncludeThing>UBNavalYard</IncludeThing>
<IncludeThing>UBWarFactory</IncludeThing>
</ObjectFilter>
</TechUpgrade>
And also the button code for this upgrade:
<ButtonSingleStateData
id="ButtonStateUpgradeUCTech3">
<State
Image="UU_Button_RippeGrinder"
Title="NAME:UpgradeUCTech3"
Description="DESC:UpgradeUCTech3" />
</ButtonSingleStateData>
<UnitAbilityButtonTemplate
id="MouseButtonUpgradeUCTech3"
LogicCommand="Command_PurchaseUCTech3">
<Data>
<ObjectUpgrade StateData="ButtonStateUpgradeUCTech3"/>
</Data>
</UnitAbilityButtonTemplate>
Within an upgrade.xml I have:
<UpgradeTemplate id="Upgrade_UCTech3"
inheritFrom="BasePurchasableUpgrade"
DisplayName="UpgradeName:UCTech3"
AcquireHint="UpgradePrereq:UCTech3"
TypeDescription="UpgradeType:UCTech3"
Description="UpgradeDesc:UCTech3"
Type="OBJECT"
BuildTime="1.0s"
BuildCost="150"
IconImage="Button_UpgradeMortar"
Options="OBJECT_UPGRADE_PROJECTED">
</UpgradeTemplate>
And within the unit itself I have:
<GameDependency>
<NeededUpgrade>Upgrade_UCTech3</NeededUpgrade>
</GameDependency>
I also have the following logic commands:
<LogicCommand
Type="OBJECT_UPGRADE"
id="Command_PurchaseUCTech3">
<Upgrade>Upgrade_UCTech3</Upgrade>
<AISpecialPowerInfo Heuristic="UPGRADE" Manager="BUILDER"/>
</LogicCommand>
<LogicCommandSet
id="UBTechLabCommandSet">
<Cmd>Command_PurchaseUCTech3</Cmd>
</LogicCommandSet>
The button works and you can purchase the upgrade. An EVA message is displayed when the upgrade has been purchased, is signalled on the minimap, and the button greys out.
However the unit within the war factory still remains disabled and says the purchase of the upgrade is still required.
I think it's got something to do with the fact that it's not transferring the upgrade data to the war factory, because I've used the code from the Allied outpost as a basis but it's not showing the 'link' between structures.
Have I missed something obvious? I would really appreciate your help.
Please note the purchase times and costs are for testing purposes only.
Many thanks