-
Notifications
You must be signed in to change notification settings - Fork 5
2.1 Introduction
XeoNovaDan edited this page Mar 4, 2020
·
7 revisions
Turret Extensions also adds a new comp called CompUpgradable
, a comp that allows for you to make upgradable turrets, both new and existing. Just like with most other comps, you define the properties for CompUpgradable via CompProperties_Upgradable
this.
CompUpgradable
can be used alongside TurretFrameworkExtension
too, but it'll also function just fine without.
To make a turret upgradable, you'd use XML that's similar to the following:
<ThingDef ParentName="BuildingBase">
<defName>MyNewTurret</defName>
<!-- some standard turret XML goes here -->
<comps>
<!-- standard turret comps go here -->
<li Class="TurretExtensions.CompProperties_Upgradable">
<!-- properties go here -->
</li>
</comps>
<!-- more turret XML goes here -->
</ThingDef>
<Operation Class="PatchOperationAdd">
<!-- assuming that the turret has comps, which it most likely will -->
<xpath>/Defs/ThingDef[defName="SomeExistingTurret"]/comps</xpath>
<value>
<li Class="TurretExtensions.CompProperties_Upgradable">
<!-- properties go here -->
</li>
</value>
</Operation>
<li Class="TurretExtensions.CompProperties_Upgradable">
<!-- Basics -->
<description></description>
<upgradedTurretDescription></upgradedTurretDescription>
<!-- Costs -->
<costStuffCount>0</costStuffCount>
<costList></costList>
<researchPrerequisites></researchPrerequisites>
<workToUpgrade>1</workToUpgrade>
<constructionSkillPrerequisite>0</constructionSkillPrerequisite>
<!-- Job Driver -->
<upgradeWorkFactorStuff>true</upgradeWorkFactorStuff>
<upgradeFailable>true</upgradeFailable>
<upgradeEffect></upgradeEffect>
<upgradeSuccessChanceFactor>1</upgradeSuccessChanceFactor>
<upgradeFailMinorResourcesRecovered>0.5</upgradeFailMinorResourcesRecovered>
<upgradeFailMinorResourcesRecovered>0</upgradeFailMinorResourcesRecovered>
<upgradeFailAlwaysMajor>false</upgradeFailAlwaysMajor>
<upgradeFailMajorDmgPctRange>
<min>0.1</min>
<max>0.5</max>
</upgradeFailMajorDmgPctRange>
<upgradeFailMajorChanceFactor>2</upgradeFailMajorChanceFactor>
<!-- Results -->
<statOffsets></statOffsets>
<statFactors></statFactors>
<graphicData></graphicData>
<turretTopDrawSize>2</turretTopDrawSize>
<turretTopOffset></turretTopOffset>
<fuelCapacityFactor>1</fuelCapacityFactor>
<fuelMultiplierFactor>1</fuelMultiplierFactor>
<basePowerConsumptionFactor>1</basePowerConsumptionFactor>
<turretBurstWarmupTimeFactor>1</turretBurstWarmupTimeFactor>
<turretBurstCooldownTimeFactor>1</turretBurstCooldownTimeFactor>
<turretGunDef></turretGunDef>
<firingArc>-1</firingArc>
<manningPawnShootingAccuracyOffsetBonus>0</manningPawnShootingAccuracyOffsetBonus>
<canForceAttack></canForceAttack>
<affectedByEMP></affectedByEMP>
<!-- Destroyed -->
<baseResouceDropPct>0.75</baseResouceDropPct>
<destroyedResourceDropPct>0.25</destroyedResourceDropPct>
</li>
These are explained more in-depth on the 'Comp Properties' page.
Next: Comp Properties
1 - Basic Framework Extension
1.1 - Introduction
1.2 - Properties
1.3 - An Example
2 - Upgradability
2.1 - Introduction
2.2 - Properties
2.3 - An Example
3 - Miscellaneous
3.1 - Smarter Forced Targeting