Skip to content

MoteProperties

juanosarg edited this page Jun 3, 2026 · 1 revision

<- Back

MoteProperties is a def extension that makes a weapon produce motes when firing

       private const float MoteSizer = 32f;
       public FloatRange? angleRange;
       public FleckDef fleckDef;
       public ThingDef moteDef;
       public int numTimesThrown = 1;
       public FloatRange? rotationRange;

       public float size = -1;
       public float velocity = -1;

How do I use this code?

This Def Extension is added to the ThingDef of the weapon 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.

You will also need Verb_ShootWithSmoke in the weapon!

For example, the thornworm in Vanilla Factions Expanded - Insectoids 2:

<modExtensions>
	<li Class="VEF.Weapons.MoteProperties">
		<fleckDef>DustPuffThick</fleckDef>
		<size>0.5</size>
		<!-- Multiplier -->
		<velocity>2</velocity>
		<!-- Fixed amount -->
		<angleRange>-15~15</angleRange>
		<!-- Negative: Counter-clockwise Positive: Clockwise -->
		<rotationRange>-5~5</rotationRange>
		<!-- Negative: Counter-clockwise Positive: Clockwise -->
		<numTimesThrown>1</numTimesThrown>
		<!-- Fixed amount -->
	</li>
</modExtensions>

Clone this wiki locally