Weapon data.csv

From Starsector Wiki
Jump to navigation Jump to search

Description

A .weapon file and a weapon_data.csv entry contain all of the information directly about a weapon. weapon_data.csv is expected in location \Starsector\mods\ExampleMod\data\weapons\weapon_data.csv . The more commonly balance tweaked information is in the weapon_data.csv while the less commonly edited information is in the .weapon file. weapon_data.csv is formatted comma delimited csv format. Projectile information is located separately in a referenced .proj file.

Discord user AxleMC131#5008 has made a handy infographic of how various stats are used by different weapon types, found here

Example

Elements

At the very top of weapon_data.csv, you will see a list of categories. Going from left to right, the function of each will be described:

name

The human-readable name of the weapon that is displayed in-game. This isn't the internal name for the weapon.

id

This is the internal name that is recognized by the code in the background. When modding, this weapon will be referenced everywhere by this ID. It will be used in .variant files, .wpn files, and campaign scripts. If you want to switch out a weapon for another in ship variants, this is the one you use. Remember, if you want to reference this weapon somewhere else, it is this designation that you use, not the one above. This must be unique within the mod, vanilla files and also any other mods. For this reason it is highly recommended to add some form of unique prefix such as myuniquemod_weaponid

tier

This partly controls the store availability of the weapon. Normal values range between 0-3 with a special case at 5. Tier 0 weapons are ubiquitous & can be bought on the open market; anything higher requires a progressively higher relationship with the faction for purchase on a military submarket. 3 is the highest tier in vanilla weapons. Tier >=5 weapons cannot appear in markets for purchase at all. Interacts with the rarity value, if any.
For weapons, higher tier means a lower chance of being available. For fighters, this isn't the case - there aren't enough fighters, i.e. there's no "Talon, but worse" and "Talon, but better" etc progression for each kind of fighter, so that didn't work very well. Instead, it just picks a couple of the available fighters for each autofit category.
com.fs.starfarer.api.impl.campaign.fleets.DefaultFleetInflater.java is a good place to look for the details; if you want specific behavior with regard to rarity etc, writing a custom one is probably the way to go. See also: CampaignPlugin.pickFleetInflater().[1]
Number

rarity

Between 0 and 1 with lower being rarer. For reference the Tachyon Lance is at rarity 0.5. Interacts with the tier.
Rarity is just for drops - it doesn't affect fleet composition or weapon/fighter selection at all. [2]Number

base value

How many credits the weapon costs in the campaign.

range

For projectile weapons - how far a projectile travels before it begins to fade out.
For beam weapons - how far a beam travels, no fade out. For missile weapons - how far from target an autofire AI can fire weapon (but not necessarily will). does not affect the actual distance the missile will travel, for that see flight time

damage/second

Used only for beam weapons. Determines how much damage is inflicted on the target per second.

damage/shot

Used for non-beam weapons. This determines how much damage is inflicted on a target per shot.

emp

This is the amount of EMP damage the weapon applies to the target per shot.

impact

Only affects fighters and asteroids. Affects any combat entity that can be affected by collisions, including asteroids, all ships and missiles. If a target hit by a weapon with sufficiently high(around 999999 for some ships) impact it will be gradually slowed to immobility and rotated in seemingly random direction. Missiles successfully affected by impact will never recover controls and can be considered disabled. Ships can recover as soon as the effect is lifted. Look at the graviton beam for reference. Missiles (and likely other projectiles) also use this as their mass value.

turn rate

The rate at which a turret can turn.

OPs

The ordnance points that the weapon requires for you to install into the weapons slot in your ship.

ammo

The total number of shots that a weapon can fire before a reload or end of combat. Leave null for unlimited ammo.

ammo/sec

The total number of shots that regenerate per second, taking reload size into account. For example say the clip size is 20. If ammo/second is .1, this means it takes 10 seconds for 1 ammo to regenerate. Since the clip size is 20, it would take 20 * 10 = 200 seconds per clip. A more reasonable ammo/second of 1 would mean a 20 second reload time per clip. Number

reload size

