Skip to content

MakeshiftProperties

juanosarg edited this page Jun 4, 2026 · 3 revisions

<- Back

MakeshiftProperties is a def extension that turns a weapon into a makeshift weapon from Vanilla Weapons Expanded - Makeshift

      public IntRange shots = new IntRange(0, 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_MakeshiftShoot in the weapon!

For example, the makeshift pistol in Vanilla Weapons Expanded - Makeshift:

<verbs>
	<li>
		<verbClass>VEF.Weapons.Verb_MakeshiftShoot</verbClass>
		<hasStandardCommand>true</hasStandardCommand>
		<defaultProjectile>VWE_Bullet_MakeshiftPistol</defaultProjectile>
		<warmupTime>0.6</warmupTime>
		<range>19.9</range>
		<ticksBetweenBurstShots>10</ticksBetweenBurstShots>
		<soundCast>Shot_Autopistol</soundCast>
		<soundCastTail>GunTail_Light</soundCastTail>
		<muzzleFlashScale>9</muzzleFlashScale>
	</li>
</verbs>

And then:

<modExtensions>
	<li Class="VEF.Weapons.MakeshiftProperties">
		<shots>0~1</shots>
	</li>
</modExtensions>

Current limitation

At the moment Verb_MakeshiftShoot inherits from Verb_ShootWithSmoke, and that needs MoteProperties to be defined too. If you need them to be separated please let us know

Clone this wiki locally