File overview: wpn

From Starsector Wiki
Jump to navigation Jump to search

Description

The .wpn file along with an entry in weapon_data.csv contain all of the information directly about a weapon, with the .proj file defining the projectile. The more commonly changed balance information is in the csv and the less commonly changed information is in this .wpn file. It is formatted in Starsector's somewhat loose JSON schema

Examples

Gun weapon example

Arbalest Autocannon

{

   "id":"arbalest",  # this id must match what's in the spreadsheet

   "specClass":"projectile",

   "type":"BALLISTIC",

   "size":"MEDIUM",

   "displayArcRadius":700,

   #"turretUnderSprite":"graphics/weapons/arbalest_turret_under.png",

   "turretSprite":"graphics/weapons/arbalest_turret_base.png",

   "turretGunSprite":"graphics/weapons/arbalest_turret_recoil.png",

   #"hardpointUnderSprite":"graphics/weapons/arbalest_hardpoint_under.png",

   "hardpointSprite":"graphics/weapons/arbalest_hardpoint_base.png",

   "hardpointGunSprite":"graphics/weapons/arbalest_hardpoint_recoil.png",	

   "visualRecoil":6.0,  # the gun sprites are only used if this is non-0

   "renderHints":[RENDER_BARREL_BELOW],

   "turretOffsets":[13, 0],

   "turretAngleOffsets":[0],

   "hardpointOffsets":[28, 0],

   "hardpointAngleOffsets":[0],

   "barrelMode":"ALTERNATING", # or LINKED.  whether barrels fire at the same time or alternate.

   "animationType":"MUZZLE_FLASH",  # NONE, GLOW, MUZZLE_FLASH, SMOKE

   "muzzleFlashSpec":{"length":40.0,   # only used if animationType = MUZZLE_FLASH

   				   "spread":20.0,

   				   "particleSizeMin":16.0,

   				   "particleSizeRange":18.0,

   				   "particleDuration":0.5,

   				   "particleCount":20,

   				  "particleColor":[255,225,225,235]},

   "projectileSpecId":"arbalest_shot",  # projectile that will be fired	

   "fireSoundTwo":"autocannon_fire",

} 


Beam weapon example

Tactical Laser

{

   "specClass":"beam",

   #"beamEffect":"com.fs.starfarer.api.impl.combat.IonBeamEffect",

   "id":"taclaser",

   "type":"ENERGY",

   "size":"SMALL",

   "turretSprite":"graphics/weapons/tactical_laser_turret.png",

   "turretGlowSprite":"graphics/weapons/tactical_laser_turret_glow.png",

   "hardpointSprite":"graphics/weapons/tactical_laser_hardpoint.png",

   "hardpointGlowSprite":"graphics/weapons/tactical_laser_hardpoint_glow.png",

   "turretOffsets":[10, 0],

   "turretAngleOffsets":[0],

   "hardpointOffsets":[15, 0],

   "hardpointAngleOffsets":[0],

   "fringeColor":[0,255,0,225],

   "coreColor":[255,255,255,255],

   "glowColor":[155,255,155,255],

   #"fringeColor":[155,0,0,255],

   #"coreColor":[255,255,255,255],

   #"glowColor":[255,100,100,255],	

   "width":13.0,

   "textureType":ROUGH,

   #"textureType":["graphics/fx/beam_chunky_fringe.png","graphics/fx/beam_chunky_core.png"],

   "textureScrollSpeed":72.0,

   "pixelsPerTexel":5.0,

   "pierceSet":[PROJECTILE_FF,PROJECTILE_NO_FF,PROJECTILE_FIGHTER,MISSILE_FF,MISSILE_NO_FF],

   "fireSoundOne":"laser_intro",

   "fireSoundTwo":"laser_loop",	
} 



Elements

id

Unique projectile ID used to reference this projectile in scripts or by projectileSpecId in a .wpn file. String

specClass

  • projectile

spawnType

  • BALLISTIC_AS_BEAM
  • BALLISTIC
  • BEAM
  • PLASMA

pierceSet

  • RAY
  • RAY_FIGHTER
  • PROJECTILE_NO_FF
  • PROJECTILE_FF
  • PROJECTILE_FIGHTER
  • NONE

