Skip to content

Ammo Properties

BDCarrillo edited this page Dec 1, 2022 · 25 revisions

Ammo Properties


Base Config Section

private AmmoDef ExampleAmmoClassID => new AmmoDef // Ammo Class ID
        {
            AmmoMagazine = "Energy", // SubtypeId of physical ammo magazine. Use "Energy" for weapons without physical ammo.
            AmmoRound = "Ammo 1", // Name of ammo in terminal, should be different for each ammo type used by the same weapon. Is used by Shrapnel.
            HybridRound = false, // Use both a physical ammo magazine and energy per shot.
            EnergyCost = 0.1f, // Scaler for energy per shot (EnergyCost * BaseDamage * (RateOfFire / 3600) * BarrelsPerShot * TrajectilesPerBarrel). Uses EffectStrength instead of BaseDamage if EWAR.
            BaseDamage = 111f, // Direct damage; one steel plate is worth 100.
            Mass = 0f, // In kilograms; how much force the impact will apply to the target.
            Health = 0, // How much damage the projectile can take from other projectiles (base of 1 per hit) before dying; 0 disables this and makes the projectile untargetable.
            BackKickForce = 0f, // Recoil. This is applied to the Parent Grid.
            DecayPerShot = 0f, // Damage to the firing weapon itself. 
			       //float.MaxValue will drop the weapon to the first build state and destroy all components used for construction
			       //If greater than cube integrity it will remove the cube upon firing, without causing deformation (makes it look like the whole "block" flew away)
            HardPointUsable = true, // Whether this is a primary ammo type fired directly by the turret. Set to false if this is a shrapnel ammoType and you don't want the turret to be able to select it directly.
            EnergyMagazineSize = 1, // For energy weapons, how many shots to fire before reloading.
            IgnoreWater = false, // Whether the projectile should be able to penetrate water when using WaterMod.
            IgnoreVoxels = false, // Whether the projectile should be able to penetrate voxels.
            Synchronize = false, // Be careful, do not use on high fire rate weapons.  Only works on drones and Smart projectiles.  Will only work on chained/staged fragments with a frag count of 1, will no longer sync once frag chain > 1.
            HeatModifier = -1f, // Allows this ammo to modify the amount of heat the weapon produces per shot.
            NpcSafe = false, // This is you tell npc modders that your ammo was designed with them in mind, if they tell you otherwise set this to false.

The Basic Header, for an Ammo

AmmoMagazine = "MagazineID",// Energy, for Energy-Based weapons This is your AmmoMagazine SBC SubtypeID, allowing it to consume ammo mags. To make a weapon an energy weapon (pure energy, no magazine consumption), set this ID to "Energy".

You do not need to make a Magazine named "Energy", there is an "Energy" AmmoMagazine entry in WeaponCore itself. Do not override it.

AmmoRound = "AmmoName",

This is the unique identifier for each ammo type, and is displayed in the terminal as the name of the ammo. Use this to specify ammos in Shrapnel and Pattern defs, and for server config ammo modifiers.

HybridRound = false, //AmmoMagazine based weapon with energy cost

This Line enables, or disables, the Energy Cost, when an Non-"Energy" Magazine ID is given.

BaseDamage = 5000f,

This is your basic damage pool, from which the HP of the block that is hit is deducted. Once depleted, the projectile is considered at end of life. This value is identical to the Keen GridDamage value, where each steel plate in a block is worth 100.

Health = 2, // 0 = disabled, otherwise how much damage it can take from other trajectiles before dying.

Health is the projectile's HP pool when facing Anti-Missile Weapons, and has no relation outside of EWAR & AMS. Values for AMS & HP are in 1-3 Ranges for most projectiles.

Projectiles with Health are valid targets for AMS weapons. Projectiles with a Health of 0 are NOT targetable or interceptable.

Mass = 220f, // in kilograms
BackKickForce = 60f,

Mass is the force applied onto the target hit by the Projectile, while BackickForce is the force (recoil) applied onto the shooter.


Shape & Objects Hit Sections

Shape = new ShapeDef // Defines the collision shape of the projectile, defaults to LineShape and uses the visual Line Length if set to 0.
            {
                Shape = LineShape, // LineShape or SphereShape. Do not use SphereShape for fast moving projectiles if you care about precision.
                Diameter = 1, // Diameter is minimum length of LineShape or minimum diameter of SphereShape.
            },
ObjectsHit = new ObjectsHitDef
            {
                MaxObjectsHit = 0, // Limits the number of entities (grids, players, projectiles) the projectile can penetrate; 0 = unlimited.
                CountBlocks = false, // Counts individual blocks, not just entities hit.
            },

Shape, is your Projectile's non-visual shape, used for hit detection.

  • LineShape is a line
  • SphereShape is a sphere

ObjectsHit, is an Old & alternate method of handling Penetration weapons, and can be used to hard-lock the max number of blocks (Or grids) penetrated by a projectile.


Shrapnel/Fragment Section

Fragments, or shrapnel, are spawned upon the death of the current projectile. There are many options to control the quantity and distribution of fragments, detailed at the Ammo - Fragment Properties page.


Damage Scales Section

Damage Scales are modifiers that alter how much damage is applied to various items, block types, or shields. For full details please visit Ammo - Damage Scales


Area Of Effect Section

These effects can apply damage to a range of blocks based upon custom settings. They can be thought of as blast, explosive, splash, etc. Consult Ammo - AOE Properties for specifics.

There is an additional group of effects, collectively called EWAR, that can be utilized as well. IF ANY EWAR SETTING IS USED, BASE OR AOE DAMAGE WILL NOT BE APPLIED! They go above and beyond basic damage, with unique alterations to block or grid behavior. Full details can be found on the Ammo - Electronic Warfare System (EWAR) page.


Beam Section

Beams = new BeamDef
            {
                Enable = false, // Enable beam behaviour. Please have 3600 RPM, when this Setting is enabled. Please do not fire Beams into Voxels.
                VirtualBeams = false, // Only one damaging beam, but with the effectiveness of the visual beams combined (better performance).
                ConvergeBeams = false, // When using virtual beams, converge the visual beams to the location of the real beam.
                RotateRealBeam = false, // The real beam is rotated between all visual beams, instead of centered between them.
                OneParticle = false, // Only spawn one particle hit per beam weapon.
            },

Enable, converts this weapon to a Beam; This means projectile's desired speed is ignored, and the Projectile expects a weapon RPM of 3600.

Beams can curve', track, use shrapnel, or the like, however they are hitscan, unless the TravelTime Line is added in the Trajectory Section. MaxTrajectoryTime = 600, , This line is in ticks (60 Ticks per Second)

Virtual Beams, if enabled, means only 1 beam actively deals damage , triggers shrapnel, or damages voxel, but takes all beams of this type, fired by the Weapon, and merges their damage stats.

Converge, visually merges the beam effects, into the "Hot" Beam.

OneParticle, reduces particle generation to 1 particle per target hit: This is suggested.

Beams, require a Tracer & Trail, to function Properly.


Trajectory Section

Trajectory = new TrajectoryDef
            {
                Guidance = None, // None, Remote, TravelTo, Smart, DetectTravelTo, DetectSmart, DetectFixed
                TargetLossDegree = 80f, // Degrees, Is pointed forward
                TargetLossTime = 0, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
                MaxLifeTime = 900, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..). time begins at 0 and time must EXCEED this value to trigger "time > maxValue". Please have a value for this, It stops Bad things.
                AccelPerSec = 0f, // Acceleration in Meters Per Second. Projectile starts on tick 0 at its parents (weapon/other projectiles) travel velocity.
                DesiredSpeed = 500, // voxel phasing if you go above 5100
                MaxTrajectory = 1000f, // Max Distance the projectile or beam can Travel.
                DeaccelTime = 0, // 0 is disabled, a value causes the projectile to come to rest overtime, (Measured in game ticks, 60 = 1 second)
                GravityMultiplier = 0f, // Gravity multiplier, influences the trajectory of the projectile, value greater than 0 to enable. Natural Gravity Only.
                SpeedVariance = Random(start: 0, end: 0), // subtracts value from DesiredSpeed. Be warned, you can make your projectile go backwards.
                RangeVariance = Random(start: 0, end: 0), // subtracts value from MaxTrajectory
                MaxTrajectoryTime = 0, // How long the weapon must fire before it reaches MaxTrajectory.
                TotalAcceleration = 1234.5, // 0 means no limit, something to do due with a thing called delta and something called v.

Visit the Ammo - Guidance System (Homing, Mines, Self-Guided) for details on the options for the Guidance Line, Smarts, and Approaches.

MaxLifeTime = 1500, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..)., is the Max life spawn, in ticks, for the projectile, this is typically used to ensure the death of a projectile, should it fail to hit either a target or MaxTrajectory Distance.

