Results 1 to 10 of 10
  1. #1

    TS component tower upgrade logic.

    Basicly i wanted to add a component style base defense more or less like in Tiberian Sun.
    Followed this tutorial Link

    My buttons apear on my building but are greyed out and unclickable.
    Gone over the code several times an can' find any typo's or errors myself.

    Another pair of eyes or some advice would be apreciated.

    Iclueded my xml files.

    UnitAbilityButtonTemplates.txt
    GDICompoundTower01.txt
    LogicCommandSetUpdate.txt
    Mod.txt
    GDIUpgrades.txt
    LogicCommandUpdate.txt

    Thanks in advance.

  2. #2
    Lieutenant Bibber's Avatar
    Join Date
    Feb 2011
    Location
    Germany
    Posts
    354
    Did you build all the requirements? Your upgrades can only be built when you have GDIConstructionYard/GDICrane + GDICompoundTower01 + GDICommandPost.

    btw: Could you really compile your mod with this code? Mine throws a critical error because of the order of the sub-elements in the GameDependency tag.

  3. #3
    Ye i can compile but only when the inheritFrom="BasePurchasableUpgrade" is in it, as for the dependancies: ye build everything but the buton remains grey, even when i remove the dependancies it remains grey.


    Edit: as a quick test just now , basicly just copied the railgun upgrade from upgrades and the buttonss xml , still remains grey
    Last edited by Ravendarkc_c; 05-11-2011 at 01:02 AM.

  4. #4
    Fixed the problem.

    Was lacking

    Code:
     
    <ProductionUpdate
    id="ModuleTag_ProductionUpdate"
    Type="UPGRADE"
    GiveNoXP="true" />
    Only issue atm i'm having is that one of my 3 weapons isnt working weirdly enough but that's an issue for a later moment.

  5. #5
    Lieutenant Bibber's Avatar
    Join Date
    Feb 2011
    Location
    Germany
    Posts
    354
    Ah yeah. But Type="UPGRADE" is not necessarily needed. If you don't want to have a progress bar then just drop the line.

  6. #6
    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)

  7. #7
    Lieutenant Colonel Lauren's Avatar
    Join Date
    Feb 2011
    Posts
    1,621
    Just spawn another object as a slave on top of the hub that has the weapon.

  8. #8
    Quote Originally Posted by Lauren View Post
    Just spawn another object as a slave on top of the hub that has the weapon.
    Any advice on where and how to start there?
    Are there any samples of that in the orignal c&c xmls? Can't think of an existing unit using that mechanic right away :s

    I'll have a look at it later tho.

  9. #9
    At a quick glance the 2 things i can think of to be able to simulate something like that:
    hordecontain like in the digin bunker
    spawn like in repair drones

    Think the later might be the case, have an object spawn(as you said) no locomotor making it stationary, initial spawn =0 burst = 1, will triggeredby= "upgrade" work on that?

  10. #10
    Yes! The spawn behavior works like a charm, got my component tower ingame en working. Thanks lauren en bibber!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Victory Games is Electronic Arts' dedicated Strategy Gaming studio. Formed in 2010 under the leadership of Jon Van Caneghem, Victory Games has offices in Los Angeles, CA; Austin, TX; and Shanghai, China and is currently focused on the Command & Conquer franchise.