-
Notifications
You must be signed in to change notification settings - Fork 5
1.1 Introduction
XeoNovaDan edited this page Feb 29, 2020
·
10 revisions
Turret Extensions adds a new mod extension called TurretFrameworkExtension
to open up previously hardcoded or unavailable values to XML, which can now be easily modified. You can create new turrets that are dependent on Turret Extensions, or add values from TurretFrameworkExtension
to existing turrets via XPath patching.
If you're unfamiliar with XPath patching, you can learn more about it here.
To do either of the above, you'd use XML that's similar to the following:
<ThingDef ParentName="BuildingBase">
<defName>MyNewTurret</defName>
<!-- standard turret XML goes here -->
<modExtensions>
<li Class="TurretExtensions.TurretFrameworkExtension">
<!-- properties go here -->
</li>
</modExtensions>
</ThingDef>
<Operation Class="PatchOperationAddModExtension">
<xpath>/Defs/ThingDef[defName="SomeExistingTurret"]</xpath>
<value>
<li Class="TurretExtensions.TurretFrameworkExtension">
<!-- properties go here -->
</li>
</value>
</Operation>
A full list of properties that TurretFrameworkExtension currently opens up, along with their default values:
<li Class="TurretExtensions.TurretFrameworkExtension">
<gunFaceDirectionOnSpawn>Unspecified</gunFaceDirectionOnSpawn>
<firingArc>360</firingArc>
<useManningPawnShootingAccuracy>true</useManningPawnShootingAccuracy>
<useManningPawnAimingDelayFactor>true</useManningPawnAimingDelayFactor>
<manningPawnShootingAccuracyOffset>0</manningPawnShootingAccuracyOffset>
<canForceAttack>false</canForceAttack>
<affectedByEMP>true</affectedByEMP>
</li>
These are explained more in-depth on the 'Properties' page.
Next: 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