Weapondefs
These are the possible values for weapondefs.
Name | Description | Values |
---|---|---|
float
accuracy | How INaccurate are entire bursts? Larger is worse, 0 is perfect accuracy. This is an angle, so long range shots are always less likely to hit than close range given same target and inaccuracy. Can improve with unit XP. | |
bool
allowNonBlockingAim | When false, the weapon is blocked from firing until AimWeapon() returns. | |
float
alphaDecay | #Cannon only. See `stages`. Alpha reduction for the last stage (interpolated linearly for the others). |
|
bool
alwaysVisible | Is the projectile visible regardless of sight? | |
float3
animParams1 | Used to do flipbook style animation of texture1 |
|
float3
animParams2 | Used to do flipbook style animation of texture2 |
|
float3
animParams3 | Used to do flipbook style animation of texture3 |
|
float3
animParams4 | Used to do flipbook style animation of texture4 |
|
bool
avoidCloaked | Does the weapon avoid shooting if there's cloaked (incl. revealed, but not decloaked) units in the way? See remarks at `avoidFriendly` | |
bool
avoidFeature | Does the weapon avoid shooting if there's features in the way? See remarks at `avoidFriendly` |
|
bool
avoidFriendly | Does the weapon avoid shooting if there's allies in the way? Note that an ally can run into the projectile and it will still explode - use `collideFriendly` to avoid that |
|
bool
avoidGround | Does the weapon avoid shooting if terrain would block it? See remarks at `avoidFriendly` |
|
bool
avoidNeutral | Does the weapon avoid shooting if there's neutrals in the way? Note this does not mean Gaia! See also remarks at `avoidFriendly` | |
float
beamDecay | BeamLaser only. Controls the fadeout (multiplier for alpha per sim frame) |
|
int
beamTTL | BeamLaser and LightningCannon only. Linger time of the visual sprite, in sim frames. | |
bool
beamburst | #BeamLaser only. Lets a laser use burst mechanics, but sets `beamtime` to the duration of 1 sim frame. | |
float
beamtime | #BeamLaser only. The laser maintains it beam for this many seconds, spreading its damage over that time. |
|
string
bounceExplosionGenerator | The name, with prefix, of a CEG to be emitted when bouncing | |
float
bounceRebound | Vertical velocity multiplier on bounce |
|
float
bounceSlip | Horizontal velocity multiplier on bounce |
|
bool
burnblow | For LaserCannon, expire when reaching the target (at max range otherwise). For Cannon, explode when reaching the target (keep falling otherwise). For Missile/Starburst/TorpedoLauncher, explode when running out of fuel (fall down otherwise). | |
int
burst | Shots per burst. Cannot be used by #BeamLaser unless `beamburst` is used which comes with caveats. |
|
float
burstRate | Delay between shots within a burst, in seconds |
|
float
cameraShake | Passed to the wupget:ShockFront callin as the first argument, intended for shaking the camera on particularly strong hits. Same scale as damage. |
|
bool
canAttackGround | Can the unit target ground? Only units otherwise. Note, features are not directly targetable either way. |
|
bool
castShadow | Does the projectile itself cast shadow? |
|
string
cegTag | The name, without prefixes, of a CEG to be emitted by the projectile each frame. | |
bool
collideCloaked | Does the projectile collide with cloaked (includes revealed but not decloaked) units? See remarks at `collideFriendly` |
|
bool
collideEnemy | Does the projectile collide with enemies? Use to make sure it hits the ground, or for buffs targeting allies. Note that targeting will always target enemies anyway, and never allies. Also note there is no corresponding `avoidEnemy` |
|
bool
collideFeature | Does the projectile collide with features? See remarks at `collideFriendly` |
|
bool
collideFireBase | Does the projectile collide with its firebase, i.e. a transport holding the unit? Put it on marines' weapons to let them shoot out of a bunker while remaining in its colvol. There is no corresponding `avoidFirebase`. | |
bool
collideFriendly | Does the projectile collide with allies? Note that the unit will still shoot if there are allies in the way, which is controlled separately via `avoidFriendly`. |
|
bool
collideGround | Does the projectile collide with terrain? See remarks at `collideFriendly` |
|
bool
collideNeutral | Does the projectile collide with neutrals? Note this does not mean Gaia! See also remarks at `collideFriendly` |
|
bool
collideNonTarget | Does the projectile ghost through everything that isn't its target (incl. other enemies)? Combine with `tracks` and `impactOnly` for 'starcraft' style weapons that are largely just graphics. There is no corresponding `avoidNonTarget`. |
|
float
collisionSize | Width for hitscan interceptors. Supposed to be collision radius for others but it's broken at the moment |
|
string
colormap | A series of RGBA tuples. If the projectile is a sprite then it will shift over these colours over its lifetime | |
bool
commandfire | Does the weapon respond to the manual fire command instead of regular attack? | |
float
coreThickness | BeamLaser and LaserCannon only. Thickness of the inner core as a fraction of full thickness (0-1). Just to get a secondary color via `rgbColor2`. |
|
float
coverage | The radius in elmos within which an interceptor weapon will fire on targetable weapons. | |
float
craterAreaOfEffect | Diameter of terrain deformation. Damage to units controlled separately. Keep in mind about the inner half of this is the hole, and the outer half is the raised (!) rim |
|
float
craterBoost | A flat modifier to cratering strength, applies second-last (after reduction due to altitude). | |
float
craterMult | A multiplier to cratering strength. Applies after all other modifiers. |
|
table
customParams | A table of arbitrary string key-value pairs, for use by Lua gadgets (no engine meaning) | |
float
cylinderTargeting | Makes targeting happen in a cylinder. The height is range times this value. Zero means use the usual range (spherical or ballistic) |
|
table
damage | Damage table, indexed by armor class name | |
float
damage.default | The default damage used in absence of explicit per-armorclass value |
|
float
damageAreaOfEffect | The diameter (not radius!) for damage. Cratering controlled separately. Also the collision radius for projectile-based interceptors. |
|
float
dance | Missile only. Missiles will randomly shift up to this many elmos, perpendicular to their movement direction. Movement period is hardcoded to 8 sim frames |
|
float
duration | #LaserCannon only. The visual-only length of the projectile as a fraction of the per-second projectile speed. |
|
float
dynDamageExp | Exponent of the range-dependent damage formula, the default of 0.0 disables dynamic damage, 1.0 means linear scaling, 2.0 quadratic and so on. | |
bool
dynDamageInverted | If true the damage curve is inverted i.e. the weapon does more damage at greater ranges as opposed to less. | |
float
dynDamageMin | The minimum floor value that range-dependent damage can drop to. | |
float
dynDamageRange | If set to non-zero values the weapon will use this value in the range-dependant damage formula instead of the actual range. | |
float
edgeEffectiveness | Exponent for a magic formula describing splash damage falloff. The damage always drops down to 0, this tag just controls how large the 'core' is. Can be negative for a very core-centric explosion. 0 is linear falloff with radius. 1 is no falloff. |
|
float
energyPerShot | Energy cost per shot. For stockpile weapons this is consumed over time, immediately on shot otherwise. | |
string
explosionGenerator | The name, with prefix, of a CEG to be emitted on impact | |
bool
explosionScar | Does the explosion leave a scar decal on the ground? |
|
float
explosionSpeed | How fast does the shockwave propagate? Note that units cannot actually dodge the shockwave (they are tagged immediately and just damaged after a delay) | |
float
falloffRate | LaserCannon with `hardStop = false` only. How much, as a fraction, the laser fades per sim frame beyond max range. Capped to be 0.2 or above (ie. will never take more than 5 sim frames to fade completely) |
|
float
fireStarter | The percentage chance of the weapon setting fire to static map features on impact. |
|
bool
fireSubmersed | Can the weapon fire underwater? Requires `waterweapon`. |
|
float
firetolerance | Angle above which reaim (script `AimWeapon`) is forced outside the usual time-based reaim. In the legacy 16-bit angular units. |
|
bool
fixedLauncher | Missile/Torpedo/Starburst only. The projectile will start aimed at the direction of the aiming piece, which is not necessarily towards the target | |
float
flameGfxTime | #Flamethrower only. Multiplier of the total range for visuals purposes. For example at 1.2, the visual will extend 20% further than max range. Should be >= 1. Exposed back to WeaponDefs as `duration` (same as the unrelated #LaserCannon tag) | |
float
flighttime | Lifetime of the projectile, in seconds. Missile/Torpedo/Starburst projectiles 'lose fuel' and fall down; Cannons explode; others fade away |
|
bool
gravityAffected | #DGun weapon type only. Is the dgun projectile affected by gravity? Aiming won't take this into account. | |
bool
groundBounce | Bounces when hitting terrain? | |
bool
hardstop | LaserCannon only. If true, lasers get 'eaten up' at max range. Otherwise they continue on and fade away according to `intensityFalloff` (but can't collide anymore). | |
float
heightBoostFactor | #Cannon weapon type only. Controls the ballistic range gain/loss for height difference; larger means higher effect of range difference. -1 is derived some magic formula. Hard to tell how this stacks with `heightMod`. |
|
float
heightmod | Multiplies height difference to target, for targeting purposes. When lower than 1, the targeting volume becomes elongated vertically and the unit can target further high than normal (useful to make terrain and aircraft less punishing). At 0, the height difference component becomes completely ignored. |
|
int
highTrajectory | 0: low trajectory, 1: high trajectory, 2: the unit will have a state toggle for the player to pick |
|
bool
impactOnly | Does the projectile only damage a single thing it hits? Mostly equivalent to having 0 AoE without the issues with 0. Also removes cratering. | |
float
impulseBoost | A flat bonus to impulse. | |
float
impulseFactor | A multiplier to base impulse (knockback). For most weapons, base impulse is equal to applied damage. For #Melee weapons the base impulse is the hitting unit's mass. |
|
float
intensity | Alpha transparency for non-model projectiles. Lower values are more opaque, but 0.0 will cause the projectile to disappear entirely. |
|
bool
interceptSolo | If true no other interceptors may target the same projectile. |
|
unsigned int
interceptedByShieldType | Bitmask representing the types of shields that this weapon can intercept. Each digit of binary that is set to one means that a shield with the corresponding digit in its shieldInterceptType tag will be hit by this weapon. | |
int
interceptor | Bitmask representing the types of weapons that this weapon can intercept. Each digit of binary that is set to one means that a weapon with the corresponding digit in its targetable tag will be intercepted by this weapon. | |
bool
largeBeamLaser | BeamLaser only. Enables some extra fancy texturing (NOT size). Check other Beamlaser tags for 'large'. | |
float
laserFlareSize | BeamLaser only. Size of the flare visual effect at emit point, in elmos |
|
float
leadBonus | If `leadLimit` is not unlimited, add this value multiplied by raw unit XP (not limXP) to the limit. | |
float
leadLimit | Maximum distance in elmos the unit will lead a moving target. Less than zero is unlimited. |
|
int
lodDistance | LaserCannon only. Distance at which rendering is simplified, without the rounded ends |
|
float
metalPerShot | Metal cost per shot. For stockpile weapons this is consumed over time, immediately on shot otherwise. | |
float
minIntensity | BeamLaser only. The minimum percentage the weapon's damage can fall-off to over its range. Setting to 1.0 will disable fall off entirely. Unrelated to the visual-only `intensity`. Largely a duplicate of `dynDamageExp`. | |
string
model | Name of a 3D model. Otherwise uses 2D sprites | |
float
movingAccuracy | Same as `accuracy` but applies when the unit is moving. |
|
float
myGravity | Overrides the map gravity for ballistic weapons. The default of 0.0 disables the tag in favour of map gravity. | |
string
name | The descriptive name of the weapon, for GUI purposes. |
|
bool
noExplode | The projectile will not be removed when exploding and instead continue on. It will keep exploding every sim frame while inside a collision volume, massively multiplying nominal damage. | |
bool
noGap | #Cannon only. Makes `separation` adjust to take `sizeDecay` into account so `stages` stay adjacent. |
|
bool
noSelfDamage | Is the unit unable to damage itself with the weapon? | |
int
numBounce | How many bounces can the weapon do? Explodes on impact when cannot bounce anymore |
|
float
ownerExpAccWeight | How much does accuracy (but not sprayAngle!) improve with unit limXP? Multiplier for limXP which is then subtracted as a fraction (for example at limXP=0.4 and ownerExpAccWeight=2, the weapon only has 1-(0.4*2) = 20% of original inaccuracy. | |
int
paralyzeTime | Determines the maximum length of time in seconds that the target will be paralyzed. The timer is restarted every time the target is hit by the weapon. Cannot be less than 0. |
|
bool
paralyzer | Is the weapon a paralyzer? If true the weapon only stuns enemy units and does not cause damage in the form of lost hit-points. | |
float
predictBoost | How well the unit leads its targets. Between 0 and 1. At pb=0 it will over- or under-estimate target speed by between 0-2x its actual value. At pb=1 it will estimate speed perfectly. Keep in mind `leadLimit` can still make it undershoot. | |
int
projectiles | Projectiles per shot. Best used in conjunction with `sprayAngle` or changing the firing piece in script using ShotX as otherwise they'll all be clumped up in one blob. |
|
float
proximityPriority | Importance of distance when picking targets. Higher means closer units are preferred more; negative values make weapons prefer distant targets. |
|
float
pulseSpeed | 'Large' BeamLaser only. Frequency of beam pulsation (fade to zero alpha and back) in hertz |
|
float
range | Maximum targeting range. Ballistic weapons can resolve lower due to physics. Some weapons can also fly past that range if they miss. |
|
float
rechargeDelay | The delay in seconds before a shield begins to regenerate after it is hit. |
|
float
reloadTime | Reload time between bursts, in seconds. Note that reloadTime starts to count down from the first round fired, not the last, so if (reloadTime < burst * burstRate) the weapon will fire continuously. |
|
float3
rgbColor | Color of the sprite, when not using a model. #EmgCannon has a different default of 0.9/0.9/0.2. |
|
float3
rgbColor2 | BeamLaser and LaserCannon only. The color of the inner core of the sprite, see `coreThickness`. |
|
float
scarAlpha | Initial opacity of the scar decal (0-1) | |
float4
scarColorTint | Color tint for explosion scar decal. Scaled so that 0.5 is no change, 1.0 is twice as bright. |
|
float
scarDiameter | Diameter of the scar decal |
|
float
scarDotElimination | Specifies the exponent of dot product of projection vector and current terrain normal vector, this is used to remove to remove scar projection from surfaces that usually should not receive the ground scar effect, the exponent controls the degree of elimination. The default 0.0 means there will be no elimination at all. | |
float
scarGlow | Initial glow intensity of the scar decal (0-1) | |
string
scarGlowColorMap | A colormap (set of RGBA tuples) for the scar decal. Will smoothly fade between these colours over its lifetime. | |
float
scarGlowTtl | Duration of the glow of the scar, in seconds | |
table
scarIndices | A table of indices to the scar table in resources.lua | |
float4
scarProjVector | Forced direction of a ground scar projection (you can think of this technique as if the scar image was projected onto the ground from the cinema projector at certain world-space vector). If all zeroes, it will use ground normals. Realistically this should either be left at default, or set to {0, 1, 0} for orbital-type weapons |
|
float
scarTtl | Duration of the scar decal, in seconds | |
float
scrollSpeed | 'Large' BeamLaser only. Speed in elmo/s at which the tiled beam texture shifts. |
|
float
separation | #Cannon only. See `stages`. Multiplier for the default distance between stages |
|
float
shield.alpha | The alpha transparency of the shield whilst it is visible. |
|
string
shield.armorType | Specifies the armorclass of the shield; you can input either an armorclass name OR a unitdef name to share that unit's armorclass |
|
float4
shield.badColor | The RGBA colour the shield transitions to as its hit-points are reduced towards 0. |
|
float
shield.energyUse | The amount of the energy resource consumed by the shield to absorb or repulse weapons, continually drained by a repulsor as long as the projectile is in range. |
|
bool
shield.exterior | Determines whether or not projectiles fired within the shield's radius can pass through the shield (true) or are intercepted (false). |
|
float
shield.force | The force applied by the repulsor to the weapon - higher values will deflect weapons away at higher velocities. |
|
float4
shield.goodColor | The RGBA colour the shield transitions to as its hit-points are regenerated towards its maximum power. |
|
unsigned int
shield.interceptType | Bitmask representing the types of weapons that this shield can intercept. Each digit of binary that is set to one means that a weapon with the corresponding digit in its interceptedByShieldType will be intercepted by this shield (See [[Shield Interception Tag]] Use). |
|
float
shield.maxSpeed | The maximum speed the repulsor will impart to deflected projectiles. |
|
float
shield.power | Essentially the maximum allowed hit-points of the shield - reduced by the damage of a weapon upon impact. |
|
float
shield.powerRegen | How many hit-points the shield regenerates each second. |
|
float
shield.powerRegenEnergy | How much energy resource is consumed to regenerate each hit-point. |
|
float
shield.radius | The radius of the circular area the shield covers. |
|
bool
shield.repulser | Does the shield repulse (deflect) projectiles or absorb them? |
|
bool
shield.smart | Determines whether or not projectiles fired by allied units can pass through the shield (true) or are intercepted as enemy weapons are (false). |
|
float
shield.startingPower | How many hit-points the shield starts with - otherwise the shield must regenerate from 0 until it reaches maximum power. |
|
bool
shield.visible | Is the shield visible or not? |
|
int
shield.visibleHitFrames | The number of frames a shield becomes visible for when hit. |
|
bool
shield.visibleRepulse | Is the (hard-coded) repulse effect rendered or not? |
|
float
size | Size of the 2D visual sprite, if the weapon has no 'model' set. | |
float
sizeDecay | #Cannon only. See `stages`. Size reduction per stage, as a fraction of the first stage | |
float
sizeGrowth | #Flamethrower only. Visual-only radius growth in elmos per sim frame. |
|
float
smokeColor | Smoke trail brightness multiplier |
|
int
smokePeriod | Smoke trail update rate - the trail ribbon will make a new vertex this many sim frames. Use for high turn-rate homing missiles to prevent jagged edges. Smaller is smoother but more performance-heavy. |
|
float
smokeSize | Smoke trail size multiplier |
|
int
smokeTime | Smoke trail linger duration, in sim frames |
|
bool
smokeTrail | MissileLauncher only. Does it leave a smoke trail ribbon? | |
bool
smokeTrailCastShadow | Does the smoke trail cast shadow? |
|
string
soundHitDry | The sound emitted when hitting outside water. Note that a #BeamLaser will play this once per sim frame. |
|
float
soundHitDryVolume | Sound volume of the impact, outside water. -1 means autogenerate from damage. |
|
string
soundHitWet | The sound emitted when hitting in water. Note that a #BeamLaser will play this once per sim frame. |
|
float
soundHitWetVolume | Sound volume of the impact, inside water. -1 means autogenerate from damage. |
|
string
soundStart | The sound emitted when shooting the weapon. | |
float
soundStartVolume | Sound volume of the shot. -1 means autogenerated from damage. |
|
bool
soundTrigger | Does the weapon produce the shooting sound only once for the whole burst? If false, for each shot in a burst. | |
float
sprayAngle | How inaccurate are individual projectiles in a burst? | |
int
stages | #Cannon only. If `model` is not set then draw this many 2D sprites to simulate a sort of motion blur. |
|
float
startvelocity | Initial projectile speed in elmo/s |
|
bool
stockpile | Does each round of the weapon have to be built and stockpiled by the player? Will only correctly function for the first of each stockpiled weapons a unit has. | |
float
stockpileTime | The time in seconds taken to stockpile one round of the weapon. |
|
bool
submissile | Torpedo only. Lets torpedoes exit the water and be a missile. Lets underwater launchers shoot out-of-water targets (out-of-water launchers still cannot - use Missile instead of Torpedo for that). | |
bool
sweepFire | Makes BeamLasers continue firing while aiming for a new target, 'sweeping' across the terrain. | |
float
targetBorder | 1/-1 will target the close/far edge of the colvol (instead of center). Matters for huge colvols and/or small ranges |
|
float
targetMoveError | Fraction of target speed per second added as a random error. E.g. if target moves at 50 elmo/s and targetMoveError is 0.5 then a random vector of length up to 25 will be added to the target position | |
int
targetable | Bitmask representing the types of weapon that can intercept this weapon. Each digit of binary that is set to one means that a weapon with the corresponding digit in its interceptor tag will intercept this weapon. Instant-hitting weapons such as [#BeamLaser], [#LightningCannon] and [#Rifle] cannot be targeted. | |
string
textures.1 | When not using a model, sprite texture for AircraftBomb, Cannon, EMG, Flame; main beam texture for LaserCannon, BeamLaser, Lightning; flare texture for Missile, Starburst; dome for Shield. Note that DGun has a hardcoded texture. |
|
string
textures.2 | The end-of-beam texture for LaserCannon and BeamLaser (half of texture for each end); smoketrail for Missile and Starburst. Note that Torpedo has a hardcoded trail. |
|
string
textures.3 | Flare for non-'large' BeamLaser, or directional muzzle exhaust for 'large'; flame exhaust for Starburst. |
|
string
textures.4 | Flare for 'large' BeamLaser. |
|
float
thickness | LaserCannon, BeamLaser and Lightning only. How thicc is the laser? |
|
float
tileLength | 'Large' BeamLaser only. Length in elmos of a repeated texture tile for the beam. Regular BeamLaser just has a single stretched tile. |
|
float
tolerance | For `turret = false` only. Firing cone width, in the 16-bit legacy angular unit. |
|
bool
tracks | Missile/Torpedo/Starburst only. Does the projectile track its target (i.e. homing)? Requires a positive `turnRate`. | |
float
trajectoryHeight | Missile/Torpedo only. Causes the missile to fly in an arc. The value is the fraction of target distance as extra arc height (e.g. at 1.0 the arc is as tall as it is long). | |
float
turnrate | For projectiles with `tracks`, in COB angular units (65536 is tau) per second. Also the turn rate for Starburst when they stop ascending and turn towards target (regardless of homing). |
|
bool
turret | Does the unit aim within an arc (up-to and including full 360° turret traverse) or always aim along the owner's heading? | |
bool
waterBounce | Bounces when hitting the water surface? | |
bool
waterweapon | Can the projectile travel underwater? Ability to fire underwater controlled separately via `fireSubmersed` | |
float
weaponTimer | StarburstLauncher only. Seconds of vertical ascent | |
string
weaponType | Sets weapon type, which is a bundle of behaviours and visuals (check other tags). Available types (sorted from the most general): Cannon - ballistic projectile, defaults to 'plasma ball' visuals LaserCannon - non-ballistic projectile, defaults to 'slow laser' visuals (think stormtroopers) BeamLaser - hitscan weapon, laser visuals MissileLauncher - potentially homing projectile, leaves a smoke trail TorpedoLauncher - missile that can't exit water by default StarburstLauncher - missile with a vertical ascent phase at the beginning AircraftBomb - resolves into Torpedo or Cannon, but has support for being dropped by a bomber plane Flame - non-ballistic projectile, has a sprite which expands LightningCannon - hitscan weapon, lightning visuals Melee - just applies damage. No frontswing though DGun - deprecated, a fiery ball projectile. Has a lot of hardcoded visuals but does NOT convey 'dgun' mechanics. Prefer Cannon instead EmgCannon - deprecated, a version of Laser or Flame with crappy visuals Rifle - deprecated, more or less equivalent to invisible Lightning |
|
float
weaponVelocity | Maximum speed in elmo/s (won't accelerate further on its own) |
|
float
weaponacceleration | Acceleration in elmo/s^2 |
|
float
windup | Delay between firing and the first shot | |
float
wobble | Missile only. Missiles will turn towards random directions (new direction rolled every 16 sim frames). In legacy angular units per second. |
|