-
Notifications
You must be signed in to change notification settings - Fork 63
CompProperties_HomingProjectile
CompProperties_HomingProjectile allows you to make projectiles for weapons that home in on their target, meaning they follow the target. As an example, think of how the Needler in Halo works. This code allows you to create something similar to that.
public float homingDistanceFractionPassed;
public float homingCorrectionTickRate;
public float initialDispersionFromTarget;
public SoundDef hitSound;It is a comp class, so you just add it in XML in the <comps> tag. For example, this is the degrade projectile in Vanilla Psycasts Expanded - Puppeteer
<comps>
<li Class="VEF.Weapons.CompProperties_HomingProjectile">
<homingDistanceFractionPassed>0.7</homingDistanceFractionPassed>
<homingCorrectionTickRate>5</homingCorrectionTickRate>
<initialDispersionFromTarget>2.5</initialDispersionFromTarget>
<hitSound>RM_Hit_Needler</hitSound>
</li>
</comps>0.7 defines how far away the target can be for the projectile to home in on. The higher the number, the greater the distance.
5 defines how often the projectile can change its angle. Here it can change its projectile every 5 ticks.
2.5 defines at what angle to the target the bullets will be fired from. This allows the weapon to shoot the bullets in different angles at the target, allow them to feel like a swarm homing in. Min value is 0.
RM_Hit_Needler defines a custom sound that is played when the projectile hits its target or something else, like a wall.
- 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