PDA

View Full Version : Creating a tech upgrade



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

R3ven
05-08-2011, 07:34 PM
You need to put this on the receiving structures(make sure to edit it to comply of course).


<TechUpgradeReceiver xmlns="uri:ea.com:eala:asset"
id="ModuleTag_TechUpgradeReceiver_Tech3"
Radius="600.0"
DistanceType="RECTANGULAR"
FXLineBoneName="fx_bone_upgrade_dish">
<TriggeredBy>Upgrade_AlliedTech3</TriggeredBy>
<ObjectFilter
Rule="ANY"
Relationship="ALLIES" >
<IncludeThing>AlliedConstructionYard</IncludeThing>
<IncludeThing>AlliedOutpost</IncludeThing>
</ObjectFilter>
</TechUpgradeReceiver>

Dreamscape
05-08-2011, 08:10 PM
What really annoys me is that I looked at that code briefly but couldn't work out where it would go - so dismissed it!

One of the reasons I love this community, if you try hard enough and show that you not looking for someone to do all the work for you, people are genuinely happy to help.

Really appreciate that, works like a charm. I'm going to disable the link effect as it will be a global upgrade so you could end up with several link lines.

Many thanks again!

R3ven
05-08-2011, 11:20 PM
No problem :)

Dreamscape
06-01-2011, 07:57 PM
Well despite me "thinking" I knew where the code/texture for the tech link was, I have been unable to remove it. I thought it was FX_TechStream but I was mistaken. Anyone know which texture is used for tech links, and even better where the xml code for these links is?

R3ven
06-01-2011, 07:58 PM
I don't know where the fx comes from, but I know how remove it. For that remove the line FXLineBoneName.

EDIT: Ninja-speed response ftw.

Dreamscape
06-01-2011, 08:16 PM
Where am I removing that from? I can't see that anywhere in my code.

R3ven
06-01-2011, 08:20 PM
TechUpgradeReceiver :)

Dreamscape
06-01-2011, 08:31 PM
Hmm, no wonder I couldn't find it.. I've already removed it - but it's still showing.

R3ven
06-01-2011, 09:39 PM
That worked for me before, I don't know :S