AccelPerSec = 0,, is in Meters, and the Acceleration per second of the Projectile, this is used by SMART type weapons, and can be disabled by leaving it at 0: Which lets the projectile spawn at DesiredSpeed directly.

DesiredSpeed = 1250, is in Meters, and is the projectile's intended velocity before randomizers (which are optional)

MaxTrajectory = 7000f, is in Meters, and is the max range or distance, the Projectile can travel.

GravityMultiplier = 0f, // Gravity influences the trajectory of the projectile. is the influence of Planetary Gravity (Not Artificial), on the projectile, this line can not be used with the SMART system, unless using Shrapnel.

  SpeedVariance = Random(start: 0, end: 0), // subtracts value from DesiredSpeed
                RangeVariance = Random(start: 0, end: 0), // subtracts value from MaxTrajectory

These are Randomizers, with min & max value ranges, that adjust these values, per projectile fired.


Graphics Section

 AmmoGraphics = new GraphicDef
            {
                ModelName = "", // Model Path goes here.  "\\Models\\Ammo\\Starcore_Arrow_Missile_Large"
                VisualProbability = 1f, // %
                ShieldHitDraw = false,
                Decals = new DecalDef
                {
                    MaxAge = 3600,
                    Map = new[]
                    {
                        new TextureMapDef
                        {
                            HitMaterial = "Metal",
                            DecalMaterial = "GunBullet",
                        },
                        new TextureMapDef
                        {
                            HitMaterial = "Glass",
                            DecalMaterial = "GunBullet",
                        },
                    },
                },
                Particles = new AmmoParticleDef
                {
                    Ammo = new ParticleDef
                    {
                        Name = "", //ShipWelderArc
                        Offset = Vector(x: 0, y: 0, z: 0),
                        DisableCameraCulling = true,// If not true will not cull when not in view of camera, be careful with this and only use if you know you need it
                        Extras = new ParticleOptionDef
                        {
                            Scale = 1,
                        },
                    },
                    Hit = new ParticleDef
                    {
                        Name = "",
                        ApplyToShield = true,
                        Offset = Vector(x: 0, y: 0, z: 0),
                        DisableCameraCulling = true, // If not true will not cull when not in view of camera, be careful with this and only use if you know you need it
                        Extras = new ParticleOptionDef
                        {
                            Scale = 1,
                            HitPlayChance = 1f,
                        },
                    },
                    Eject = new ParticleDef
                    {
                        Name = "",
                        ApplyToShield = true,
                        Offset = Vector(x: 0, y: 0, z: 0),
                        DisableCameraCulling = true, // If not true will not cull when not in view of camera, be careful with this and only use if you know you need it
                        Extras = new ParticleOptionDef
                        {
                            Scale = 1,
                            HitPlayChance = 1f,
                        },
                    },
                },

Model if left blank, disables spawning a mesh-based object: ModelName = "\\Models\\Ammo\\MissileModel", , is an example of a valid model path for this.

VisualProbility is in %, of how often your Model is visible per projectile.

This next section, handles a Particle SBC SubtypeID, and spawns it on your projectile.

   Hit = new ParticleDef
                    {
                        Name = "ParticleSubtypeID",
                        ApplyToShield = true,
                        ShrinkByDistance = true,
                        Color = Color(red: 255, green: 45, blue: 45, alpha: 32),
                        Offset = Vector(x: 0, y: 0, z: 0),
                        Extras = new ParticleOptionDef
                        {
                            Loop = true,
                            Restart = false,
                            MaxDistance = 5000,
                            MaxDuration = 1,
                            Scale = 1f,
                            HitPlayChance = 1f,
                        },
                    },

This is an Particle SBC subtypeID Slot, for your wanted Particle when the projectile hits a target.

ApplytoShield, controls if the Projectile still generates this particle if it hits a shield.


Tracer Section

                Lines = new LineDef
                {
                    ColorVariance = Random(start: 0.75f, end: 2f), // multiply the color by random values within range.
                    WidthVariance = Random(start: 0f, end: 0f), // adds random value to default width (negatives shrinks width)
                    Tracer = new TracerBaseDef
                    {
                        Enable = true,
                        Length = 5f, //
                        Width = 0.1f, //
                        Color = Color(red: 3, green: 2, blue: 1f, alpha: 1), // RBG 255 is Neon Glowing, 100 is Quite Bright.
                        VisualFadeStart = 0, // Number of ticks the weapon has been firing before projectiles begin to fade their color
                        VisualFadeEnd = 0, // How many ticks after fade began before it will be invisible.
                        Textures = new[] {// WeaponLaser, ProjectileTrailLine, WarpBubble, etc..
                            "WeaponLaser", // Please always have this Line set, if this Section is enabled.
                        },
                        TextureMode = Normal, // Normal, Cycle, Chaos, Wave
                        Segmentation = new SegmentDef
                        {
                            Enable = false, // If true Tracer TextureMode is ignored
                            Textures = new[] {
                                "", // Please always have this Line set, if this Section is enabled.
                            },
                            SegmentLength = 0f, // Uses the values below.
                            SegmentGap = 0f, // Uses Tracer textures and values
                            Speed = 1f, // meters per second
                            Color = Color(red: 1, green: 2, blue: 2.5f, alpha: 1),
                            WidthMultiplier = 1f,
                            Reverse = false, 
                            UseLineVariance = true,
                            WidthVariance = Random(start: 0f, end: 0f),
                            ColorVariance = Random(start: 0f, end: 0f)
                        }
                    },
                    Trail = new TrailDef
                    {
                        Enable = false,
                        Textures = new[] {
                            "", // Please always have this Line set, if this Section is enabled.
                        },
                        TextureMode = Normal,
                        DecayTime = 3, // In Ticks. 1 = 1 Additional Tracer generated per motion, 33 is 33 lines drawn per projectile. Keep this number low.
                        Color = Color(red: 0, green: 0, blue: 1, alpha: 1),
                        Back = false,
                        CustomWidth = 0,
                        UseWidthVariance = false,
                        UseColorFade = true,
                    },
                    OffsetEffect = new OffsetEffectDef
                    {
                        MaxOffset = 0,// 0 offset value disables this effect
                        MinLength = 0.2f,
                        MaxLength = 3,
                    },
                },
            },

