Skip to content

ExpandedShowTurretRadiusExtension

juanosarg edited this page Jun 3, 2026 · 2 revisions

<- Back

ExpandedShowTurretRadiusExtension is a def extension that adds a few custom behaviours for showing the radius of turrets.

      /// If specified, replaces the built-in check for supported verb classes with a check for this specific verb class.
      /// This checks only for this very specific verb class. However, if allowAnyVerb is also true, the check will also
      /// match any verbs based on that specific one (so for example, allowing for Verb_Shoot will also allow for Verb_ShootWithSmoke).
      /// This could come in handy for turrets that have multiple different verbs with different ranges, and we want to display a range for a specific       verb only.
      public Type allowedVerbClass = null;

      /// If true, the place worker will support any verb class (as long as there's any verb present).
      /// However, if allowedVerbClass is specified, it instead changes how that specific check works.
      public bool allowAnyVerb = false;


      /// Determines if the maximum range should be drawn for this turret.
      public bool drawMaxRange = true;

      /// Determines if the minimum range should be drawn for this turret.
      public bool drawMinRange = true;

How do I use this code?

This Def Extension is added to the ThingDef of the turret you want to add it to.

If you aren't sure if the ThingDef ALREADY has an extension (for example, if you think another mod will add their own), always use XPATH (xml patching) to add an extension, as there is already a PatchOperationAddModExtension to ensure they don't collide.

For example, the heavy incinerator complex in Vanilla Furniture Expanded-Security:

<modExtensions>
	<li Class="VEF.Weapons.ExpandedShowTurretRadiusExtension">
	        <allowedVerbClass>VFESecurity.Verb_BurnerFireSpew</allowedVerbClass>
	</li>
</modExtensions>

Clone this wiki locally