Configuration Files

Projectiles/Explosions (6.6)

Attaching a Projectile

If you are creating a projectile weapon, you will need to attach a projectile object. This is not just an Obj, but an entire object with the ProjectileObj in it. Here is what the Bazooka Man's projectile looks like.

CreateObjectType("army.proj.bazooka", "Projectile")
{
  MapObj()
  {
    GodFile("army_mortar_shell.god");
    GenericFX()
    {
      Add("ProjectileObj::Trail", "weapon.bazooka.proj");
    }
  }

  ProjectileObj()
  {
    TopSpeed(200);
    ProjectileModel("GuidedTrajectory");
    HomingRate(120);
    WaverTurn(30);
    WaverRate(180);
    AccelerationTime(2);
    Explosion("army.exp.bazooka");
  }
}

Add the projectile's visual effect, which you will define later, to the GenericFX list, then create the ProjectileObj.

ProjectileModel - This defines how the projectile moves. There are three types:

TopSpeed - Final speed of the projectile, once it has transitioned from the speed set in the weapon definition. This field only works for straight and guided trajectories.

AccelerationTime - Rate at which projectile transitions from its starting speed to it top speed.

HomingRate - Number of degrees per second that the projectile will turn in order to hit its target.

WaverTurn - Degree to which the projectile turns while moving. This is purely a visual effect and does not enhance the weapon's effectiveness.

WaverRate - Rate at which the projectile turns while moving. Also purely a visual effect.

Explosion - The name of the explosion that is created when the projectile hits its target. Should point to an existing explosion object.

Impact - This flag is set by default. It causes the projectile to detonate on impact. If a fuse is set then the projectile cannot detonate on impact and this flag is ignored.

Fuse - Time before the projectiles detonates in seconds.

Proximity - If the projectiles gets within this meter distance to its target, it detonates. This can be used in conjunction with the Impact and Fuse flags.

Attaching an Explosion

If an explosion is not specified in a projectile, it will refer to the weapon and do the damage specified in its damage field. If an explosion is specified, it will ignore all other damage amounts and create the explosion. Note that an explosion can also be attached to a unit's death or self-destruction. See the DumDum config for an example of how this is done.

CreateObjectType("army.exp.bazooka", "Explosion")
{
  MapObj()

  {
    Mesh();
    GenericFX()
    {
      Add("ExplosionObj::Explode", "weapon.bazooka.exp");
    }
  }
  ExplosionObj()
  {
    Damage()
    {
      Amount(45);

      Effective("infantry", 50%);
      Effective("vehicle", 100%);
      Effective("structure", 100%);
      Effective("flyer", 100%);
      Effective("mine", 100%);
    }
    AreaInner(4);
    AreaOuter(8);
    Weapon("army.weapon.bazooka");
  }
}

Add the explosion's visual effect, which you will define later, to the GenericFX list, then create the ExplosionObj.

Damage - This works the same as it does inside the weapon.

AreaInner - This is the radius in meters of the inner area of the explosion. Everything within this radius will take the full amount of damage specified in the damage field.

AreaOuter - This is the outer rim of the explosion radius. The amount of damage given will fall from 100% at the edge of the inner radius to 0% at the edge of the outer radius.

BlindTargetTime - The number of seconds to make victims of this explosion blindly target other units.
TODO: Does this effect even still exist in AMRTS? Pretty sure it doesn't...

Persist - How long the explosion persists for. It does the full amount of a damage for every 1/10 of a second that you specify. A value of 4 would be 4/10 of a second, thus it would inflict the full damage 4 times before disappearing.

TODO: Almost every projectile in AMRTS now refers back to its parent using Weapon. Why?

Adding Effects

The final aspect of a config is adding the effects. This can be very simple or very complicated. In either case, we're going to let the existing configs do the talking. There are dozens of particles and explosions defined. Take one of the existing ones and tweak it to your needs. What you've learned from the other config types should answer any questions that come up. Good Luck!
TODO: Straight from the DR2 guide lol Actually write a real one for AMRTS.