The Tracer Section in Full.

 Tracer = new TracerBaseDef
                    {
                        Enable = true, // If Tracer will be used.
                        Length = 5f, // Line Length \ Distance
                        Width = 0.1f, // Line Thickness. 
                        Color = Color(red: 3, green: 2, blue: 1f, alpha: 1),

Basic Tracer section

  • Length is the Length of the Tracer element itself, width is the actual width of the line
  • Color is RGBA, with emissive support; Numbers in the 100-255 range have extensive bloom
  Textures = new[] {// WeaponLaser, ProjectileTrailLine, WarpBubble, etc..
                            "WeaponLaser",
                        },
                        TextureMode = Normal, // Normal, Cycle, Chaos, Wave
                        Segmentation = new SegmentDef
                        {
                            Enable = false, // If true Tracer TextureMode is ignored
                            Textures = new[] {
                                "",
                            },
                            SegmentLength = 0f, // Uses the values below.
                            SegmentGap = 0f, // Uses Tracer textures and values
                            Speed = 1f, // meters per second
                            Color = Color(red: 1, green: 2, blue: 2.5f, alpha: 1),
                            WidthMultiplier = 1f,
                            Reverse = false,
                            UseLineVariance = true,
                            WidthVariance = Random(start: 0f, end: 0f),
                            ColorVariance = Random(start: 0f, end: 0f)
                        }
                    },

