Jump to content


Photo

Modding The Harvester


  • Please log in to reply
7 replies to this topic

#1 curteck

curteck
  • New Members
  • 3 posts

Posted 04 January 2009 - 10:23 PM

I'm trying to mod the Harvester so that when it picks up Tiberium your credits go up instead of having to go back to the refinery. I figured that I could copy behavior elements from the refinery.xml file into the harvester.xml file but that hasn't worked.

Here's the behavior for sending the Harvester back to the refinery:

<ReturnToDockSpecialPower
id="ModuleTag_ReturnToDock"
SpecialPowerTemplate="SpecialPower_ReturnToDock" />

In the GameObject section of the GDIRefinery.xml you see:

KindOf="STRUCTURE SELECTABLE IMMOBILE CAN_CAST_REFLECTIONS SUPPLY_GATHERING_CENTER FS_MONEY_STORAGE NOT_AUTOACQUIRABLE AUTO_ACQUIRABLE_BY_AI COVER"

and in the behaviors section:
CODE

<DistributedMoney
id="ModuleTag_DistributedMoney"
Capacity="2000"
OnDieSpawnPercentage="25" />
<SupplyCenterCreate />
<SupplyCenterDockUpdate
id="SupplyCenter"
NumberApproachPositions="-1"
AllowsPassthrough="true"
GoToRallyPointAfterDock="true"
ShouldDockInReverse="true"
MinDockTime="9s"
ObjectsInLineWeight="9s"
DistributedDeposit="true">
<ForVoiceRetreatThisIsASafeHarborToObjectFilter
Include="HARVESTER" />
</SupplyCenterDockUpdate>

I tried to put FS_MONEY_STORAGE and SUPPLY_GATHERING_CENTER in the KindOf section of the Harvester, and copy and pasted the behavior section listed above in the refinery xml file into the behavior section of the Harvester but have had no success. I guess my question then becomes, how do I see the code behind the FS_MONEY_STORAGE and SUPPLY_GATHERING_CENTER elements or the behavior elements?

#2 CommieDog

CommieDog
  • Project Team
  • 81 posts
  • Location:Alaska (where even gravity is bigger)

Posted 05 January 2009 - 06:00 AM

I don't think what you want can be done in TW. The Tiberium logic has too many hard-coded components, like the docking requirement.
CommieDog™: The Original Proletarian Pet
Learn from your parents' mistakes: use birth control.

#3 Nighthawk

Nighthawk

    Grumble Grumble.

  • Division Leaders
  • 2,947 posts
  • Location:Edinburgh
  • Projects:The Third War, Ares, misc side projects.
  •  Strategist and Modder
  • Division:C&C Guild
  • Job:Division Leader
  • Association

Posted 05 January 2009 - 07:30 AM

Unless of course the MARV in Kane's Wrath used some long-undiscovered logic from C&C3 to create its drive-and-collect ability.
Posted Image
Posted Image
Job Openings with the Guild: Division Staff, News Posters.
Job Openings with Ares: Documentation Maintainer, Active Testers.

PM if interested.

#4 Golan

Golan
  • Members
  • 120 posts
  •  Off-Duty

Posted 05 January 2009 - 10:59 AM

You could try giving the harvester a dummy weapon that automatically kills nearby Tiberium and receives a bounty for each "kill".

Posted Image


#5 curteck

curteck
  • New Members
  • 3 posts

Posted 05 January 2009 - 08:44 PM

You could try giving the harvester a dummy weapon that automatically kills nearby Tiberium and receives a bounty for each "kill".

That sounds like a good idea. I don't have the Kane's Wrath expansion so if someone could post the marv.xml file code I could take out the behavior elements that allows it to scoop up tiberium.

#6 Phil

Phil

    Force Majeure

  • Network Leaders
  • 7,976 posts
  • Location:Switzerland
  • Projects:Revora, C&C:Online
  •  Thought Police
  • Division:Revora
  • Job:Network Leader
  • Donated
  • Association

Posted 05 January 2009 - 08:47 PM

Unfortunately the KW files have not been released and cannot be extracted either :unsure:

revorapresident.jpg
My Political Compass

Sieben Elefanten hatte Herr Dschin
Und da war dann noch der achte.
Sieben waren wild und der achte war zahm
Und der achte war's, der sie bewachte.


#7 curteck

curteck
  • New Members
  • 3 posts

Posted 06 January 2009 - 04:50 AM

You could try giving the harvester a dummy weapon that automatically kills nearby Tiberium and receives a bounty for each "kill".

I was looking at the xml files for the "bounty" behavior code, but I can't find it. In fact a search shows there's no file with the word bounty in it. Where do I get the "bounty" behavior code from? Turning the tiberium into something that can be killed with a money value doesn't sound too hard...

#8 Golan

Golan
  • Members
  • 120 posts
  •  Off-Duty

Posted 08 January 2009 - 10:37 AM

I haven´t used this code often, only seen it in one of Asuka´s and Stygs´ mods, so take this as more of a rough guideline - it should work this way, but I might be missing something.

First, you have to define the value of the crystals. To do so, add BountyValue="####" (where #### is whatever you want Tiberium to be worth) to the TiberiumCrystal´s and TiberiumCrystalBlue´s GameObject element (the first element that also defines cost, buildtime etc.).

Next, you have to enable the bounty by using an AttributeModifier. It should look like this:
<AttributeModifier
			id="AttributeModifier_TibBounty"
			Category="NONE"
			Duration="1s"
			StackingLimit="1" >
			<Modifier Type="BOUNTY_PERCENTAGE" Value="100"/>
		</AttributeModifier>

Now, all you need is a weapon that applies this to the crystals and then kills them. Make sure to have the Damage triggered after the AttributeModifier though (but before it runs out):
<WeaponTemplate
		  id="TiberiumReaper"
		  Name="TiberiumReaper" 
		  ProjectileCollidesWith  = "ALLIES ENEMIES NEUTRAL STRUCTURES WALLS" 
		  RadiusDamageAffects="ALLIES ENEMIES NEUTRALS" >
		<Nuggets>
			<DamageNugget
				Damage="99999" 
				DelayTimeSeconds="0.5s" 
				DamageType="CANNON" 
				Radius="10" 
				DeathType="NORMAL" >
				<SpecialObjectFilter Rule="NONE">
						<IncludeThing>TiberiumCrystal</IncludeThing>
						<IncludeThing>TiberiumCrystalBlue</IncludeThing>
				</SpecialObjectFilter>
			</DamageNugget>
					  
			<AttributeModifierNugget
				PartitionFilterTestType="SPHERE"
				AttributeModifierName="AttributeModifier_TibBounty"
				Radius="10">
				<SpecialObjectFilter Rule="NONE">
						<IncludeThing>TiberiumCrystal</IncludeThing>
						<IncludeThing>TiberiumCrystalBlue</IncludeThing>
				</SpecialObjectFilter>
			</AttributeModifierNugget>
		</Nuggets>
	</WeaponTemplate>

Add this to the harvester with a FireWeaponUpdate (FireWeaponCollide could work too) and you´re ready to go.

Note that AttributeModifiers seem to have a hardcoded minimum update frequency, so you might have to increase the delays and durations a bit.

Edited by Golan, 08 January 2009 - 10:38 AM.

Posted Image





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users