-
Notifications
You must be signed in to change notification settings - Fork 63
Shrapnel_projectiles
juanosarg edited this page Jun 4, 2026
·
1 revision
Projectile_Shrapnel allows you to make projectiles that subdivide into other projectiles when impacting
You will need a projectile with this class, as well as projectiles with the Projectile_ShrapnelPiece class.
Assign the Projectile_Shrapnel class to any projectile's def:
<thingClass>VEF.Weapons.Projectile_Shrapnel</thingClass>Assign the Projectile_ShrapnelPiece class to any projectile's def that you want to act as the shrapnel pieces:
<thingClass>VEF.Weapons.Projectile_Shrapnel</thingClass>Finally, you will need new properties on the tag of the first item to handle the shrapnel creation, using ProjectileProperties_Shrapnel:
public class ProjectileProperties_Shrapnel : ProjectileProperties
{
public float angleVariance;
public int shrapnelCount;
public ThingDef shrapnelProjectile;
public float shrapnelRange;
}An example, shrapnel shells in Vanilla Factions Expanded - Deserters:
<ThingDef ParentName="BaseBullet">
<defName>VFED_Bullet_Shell_Shrapnel</defName>
<label>shrapnel shell</label>
<graphicData>
<texPath>Projectiles/ShellShrapnel</texPath>
<graphicClass>Graphic_Single</graphicClass>
<shaderType>TransparentPostLight</shaderType>
</graphicData>
<thingClass>VEF.Weapons.Projectile_Shrapnel</thingClass>
<projectile Class="VEF.Weapons.ProjectileProperties_Shrapnel">
<damageDef>Bomb</damageDef>
<speed>41</speed>
<explosionRadius>2.9</explosionRadius>
<flyOverhead>true</flyOverhead>
<soundHitThickRoof>Artillery_HitThickRoof</soundHitThickRoof>
<soundExplode>MortarBomb_Explode</soundExplode>
<soundImpactAnticipate>MortarRound_PreImpact</soundImpactAnticipate>
<soundAmbient>MortarRound_Ambient</soundAmbient>
<shrapnelProjectile>VFED_Bullet_Shrapnel</shrapnelProjectile>
<shrapnelCount>24</shrapnelCount>
<shrapnelRange>16.5</shrapnelRange>
<angleVariance>25</angleVariance>
</projectile>
</ThingDef>
<ThingDef ParentName="BaseBullet">
<defName>VFED_Bullet_Shrapnel</defName>
<label>shrapnel</label>
<thingClass>VEF.Weapons.Projectile_ShrapnelPiece</thingClass>
<graphicData>
<texPath>Things/Projectile/Bullet_Small</texPath>
<graphicClass>Graphic_Single</graphicClass>
</graphicData>
<projectile>
<damageDef>Bullet</damageDef>
<damageAmountBase>12</damageAmountBase>
<speed>55</speed>
</projectile>
</ThingDef>- Abilities
- Animal Behaviours
- Apparels
- Buildings
- Cooking
- Factions
- Genes
- Global
- Graphics
- Hediffs
- Maps
- Memes
- OptionalFeatures
- Pawns
- Planet
- Plants
- Storyteller
- Things
- Weapons
- Weathers
- PipeSystem basics
- Resource
- Resource storage
- Resource processor
- Resource to thing
- Resource to power
- Thing to resource
- Resource trader
- Refill building with pipes
- Pipe valve
- Advanced Resource Processor
- Update to KCSG 2.0
- Exporting buildings
- Customizing symbols
- Debug helpers options
- Custom faction settlement
- Custom structure and scenarios
- Custom structure in quests
- Custom structure in WorldObjects
- Biome based structures
- Spawning world object(s) at world generation
- Prevent settlement spawning for nomadic factions