Animated Tracer section.

Textures area, refers to SubtypeIDs from an TransparentMaterials SBC, and specific texture method; DDS BC3 or DDS BC7, with a custom series of tracer textures' aligned & split into strips.

 Trail = new TrailDef
                    {
                        Enable = false, // If Trail is spawned.
                        Textures = new[] {
                            "",
                        },
                        TextureMode = Normal,
                        DecayTime = 1, //  Time in Ticks, (60 per second), that the trail exists. 120 means 2 seconds before each trail section despawns.
                        Color = Color(red: 0, green: 0, blue: 1, alpha: 1),
                        Back = false,
                        CustomWidth = 0,
                        UseWidthVariance = false, 
                        UseColorFade = true,
                    },
                    OffsetEffect = new OffsetEffectDef
                    {
                        MaxOffset = 0,// 0 offset value disables this effect
                        MinLength = 0.2f,
                        MaxLength = 3,
                    },

This is spawned, when enabled , behind your Tracer on the projectile.

Decay, is the lifespan in seconds, of your Trail behind the projectile; Longer decay times is more expensive.


Audio Section

AmmoAudio = new AmmoAudioDef // Audio, references SubtypeIDs from Audio SBC.
            {
                TravelSound = "",
                HitSound = "",
                ShieldHitSound = "",
                PlayerHitSound = "",
                VoxelHitSound = "",
                FloatingHitSound = "",
                HitPlayChance = 0.5f,
                HitPlayShield = true,

These are expecting Audio SBC SubtypeIDs, and are played relative to the projectile.


Clone this wiki locally