collisionClassByFighter

  • RAY_FIGHTER
  • PROJECTILE_FIGHTER

length

hitGlowRadius

width

fadeTime

fadeout duration. Number

fringeColor

Affects color of beam (R, G, B, Alpha). If darkCore set to TRUE, only affects fringes of the beam.

coreColor

Used in conjunction with darkCore set to TRUE. Beam core color (R, G, B, Alpha)

convergeOnPoint

Boolean

textureScrollSpeed

pixelsPerTexel

bulletSprite

behaviorSpec

  • behavior
PROXIMITY_FUSE, MIRV
  • shotRangeVariance
  • range
  • explosionSpec

textureType

  • ROUGH
  • SMOOTH
  • LASER
This can be seen in the Ion Beam weapon.
  • Custom png
Can specify a png file, with file path

darkCore

boolean, determines whether or not fringeColor tints the entire beam/projectile instead of just the area outside the core. Setting this to TRUE keeps the core and fringe colors completely separate.

onHitEffect

Denotes a script that will trigger on the frame after the projectile collides

glowRadius

glowColor

showDamageWhenDecorative

Boolean

renderBelowAllWeapons

Boolean

everyFrameEffect

Qualified location of script, to run every frame. Take note that this includes when the ship is destroyed, which may be unwanted behaviour and warrant including a check of if the ship is alive in the script

autocharge

Whether the weapon will continue charging and fire if the LMB is tapped instead of held. Defaults to FALSE. Boolean

renderHints

  • RENDER_ADDITIVE
  • RENDER_LOADED_MISSILES_UNLESS_HIDDEN
  • RENDER_BARREL_BELOW
  • RENDER_LOADED_MISSILES
  • SUSPEND_RECOIL

animationType

Optional built in animations. Possible types GLOW, MUZZLE_FLASH, SMOKE. See also .wpn_File_Overview#turretGlowSprite, .wpn_File_Overview#hardpointGlowSprite, .wpn_File_Overview#muzzleFlashSpec or .wpn_File_Overview#smokeSpec

muzzleFlashSpec

Configuration for the optional built in muzzle flash animation, if it is enabled via .wpn_File_Overview#animationType
  • length
  • spread
  • particleSizeMin
  • particleSizeRange
  • particleDuration
  • particleCount
  • particleColor

smokeSpec

Configuration for the optional built in smoke animation, if it is enabled via .wpn_File_Overview#animationType
  • particleSizeMin
  • particleSizeRange
  • cloudParticleCount
  • cloudDuration
  • cloudRadius
  • blowbackParticleCount
  • blowbackDuration
  • blowbackLength
  • blowbackSpread
  • particleColor

turretGlowSprite

Sprite used for the option built in glow animation, if it is enabled via .wpn_File_Overview#animationType

hardpointGlowSprite

Sprite used for the option built in glow animation, if it is enabled via .wpn_File_Overview#animationType



Vanilla only uses these ones on missiles


center

Defined centerpoint of this missile. Cartesian coordinate

size

Display size of the sprite. If the actual sprite is a different size than this then it will be shrunk or stretched to fit. Height & width in pixels

explosionColor

Purely visual, will get a white additively blended core on top of this color. RGBA

explosionRadius

purely visual, related to explosionColor. Number

engineSpec

  • turnAcc
Number
  • turnRate
Number
  • acc
Number
  • dec
Number

engineSlots

Specifications of the engine(s) on the missile. Array of arrays
  • id
Non-global missile specific engine ID for each engine. String
  • loc
Location of this engine. Cartesian coordinate
  • style
Which engine style to use as defined in \data\config\engine_styles.json . Can be CUSTOM, which will use the supplied styleSpec in this .proj file. String
  • styleSpec
If style = CUSTOM then use these style settings.
  • mode
PARTICLES or QUAD_STRIP, determines which params are used
  • engineColor
RGBA
  • contrailDuration
Number
  • contrailWidthMult
Number
  • contrailWidthAddedFractionAtEnd
can be negative. makes trail spread out/narrow at the end. Number
  • contrailMinSeg
