-
Notifications
You must be signed in to change notification settings - Fork 62
Examples
Joshua edited this page Jun 12, 2023
·
6 revisions
Here is an example patch operation that adds two verbs to every animal:
<Operation Class="PatchOperationAdd">
<xpath>/Defs/ThingDef[@Name = "AnimalThingBase"]</xpath>
<value>
<verbs>
<li>
<verbClass>Verb_Shoot</verbClass>
<accuracyTouch>1</accuracyTouch>
<accuracyShort>1</accuracyShort>
<accuracyMedium>0</accuracyMedium>
<accuracyLong>0</accuracyLong>
<hasStandardCommand>true</hasStandardCommand>
<defaultProjectile>Bullet_PurgeRifle</defaultProjectile>
<warmupTime>1</warmupTime>
<burstShotCount>1</burstShotCount>
<minRange>1</minRange>
<range>20</range>
<label>short range</label>
<muzzleFlashScale>0</muzzleFlashScale>
</li>
<li>
<verbClass>Verb_Shoot</verbClass>
<accuracyTouch>0</accuracyTouch>
<accuracyShort>0</accuracyShort>
<accuracyMedium>1</accuracyMedium>
<accuracyLong>1</accuracyLong>
<hasStandardCommand>true</hasStandardCommand>
<defaultProjectile>Bullet_PurgeRailgun</defaultProjectile>
<warmupTime>1</warmupTime>
<burstShotCount>1</burstShotCount>
<minRange>20</minRange>
<range>30</range>
<label>long range</label>
<muzzleFlashScale>0</muzzleFlashScale>
</li>
</verbs>
</value>
</Operation>Here is an example of a hediff that adds an independently firing and rendered minigun to the pawn.
<HediffDef ParentName="ImplantHediffBase">
<defName>TorsoMinigun</defName>
<label>mounted minigun</label>
<labelNoun>a mounted minigun</labelNoun>
<description>A minigun mounted to the torso.</description>
<comps>
<li Class="MVCF.Comps.HediffCompProperties_ExtendedVerbGiver">
<verbs>
<li>
<verbClass>Verb_Shoot</verbClass>
<label>minigun</label>
<hasStandardCommand>true</hasStandardCommand>
<defaultProjectile>Bullet_Minigun</defaultProjectile>
<warmupTime>2.5</warmupTime>
<range>30.9</range>
<burstShotCount>25</burstShotCount>
<ticksBetweenBurstShots>5</ticksBetweenBurstShots>
<soundCast>Shot_Minigun</soundCast>
<soundCastTail>GunTail_Medium</soundCastTail>
<muzzleFlashScale>9</muzzleFlashScale>
<commandIcon>Things/Item/Equipment/WeaponRanged/Minigun</commandIcon>
</li>
</verbs>
<verbProps>
<li>
<label>minigun</label>
<canBeToggled>true</canBeToggled>
<comps>
<li Class="MVCF.VerbComps.VerbCompProperties_Turret">
<compClass>MVCF.VerbComps.VerbComp_Turret</compClass>
<graphic>
<texPath>Things/Item/Equipment/WeaponRanged/Minigun</texPath>
<graphicClass>Graphic_Single</graphicClass>
</graphic>
</li>
</comps>
</li>
</verbProps>
</li>
</comps>
</HediffDef>This is a verb on a hediff that needs to be reloaded and also has a cooldown.
<HediffDef ParentName="ImplantHediffBase">
<defName>FF_SwarmWristImplant</defName>
<label>whistling birds</label>
<labelNoun>a whistling birds</labelNoun>
<description>An installed whistling birds.</description>
<descriptionHyperlinks><ThingDef>FF_SwarmWristImplant</ThingDef></descriptionHyperlinks>
<spawnThingOnRemoved>FF_SwarmWristImplant</spawnThingOnRemoved>
<comps>
<li Class="MVCF.Comps.HediffCompProperties_ExtendedVerbGiver">
<verbs>
<li>
<verbClass>Verb_Shoot</verbClass>
<label>whistling birds</label>
<hasStandardCommand>True</hasStandardCommand>
<defaultProjectile>Bullet_FF_SwarmRocket</defaultProjectile>
<forcedMissRadius>4.9</forcedMissRadius>
<burstShotCount>8</burstShotCount>
<ticksBetweenBurstShots>10</ticksBetweenBurstShots>
<warmupTime>0.5</warmupTime>
<ai_AvoidFriendlyFireRadius>5</ai_AvoidFriendlyFireRadius>
<range>21.9</range>
<soundCast>InfernoCannon_Fire</soundCast>
<soundCastTail>GunTail_Heavy</soundCastTail>
<onlyManualCast>true</onlyManualCast>
<stopBurstWithoutLos>false</stopBurstWithoutLos>
<targetParams>
<canTargetLocations>true</canTargetLocations>
</targetParams>
<muzzleFlashScale>14</muzzleFlashScale>
</li>
</verbs>
<verbProps>
<li>
<label>whistling birds</label>
<canBeToggled>true</canBeToggled>
<comps>
<li Class="MVCF.VerbComps.VerbCompProperties_Cooldown">
<compClass>MVCF.VerbComps.VerbComp_Cooldown</compClass>
<cooldownTime>600</cooldownTime>
</li>
<li Class="MVCF.Reloading.Comps.VerbCompProperties_Reloadable">
<compClass>MVCF.Reloading.Comps.VerbComp_Reloadable</compClass>
<AmmoFilter>
<thingDefs>
<li>Chemfuel</li>
</thingDefs>
</AmmoFilter>
<ItemsPerShot>5</ItemsPerShot>
<MaxShots>8</MaxShots>
<ReloadSound>Reload_Standard</ReloadSound>
<ReloadTimePerShot>1</ReloadTimePerShot>
</li>
</comps>
</li>
</verbProps>
</li>
</comps>
</HediffDef>Here is an example of a weapon with multiple verbs, where one has its own texture and fires independently:
<ThingDef ParentName="BaseHumanMakeableGun">
<defName>MVCF_Gun_SuperChargeRifle</defName>
<label>super charge rifle</label>
<description>A charged-shot assault rifle. Pulse-charge technology charges each shot with unstable energy as it leaves the barrel. Released on impact, the charged energy greatly increases the damage done.</description>
<techLevel>Spacer</techLevel>
<graphicData>
<texPath>Things/Item/Equipment/WeaponRanged/ChargeRifle</texPath>
<graphicClass>Graphic_Single</graphicClass>
</graphicData>
<soundInteract>Interact_ChargeRifle</soundInteract>
<statBases>
<Mass>4.6</Mass>
<AccuracyTouch>0.55</AccuracyTouch>
<AccuracyShort>0.64</AccuracyShort>
<AccuracyMedium>0.55</AccuracyMedium>
<AccuracyLong>0.45</AccuracyLong>
<RangedWeapon_Cooldown>2.00</RangedWeapon_Cooldown>
</statBases>
<verbs>
<li>
<verbClass>Verb_Shoot</verbClass>
<hasStandardCommand>true</hasStandardCommand>
<defaultProjectile>Bullet_ChargeRifle</defaultProjectile>
<warmupTime>1.0</warmupTime>
<range>25.9</range>
<ticksBetweenBurstShots>12</ticksBetweenBurstShots>
<burstShotCount>3</burstShotCount>
<soundCast>Shot_ChargeRifle</soundCast>
<soundCastTail>GunTail_Medium</soundCastTail>
<muzzleFlashScale>9</muzzleFlashScale>
<label>primary</label>
</li>
<li>
<verbClass>Verb_Shoot</verbClass>
<hasStandardCommand>true</hasStandardCommand>
<defaultProjectile>Bullet_ChargeLance</defaultProjectile>
<warmupTime>1.7</warmupTime>
<range>29.9</range>
<soundCast>ChargeLance_Fire</soundCast>
<soundCastTail>GunTail_Heavy</soundCastTail>
<muzzleFlashScale>9</muzzleFlashScale>
<label>secondary</label>
</li>
</verbs>
<comps Inherit="False">
<li Class="MVCF.Comps.CompProperties_VerbProps">
<compClass>CompEquippable</compClass>
<verbProps>
<li>
<label>secondary</label>
<canBeToggled>true</canBeToggled>
<comps>
<li Class="MVCF.VerbComps.VerbCompProperties_Turret">
<compClass>MVCF.VerbComps.VerbComp_Turret</compClass>
<graphic>
<texPath>Things/Item/Equipment/WeaponRanged/ChargeLance</texPath>
<graphicClass>Graphic_Single</graphicClass>
</graphic>
</li>
</comps>
</li>
<li>
<label>primary</label>
<canBeToggled>true</canBeToggled>
</li>
</verbProps>
</li>
</comps>
</ThingDef>Here is an example of a piece of armor with an attack: (Credit to Fraudecon)
<ThingDef ParentName="ApparelArmorReconBase">
<defName>Test_SteamArmor</defName>
<label>steam armor</label>
<description>A suit of armor with an onboard steam generator that steadily creates steam pressure. This steam can be used to power additional steam devices including accessories, apparel, and weapons. It also comes with an internal steam repeater.</description>
<apparel>
<tags>
<li>SpacerMilitary</li>
</tags>
</apparel>
<verbs>
<li>
<verbClass>Verb_Shoot</verbClass>
<label>steamshot</label>
<defaultProjectile>Bullet_AutocannonTurret</defaultProjectile>
<warmupTime>0</warmupTime>
<minRange>8.9</minRange>
<range>32.9</range>
<ticksBetweenBurstShots>17</ticksBetweenBurstShots>
<burstShotCount>3</burstShotCount>
<soundCast>Shot_Autocannon</soundCast>
<soundCastTail>GunTail_Heavy</soundCastTail>
<muzzleFlashScale>12</muzzleFlashScale>
</li>
</verbs>
<tickerType>Normal</tickerType>
<comps>
<li Class="MVCF.Comps.CompProperties_VerbGiver">
<verbProps>
<li>
<label>steamshot</label>
<visualLabel>steam autocannon</visualLabel>
<canBeToggled>true</canBeToggled>
<description>A mounted steam-based autocannon</description>
</li>
</verbProps>
</li>
</comps>
</ThingDef>- Abilities
- Aesthetic scaling
- Animal Behaviours
- Apparels
- Buildings
- Cooking
- Factions
- Genes
- Global
- Graphics
- Hediffs
- Maps
- Memes
- OptionalFeatures
- Pawns
- Planet
- Plants
- Storyteller
- Things
- Weapons
- Weathers
- PipeSystem basics
- Resource
- Resource storage
- Resource processor
- Resource to thing
- Resource to power
- Thing to resource
- Resource trader
- Refill building with pipes
- Pipe valve
- Advanced Resource Processor
- Update to KCSG 2.0
- Exporting buildings
- Customizing symbols
- Debug helpers options
- Custom faction settlement
- Custom structure and scenarios
- Custom structure in quests
- Custom structure in WorldObjects
- Biome based structures
- Spawning world object(s) at world generation
- Prevent settlement spawning for nomadic factions