Collapse
No announcement yet.
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Creating a tech upgrade

    #1
    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:

    Code:
    			<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:

    Code:
    	<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:

    Code:
    	<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:

    Code:
    		<GameDependency>
    			<NeededUpgrade>Upgrade_UCTech3</NeededUpgrade>
    		</GameDependency>
    I also have the following logic commands:

    Code:
    	<LogicCommand
    		Type="OBJECT_UPGRADE"
    		id="Command_PurchaseUCTech3">
    		<Upgrade>Upgrade_UCTech3</Upgrade>
    		<AISpecialPowerInfo Heuristic="UPGRADE" Manager="BUILDER"/>
    	</LogicCommand>
    Code:
    	<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
    Last edited by Dreamscape; 05-08-2011, 11:04 AM.

  • #2
    You need to put this on the receiving structures(make sure to edit it to comply of course).

    Code:
    <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>

    Comment


    • #3
      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!

      Comment


      • #4
        No problem

        Comment


        • #5
          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?

          Comment


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

            Comment


            • #7
              Where am I removing that from? I can't see that anywhere in my code.

              Comment


              • #8
                TechUpgradeReceiver

                Comment


                • #9
                  Hmm, no wonder I couldn't find it.. I've already removed it - but it's still showing.

                  Comment


                  • #10
                    That worked for me before, I don't know :S

                    Comment

                    X