min segment length, in pixels. Number
  • contrailMaxSpeedMult
Float
  • contrailAngularVelocityMult
Float
  • contrailSpawnDistMult
how far away from engine it starts. Float
  • contrailColor
RGBA
  • type
GLOW or SMOKE; additive or regular blend mode
  • width
Number
  • length
Number
  • angle
Degrees

missileType

Which type of missile AI is used. String
  • MISSILE: Default missile AI. Think Atropos and Harpoons.
  • MISSILE_TWO_STAGE_SECOND_UNGUIDED: Has initial guidance but once it accelerates it can't turn anymore. Squalls are your friends. Will trigger MissileAPI.isGuided().
  • ROCKET: No guidance allowed. Blocks MissileAPI.isGuided(). Think your Reapers and Hammers.
  • HEATSEEKER: Like missile but will prefer to target engines as its guidance. Salamander uses this.
  • MIRV: Sabots and Hurricane use this, but you don't need this for MIRV missiles. There seems to be a preference... for the AI to be more willing to use?
  • TORPEDO: Unused, replaced by ROCKET.
  • FLARE: "Flare Launchers". They don't seem to have any AI if any. Used in a lot of ships.
  • FLARE_SEEKER: "aka Active Flare Launchers" that will actively chase missiles and other ship targets.. can be used as a weapon ironically. (See SWP Flare Gun)
  • FLARE_JAMMER: "aka Decoy Flare Launchers" used for fighter flares that will orbit a SHIP target to annoy point-defenses.
  • BOMB: Launch at the initial velocity, no guidance behavior. See Piranha Bomber.
  • BOMB_WITH_SLOW: Takes BOMB behavior and slows down with its deceleration stat.
  • BOMB_WITH_ACCEL: Takes BOMB behavior and go faster with its acceleration stat.
  • PHASE_CHARGE: Proximity Charge Launcher uses this, nothing unique?
  • PHASE_MINE: Unused at the moment?
  • NO_AI: Do nothing.

armingTime

Delay before warhead is armed, in seconds. Number (usually decimal)

noEngineGlowTime

time spent without the engine glow being rendered. Number

flameoutTime

total time from flameout to full fadeout. Number

maxFlightTime

Number

collisionClassAfterFlameout

collisionRadius

Number

separateRecoilForLinkedBarrels

Calculate recoil separately for simultaneous multi-barrel shots. Boolean

fireSoundOne

FireSoundOne is the actual "bang" sound. It plays when the beam actually starts firing, or (if it has a visible chargeup) once it reaches full power. Sound ID, from sounds.json

fireSoundTwo

FireSoundTwo is the loop that continues to play as long as the beam is firing, and is immediately cut when it turns off. Sound ID, from sounds.json

numFrames

This is used to trigger & also set up simple animation of the weapon itself when firing. Check Simple weapon animation, relates to frameRate. Number

frameRate

This is used to set up simple animation of the weapon itself when firing. Check Simple weapon animation, relates to numFrames. Number

turretOffsets

Location of weapon barrels, where projectiles/beams come out for turrets. Only for turrets, for hardpoints see .wpn_File_Overview#hardpointOffsets. Expressed as coordinates and supports multiple barrels. Array of coordinates

hardpointOffsets

Location of weapon barrels, where projectiles/beams come out for turrets. Only for hardpoints, for turrets see .wpn_File_Overview#turretOffsets. Expressed as coordinates and supports multiple barrels. Array of coordinates

turretAngleOffsets

Relatively angle offset of each of the turret offsets defined in .wpn_File_Overview?action=edit#turretOffsets with 0 degrees being forward (as normal). Must be an equal number of angle offsets to match number of offsets. Array of numbers

hardpointAngelOffsets

Relatively angle offset of each of the hardpoint offsets defined in .wpn_File_Overview?action=edit#hardpointOffsets with 0 degrees being forward (as normal). Must be an equal number of angle offsets to match number of offsets. Array of numbers

noShieldImpactSounds

noNonShieldImpactSounds

Icon cross.png
At least two versions out of date. Last verified for version 0.8.1a. Please refer to Version History and update this page.


Return to: Modding