How many shots are added in a single reload event. Used to create clip style reloading. Defaults to 1. Number

type

Damage type. Can only be: KINETIC, ENERGY, HIGH_EXPLOSIVE, or FRAGMENTATION (can also be OTHER, but that isn't actually used by any weapon in the game. seems to be the same as ENERGY but with different icon.)

energy/shot

Flux generated per shot.

energy/second

Used for beam weapons. Flux generated per second.

chargeup

The time it takes for a projectile weapon to fire a round. For example, if this were set to 1, then there would be a 1 second delay between clicking the mouse and the weapon being fired. For beam weapons this determines how long it takes for the beam to reach full intensity, where the beam will glow but not fire yet.

chargedown

For non-beam weapons, this determines how long it takes for the weapon to be ready to fire again--i.e. cooldown. For beam weapons, this determines how long it takes for the beam to dissipate after the mouse button is released, where the beam is narrowing and doing less damage.

burst size

The number of projectiles that are fired when the weapon opens fire. For beam weapons this is the fire time in seconds.

burst delay

For non-beam weapons, this determines the amount of time between shots fired. Used concurrently with "burst size". For beam weapons with a non-zero value in "burst size", this determines how long it takes for the beam to be ready to fire another burst--i.e. cooldown, after the burst & cooldown periods have completed.

min spread

The minimum angle (in degrees) that projectiles will be constrained to firing within. 0 means that the weapon fire can be perfectly accurate, but may not be due to other factors such as max spread.

max spread

The maximum angle (in degrees) that projectiles will be constrained to firing within. 0 means that the weapon will fire shots with perfect accuracy. A maximum spread of 30 means that fire will be wildly inaccurate outside of point blank range.

spread/shot

How many degrees of spread, per shot, is added to the onto minimum spread. When the maximum spread value is reached, there will be no more continued accuracy reduction. Thus, firing a weapon for an extended period of time could make it less accurate. Without a spread/shot value, a weapon will always fire at its minimum spread value.

spread decay/sec

How many degrees of spread are subtracted, per second, from the weapon's current spread. This value is used to control how quickly a weapon will return to true minimum spread after you stop firing.

beam speed

Determines how fast the beam extends from the barrel to max range.

proj speed

For non-beam weapons, this determines how projectiles
For missile weapons, determines the missile's desired cruise speed that it will try to reach under it's own power.

launch speed

Deals with missiles. This is the value that governs how fast the missiles are moving before their engines ignite and propel them. Missiles will accelerate to their "proj speed" value defined before this.

flight time

This determines how long a missile's engines will function, in seconds. After this time is up, a missile's engines will cut out, and will no longer be able to accelerate.

proj hitpoints

This determines the number of hitpoints a missile has.

hints

These "hints" are small instructions that tell the AI how to use the weapon. These refer to WeaponAPI.AIHints. Possible hints:
  • ANTI_FTR
In conjunction with PD_ONLY, allows point defense weapons to target fighters in addition to missiles. On missiles, informs the AI to fire the weapon at fighters as well.
  • AUTOZOOM
Makes viewpoint automatically snap to target. Strongly not recommended for use.
  • BOMB
Used on missiles. Force the weapon fire at least once every 3 seconds when target in range.
  • CONSERVE_1
Informs the AI to be hesitant in firing the last shot of a limited-ammo weapon. For weapons with a burst size larger than one, it counts full bursts and not individual shots.
  • CONSERVE_2
Informs the AI to be hesitant in firing the last two shots/bursts. See CONSERVE_1.
  • CONSERVE_3
Informs the AI to be hesitant in firing the last three shots/bursts. See CONSERVE_1.
  • CONSERVE_4
Informs the AI to be hesitant in firing the last four shots/bursts. See CONSERVE_1.
  • CONSERVE_5
Informs the AI to be hesitant in firing the last five shots/bursts. See CONSERVE_1.
  • CONSERVE_FOR_ANTI_ARMOR
Informs the AI to be hesitant in firing against stripped armor of a target and prefer firing at more armored section of a target like the Breach SRM.
  • DIRECT_AIM
Informs the missile AI to not weave while approaching target. See Breach SRM.
  • DO_NOT_AIM
Used primarily for missile weapons, this will make the AI fire the weapon even if the target is not within its firing arc.
Note this is more accurately described as "do not aim and fire immediately". Useful for missiles like Pilums that almost always want to fire. Overrides conserve hints.
  • DO_NOT_CONSERVE
Informs the AI to be liberal in firing a limited-ammo weapon, firing at any opportunity.
  • EXTRA_RANGE_ON_FIGHTER
Informs the AI to fire the weapon at listed range plus 500 when mounted on fighters.
  • FIRE_WHEN_INEFFICIENT
Informs AI to fire the weapon even when not flux efficient. Used on weapons with ancillary effects like the Ion Beam.
  • GUIDED_POOR
Used for missiles. Informs the AI to fire at up to 10 degrees outside of arc. See also DO_NOT_AIM
  • HEATSEEKER
Used for missiles. Missile targets engines in a manner similar to the Salamander MRM.
  • MISSILE_SPREAD
Used for missiles. Makes missiles aim randomly off the target's center in a manner similar to the Breach SRM or Squall MLRS.
  • NO_TURN_RATE_BOOST_WHEN_IDLE
Prevents the weapon from gaining a turn rate bonus when they are not firing (by default, weapons gain a turn rate bonus otherwise).
  • PD
Allows the weapon to target missiles. Weapon will still target ships but prefer missiles in range.
  • PD_ALSO
Used concurrently with PD. If used with PD, the weapon will only target missiles if other targets are not available.
  • PD_ONLY
Allows the weapon to only target missiles, unless paired with ANTI_FTR. See above.
  • SHOW_IN_CODEX
Makes a SYSTEM weapon appear in the codex.
  • STRIKE
This means that this weapon will only be used against ships destroyer-size or above. It will also grant any ship carrying this weapon the "strike" ability.
  • SYSTEM
For things like flares, built-in weapons and decorative weapons. Hides the weapon from the codex and prevents it from being dropped as loot (except by fighters which have the weapon specified in their variant file instead of as a built-in, due to a bug).
  • USE_VS_FRIGATES
Used concurrently with the STRIKE hint. If a weapon contains the STRIKE hint, this will make it so that weapon can be fired against frigates as well.

tags

Additional metadata. Primarily used by the autofit system to locate similar replacement weapons by providing a tiered grouping. The vanilla groupings, where x is replaced with a number, are;
  • kineticX
  • heX
  • energyX
  • pdX
  • beamX

(Seen for missiles only)

  • strikeX
  • missileX
  • rocketX
  • utilityX

Autofit will preference higher numbers in the same grouping first. There are also two vanilla autofit tags which do not have nunmbers, for short & long range;

  • SR
  • LR

Tags also help control which factions know a weapon and which blueprint packages it appears in. Some such tags include:

  • lowtech_bp
  • midline_bp
  • hightech_bp
  • base_bp (known to all factions, including player at start of game)
  • rare_bp (will appear as a standalone blueprint)
  • merc (used by mercenary fleets)

The hist1t tag means the historian can tell the player about the location of a blueprint with this weapon.

number

Unused. Good place to put notes, as nothing here has to actually be a number.

Best Practice for tagging:

  • Damage type (kinetic, he, energy, pd, beam)
  • Missile category (strike, missile, rocket, utility)
  • Range (SR, LR)
  • Faction/company (Custom tag or use existing)
  • blueprint (custom tag or base_bp or rare_bp or existing like lowtech_bp)
  • merc (if you want it used by mercenary fleets if not don't include)

Example:

kinetic10,missile10,LR,custom_faction,rare_bp,merc

10 to weighting for selection of weapon over others in both kinetic and missile (guided missile) categories (the game is assuming that a kinetic10 is a better weapon then kinetic7), it is (unusually) long range (for its weapon type, this type of tagging is only for unusually long or short range for its weapon type and size), tagged for custom faction (useful for setting up what blue prints a faction knows), will appear as a stand alone blue print, and can be used by mercenary fleets.

References

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