Weapons - Andreas-W/GeneralsGameCode_Modding GitHub Wiki

Weapon.ini

Scatter Target Improvements

Added new weapon parameters to tweak ScatterTargets

  • ScatterTargetAligned = No - (Aligns target pattern with the firing unit. Default = No)

  • ScatterTargetRandomOrder = Yes - (Use target points random or linear order. Default = Yes)

  • ScatterTargetRandomAngle = No - (Use a random angle for the target pattern. Default = No)

  • ScatterTargetMinScalar = 0 - (if > 0, the target scalar will be linearly scaled between min and max weapon range; ScatterTargetMinScalar defines the scalar at minimum range, while ScatterTargetScalar defines the value at maxium range.)

  • ScatterTargetCenteredAtShooter = No - (Scatter target coordinates will be used relative to the shooter's position instead of the target, i.e. the firing unit is considered to be at 0/0)

  • ScatterTargetResetTime = 0 (Duration in msec; Scatter targets will be reset after the unit is not firing for this amount of time)

These features can be used to e.g. fire a laser in a line, or create strafing runs for aircraft, by using a linear pattern with ScatterTargetAligned=Yes and ScatterTargetRandomOrder=No

** Examples: **

  Behavior = ScatterShotUpdate ModuleTag_Scatter
    Weapon = TomahawkMissileScatterWeapon    ; simple guided rocket weapon
    NumShots = 5
    TargetSearchRadius = 120.0    ; Pick targets in 120 range
    NoTargetsScatterRadius = 60.0   ; If no targets, scatter randomly in 60 radius
    MaxShotsPerTarget = 1       ; Fire at each targets once. If we have more than 5 targets, hit the ground randomly
    TriggerDistanceToTarget = 150.0   ; Trigger at this distance to target
  End

Pre Attack FX

Added new weapon parameters to define FXList that is played on PreAttack

  • PreAttackFX = <FXListEntry> - (FXList entry; played when PRE_ATTACK starts. Default = None)
  • VeterancyPreAttackFX = [VETERAN | ELITE | HEROIC] <FXListEntry> - (Veterancy level and FXList entry. played when PRE_ATTACK starts. Default = None)
  • PreAttackFXDelay = 200 - (Minimal delay in ms when PreAttack FX can be played again. In some situations, e.g. when following a moving target, PreAttack state can be entered repeatedly and this avoids spamming the FX. Default = 200)

Notes:

  • FXList will be aligned to the object's FireFX bone.
  • BulletTracer used in the FX will be aligned to the target.
  • TODO: Add flag to spawn FX at object's origin position instead.

Laser Improvements

Added improvements for lasers.

Continuous Laser

  • ContinuousLaserLoopTime = 0 - (time in ms. If this is > 0, the laser object will be kept and moved with the next shot, instead of creating a new laser object. Default = 0)

Note: This is can be used for continous laser weapons along with the new fade in/out and grow/shrink parameters in LaserUpdate

Detonation FX and OCL

  • ProjectileDetonationFX and ProjectileDetonationOCL are now supported for lasers. FX and OCL will be created at the target location.