second problem atm seems to be that i can't make the component tower function as a wallhub.
Or rather it does but when it has to place a new hub part when dragging the wall line the game crashes.
Experimented abit with the old wallhubs and it seems the game crashes if you give the wallhub a weaponsetupdate behavior.
So my second idea was to make the wallhub upgradable to my component tower.
The idea was (although abit abundant):
build wallhub (and/or drag walls/hubs)
Click wallhub to upgrade to component tower(new object)
click weaponupgrade on tower.
Again the game crashes when i click the upgrade button (basicly a replaceself function).
The code i used:
button:
Code:
<ObjectUpgradeButton
Id="Command_ConvertTower">
<State
Image="Button_UpgradeMortar"
Title="NAME:UConvertTower"
Description="DESC:ConvertTower" />
</ObjectUpgradeButton>
LogicCommand:
Code:
<LogicCommand
Type="OBJECT_UPGRADE"
id="Command_ConvertTower">
<Upgrade>Upgrade_ConvertTower</Upgrade>
</LogicCommand>
Upgrades:
Code:
<UpgradeTemplate id="Upgrade_ConvertTower"
inheritFrom="BasePurchasableUpgrade"
DisplayName="UPGRADE:ConvertTower"
Type="OBJECT"
BuildCost="0"
BuildTime="0s"
ResearchCompleteEvaEvent ="None"
ResearchSound="GDI_PowerPlantUpgraded1HeavyTurbinesMS">
<GameDependency>
<ObjectFilter
Rule="ANY">
<IncludeThing>GDIConstructionYard</IncludeThing>
<IncludeThing>GDICrane</IncludeThing>
</ObjectFilter>
<RequiredObject>GDIPowerplant</RequiredObject>
</GameDependency>
</UpgradeTemplate>
Wallhub object:
Code:
<ReplaceSelfUpgrade
id="ModuleTag_ReplaceSelf"
NewObjectUnpackTime="1.0s">
<TriggeredBy>Upgrade_ConvertTower</TriggeredBy>
<ReplacementTemplate>GDICompoundtower01</ReplacementTemplate>
</ReplaceSelfUpgrade>
<ProductionUpdate
id="ModuleTag_ProductionUpdate"
Type="UPGRADE"
GiveNoXP="true" />
The plast weirdly allows to work sometimes but most of the time it crashes the game when you click the upgrade to the component tower.
Is there a better or right way to have my component tower function as a wallhub? (builds wallsegments etc)