Skip to content

Ammo Trimming Sections

BDCarrillo edited this page Jul 14, 2023 · 12 revisions

You can delete sections that will not be needed/used. The only special consideration is DamageScales. If you don't need it, set NoGridOrArmorScaling = true and then delete away.

Invisible frag, bare minimum, NOT A PRIMARY AMMO FIRED FROM A WEAPON:

private AmmoDef Example_Ammo => new AmmoDef
{
    AmmoMagazine = "Energy",
    AmmoRound = "YourAmmoName",
    BaseDamage = 100,
    NoGridOrArmorScaling = true, 
    Trajectory = new TrajectoryDef
    {
        MaxLifeTime = 3600,
	MaxTrajectory = 300,
	DesiredSpeed = 300,
    },
};

Invisible frag with grid/armor modifiers, NOT A PRIMARY AMMO FIRED FROM A WEAPON:

private AmmoDef Example_Ammo => new AmmoDef
{
    AmmoMagazine = "Energy",
    AmmoRound = "YourAmmoName",
    BaseDamage = 100,
    Trajectory = new TrajectoryDef
    {
        MaxLifeTime = 3600,
	MaxTrajectory = 300,
	DesiredSpeed = 300,
    },
    DamageScales = new DamageScaleDef
    {
        Grids = new GridSizeDef
        {
            Large = 0.5f,
            Small = 1.5f,
        },
        Armor = new ArmorDef
        {
            Armor = -1f,
            Light = -1f,
            Heavy = -1f,
            NonArmor = -1f,
        },
    },
};

Minimum for a tracer, suitable as a primary from a weapon:

private AmmoDef Example_Ammo => new AmmoDef
{
    AmmoMagazine = "Energy",
    AmmoRound = "YourAmmoName",
    BaseDamage = 100,
    HardPointUsable = true,
    NoGridOrArmorScaling = true, 
    Trajectory = new TrajectoryDef
    {
        MaxLifeTime = 3600,
	MaxTrajectory = 300,
	DesiredSpeed = 300,
    },
    AmmoGraphics = new GraphicDef
    {
	VisualProbability = 1f,
	Lines = new LineDef
	{
	   Tracer = new TracerBaseDef
	   {
	       Enable = true,
	       Length = 10f,
	       Width = 0.1f,
	       Color = Color(red: 5, green: 2, blue: 1f, alpha: 1),
	       Textures = new[] {"ProjectileTrailLine",},
	   },
	},
    },
};
Clone this wiki locally