-
Notifications
You must be signed in to change notification settings - Fork 90
Adding specific gun functionality for CE patches
As a way to aid patch makers in choosing the right XML code to introduce gun functionality, some pointers:
Certain guns can fire bullets from multiple barrels at the same time. This can simply be introduced as below.
<ThingDef ParentName="BaseHumanMakeableGun">
<verbs>
<li Class="CombatExtended.VerbPropertiesCE">
<ticksBetweenBurstShots>-1</ticksBetweenBurstShots>
<burstShotCount>2</burstShotCount>
</li>
</verbs>
<comps>
<li Class="CombatExtended.CompProperties_FireModes">
<noSingleShot>TRUE</noSingleShot>
<aiUseBurstMode>TRUE</aiUseBurstMode>
</li>
</comps>
</ThingDef>
The part within "verbs" is crucial. Due to an oversight in vanilla code, negative values are allowed for ticksBetweenBurstShots. Vanilla otherwise adds 1 to your XML value, so setting it negative allows a time between shots of 0 ticks, e.g instantaneously. Then, burstShotCount can be as small or large as you want. CombatExtended will handle the loss in magazine ammo appropriately. The part within "comps" ensures that ONLY all barrels can be fired at once (noSingleShot), and if noSingleShot is false, aiUseBurstMode ensures that enemies always fire multiple barrels at once.