File overview: faction

From Starsector Wiki
Jump to navigation Jump to search

Description

A .faction file informs the game engine how to set up and use a faction. Every faction must have a corresponding .faction file and corresponding entry in factions.csv . A .faction file is formatted in Starsector's somewhat loose JSON schema.

factions.csv

A faction file will only be used if it is included in factions.csv . This can be done by including a factions.csv file in your mod in \Starsector\mods\ExampleMod\data\world\factions\factions.csv . It needs to contain "faction" in the first line and a relative path from your mod base folder to your faction file in the second line.

faction
data/world/factions/ExampleMod.faction


Example

The .faction file for the Hegemony faction

{ 

   id:"hegemony",

   "color":[245,150,30,255],

   "displayName":"Hegemony",

   "displayNameWithArticle":"the Hegemony",

   "logo":"graphics/factions/hegemony.png",

   "crest":"graphics/factions/crest_hegemony.png",

   "shipNamePrefix":"HSS",

   "shipNameSources":{

       "BRITISH_NAVY":1,

       "ROMAN":2,

       "GREEK":1,

       "SPACE":1,

       "GENERAL":1,

   },

   "names":{

       "old english":1,

       "modern":1,

       "world":1,

       "future":1,

       "myth":1,

   },

   "hullMods":[

       "frontshield",

       "turretgyros",

       "armoredweapons",

       "autorepair",

       "auxiliarythrusters",

       "blast_doors",

       "dedicated_targeting_core",

       "magazines",

       "missleracks",

       "hardened_subsystems",

       "heavyarmor",

       "insulatedengine",

       "reinforcedhull",

       "fluxbreakers",

       "expanded_deck_crew",

       "recovery_shuttles",

       "operations_center",

   ],

   "illegalCommodities":[

       "drugs",

       "organs",

       "hand_weapons",

       "ai_cores",    

   ],

   "music":{

       "theme":"music_hegemony_market_neutral",

       "market_neutral":"music_hegemony_market_neutral",

       "market_hostile":"music_hegemony_market_hostile",

       "market_friendly":"music_hegemony_market_friendly",

       "encounter_neutral":"music_hegemony_encounter_neutral",

       "encounter_hostile":"music_hegemony_encounter_hostile",

       "encounter_friendly":"music_hegemony_encounter_friendly",

   },    

   "internalComms":"hegemony_internal",

   #"tariffFraction":0.4,

   #"tollFraction":0.1,

   #"fineFraction":0.25,

   "portraits":{

       "standard_male":[

           "graphics/portraits/portrait_hegemony01.png",

           "graphics/portraits/portrait_hegemony02.png",

           "graphics/portraits/portrait_hegemony05.png",

           "graphics/portraits/portrait_mercenary01.png",

           "graphics/portraits/portrait_mercenary03.png",

           "graphics/portraits/portrait13.png",

           "graphics/portraits/portrait15.png",

           "graphics/portraits/portrait23.png",

           "graphics/portraits/portrait26.png",

       ],

       "standard_female":[

           "graphics/portraits/portrait_hegemony03.png",

           "graphics/portraits/portrait_hegemony04.png",

           "graphics/portraits/portrait_mercenary02.png",

           "graphics/portraits/portrait16.png",

           "graphics/portraits/portrait34.png",

       ],

   },

   "ranks":{

       "ranks":{

           "spaceCommander":{"name":"Commander"},

       },

       "posts":{

           "patrolCommander":{"name":"Patrol Commander"},

           "fleetCommander":{"name":"Fleet Commander"},

           "baseCommander":{"name":"Base Commander"},

       },

   },

   "custom":{

       "offersCommissions":true,

       "engagesInHostilities":true,

       "buysAICores":true,

       "AICoreValueMult":1,

       "AICoreRepMult":2,

       "buysSurveyData":true,

   },    

   "shipRoles":{

       "fastAttack":{

           "lasher_Standard":5,

           "lasher_Strike":5,

           "hound_hegemony_Standard":10,

           "wolf_hegemony_Assault":2,

           "fallback":{"combatSmall":1},

       },

   

       "escortSmall":{

           "lasher_CS":3,

           "lasher_PD":10,

           "wolf_hegemony_CS":10,

           "monitor_Escort":2,

           "wolf_hegemony_PD":10,

           "vigilance_FS":10,

           "kite_Interceptor":5,

           "fallback":{"combatSmall":1},

       },

       "escortMedium":{

           "enforcer_Escort":10,

           "enforcer_Balanced":10,

           "enforcer_Outdated":10,

           "enforcer_CS":10,

           "hammerhead_Balanced":10,

           "enforcer_Elite":10,

           "enforcer_XIV_Elite":4,

           "hammerhead_Elite":10,

           "fallback":{"combatMedium":1},

       },

       

       "combatSmall":{

           "lasher_Standard":5,

           "lasher_Strike":5,

           "lasher_CS":5,

           "lasher_Assault":5,

           "vigilance_Standard":10,

           "vigilance_FS":10,

           "vigilance_Strike":10,

           "brawler_Assault":10,

           "centurion_Assault":10,

           "fallback":{"escortSmall":1},

       },

       "combatMedium":{

           "enforcer_Assault":10,

           "enforcer_Balanced":10,

           "enforcer_Outdated":10,

           "enforcer_CS":10,

           "enforcer_XIV_Elite":8,

           "hammerhead_Balanced":10,

           "sunder_CS":10,

           "hammerhead_Elite":10,

           "enforcer_Elite":10,

           "sunder_Assault":10,

           "fallback":{"combatSmall":2},

       },

       "combatLarge":{

           "falcon_Attack":10,

           "falcon_CS":10,

           "falcon_xiv_Elite":3,

           "falcon_xiv_Escort":4,

           

           "eagle_Assault":10,

           "eagle_Balanced":10,

           "eagle_xiv_Elite":5,

           

           "dominator_Support":6,

           "dominator_Assault":6,

           "dominator_AntiCV":6,

           "dominator_Outdated":6,

           "dominator_XIV_Elite":5,

           

           "gryphon_Standard":10,

           "gryphon_FS":5,

           

           "fallback":{"combatMedium":2},

       },

       "combatCapital":{

           "onslaught_Standard":10,

           "onslaught_Outdated":10,

           "onslaught_Elite":10,

           "onslaught_xiv_Elite":3,

           "fallback":{"combatLarge":2},

       },

       

       

       # hybrid ships with good combat and cargo capacity

       "combatFreighterSmall":{

           "hound_hegemony_Standard":10,

           "shepherd_Frontier":10,

           "cerberus_Standard":4,

           "cerberus_Hardened":4,

           "cerberus_Shielded":4,

           "wayfarer_Standard":10,

           "fallback":{"freighterSmall":1},

       },

       "combatFreighterMedium":{

           "mule_d_Standard":10,

           "mule_Standard":10,

           "fallback":{"combatFreighterSmall":2},

       },

       "combatFreighterLarge":{

           "venture_Balanced":10,

           "fallback":{"combatFreighterMedium":2},

       },

       

       "civilianRandom":{

           "mercury_d_Standard":10,

           "hermes_d_Standard":10,

           "mercury_Standard":8,

           "mercury_FS":3,

           "hermes_Standard":10,

           "starliner_Standard":10,

           "nebula_Standard":10,

           "mudskipper_Standard":10,

           "kite_Interceptor":5,

           "kite_Standard":5,

           "kite_Stock":1,

           "colossus_Standard":1,

           "fallback":{"freighterSmall":1},

       },

   

       # carriers

       "carrierSmall":{

           "gemini_Standard":5,

           "drover_Strike":10,

           "fallback":{"carrierMedium":0.5},

       },

       "carrierMedium":{

           "heron_Strike":2,

           "heron_Attack":2,

           "mora_Assault":7,

           "mora_Support":4,

           "mora_Strike":7,

           "fallback":{"carrierSmall":2},

       },

       "carrierLarge":{

           "legion_Escort":2,

           "legion_Assault":2,

           "legion_Strike":2,

           "legion_FS":2,

           "fallback":{"carrierMedium":1},

       },

   

       # freighters and such

       "freighterSmall":{

           "hermes_d_Standard":10,

           "hermes_Standard":10,

           "fallback":{"freighterMedium":0.5},

       },

       "freighterMedium":{

           "tarsus_d_Standard":5,

           "buffalo_d_Standard":5,

           "buffalo_Standard":10,

           "tarsus_Standard":10,

           "buffalo_hegemony_Standard":10,

           "colossus_Standard":2,

           "fallback":{"freighterSmall":2},

       },

       "freighterLarge":{

           "colossus_Standard":5,

           "atlas_Standard":10,

           "fallback":{"freighterMedium":2},

       },

       

       "tankerSmall":{

           "dram_Light":10,

           "fallback":{"tankerMedium":0.5},

       },

       "tankerMedium":{

           "phaeton_Standard":10,

           "fallback":{"tankerSmall":2},

       },

       "tankerLarge":{

           "prometheus_Super":10,

           "fallback":{"tankerMedium":2},

       },

       

       "personnelSmall":{

           "mercury_d_Standard":10,

           "mercury_Standard":10,

           "mudskipper_Standard":2,

           "kite_Interceptor":5,

           "fallback":{"personnelMedium":0.5},

       },

       "personnelMedium":{

           "valkyrie_Elite":10,

           "nebula_Standard":1,

           "fallback":{"personnelSmall":2},

       },

       "personnelLarge":{

           "fallback":{"personnelMedium":3},

       },

       

       # utility ships

       "tug":{

           "ox_Standard":10,

           "fallback":{"utility":1},

       },

       "crig":{

           "crig_Standard":10,

           "fallback":{"utility":1},

       },

       "utility":{

           "crig_Standard":10,

           "ox_Standard":10,

       },

   },

   "doctrine":{

       # ship distribution

       "small":6,

       "fast":4,

       "medium":8,

       "large":8,

       "capital":4,

       

       # as fraction of combat ships of same size

       "escortSmallFraction":1,

       "escortMediumFraction":1,

       

       "combatFreighterProbability":0.1,

       

       "minPointsForCombatCapital":10,

       "minPointsForLargeCarrier":30,

       

       "smallCarrierProbability":0.2,

       "mediumCarrierProbability":0.25,

       "largeCarrierProbability":0.3,

       

       # officers

       "officersPerPoint":0.35,

       "officerLevelPerPoint":0.35,

       "officerLevelBase":5,

       "officerLevelVariance":0.25,

       

       "commanderSkillsPerLevel":0.2,

       "commanderSkillChance":0.55,

       "commanderSkillLevelPerLevel":0.3,

       "commanderSkills":{

           "officer_management":10,

           "coordinated_maneuvers":10,

           "fighter_doctrine":5,

           "electronic_warfare":2,

       },

   },    

   "traits":{

       "captain":{

           "timid":1,

           "cautious":5,

           "steady":10,

           "aggressive":10,

           "reckless":5,

       },

   },

}, 


Elements

id

  • Unique ID of the faction used in code to refer to this faction. Ensure it is unique from other vanilla & mod factions, such as by using your mod prefix. Text field

color

  • The faction colour. RGBA

displayName

  • Friendly user facing name of the faction. Text field

displayNameWithArticle

  • Friendly user facing name of the faction with appropriate article (e.g. "the"), for dynamic inclusion in text. Text field

displayNameLong, displayNameLongWithArticle

  • Longer "formal" name for the faction, e.g. "Church of Galactic Redemption" vs. "Luddic Church". Text field

  • The name of the logo picture for the faction, including relative path from core folder. Vanilla logos are 410x256 pixels. Other sizes may work if they are the same proportions. PNG file

crest

  • The name of the crest picture for the faction, including relative path from core folder. Vanilla crests are 256x256 pixels. Other sizes may work if they are the same proportions. PNG file

shipNamePrefix

  • Faction naming prefix for ships, e.g. "HSS" for Hegemony. Text field

shipNameSources

  • Ship name sources to use and at what weighting. Refers to ship name elements defined in \data\strings\ship_names.json. Array of elements and weighting values
    • If an invalid name source is specified and the ship namer picks that source, it will fall back to using all available name sources. This can result in ships getting names they shouldn't, e.g. here.

names

  • Categories of characters names this faction should pick from and at what weighting. Refers to the category field of \data\characters\person_names.csv. Array of elements and weighting values

hullMods

  • Hullmods that this faction's markets might supply. Refers to hullmods by the ID field defined in \data\hullmods\hull_mods.csv. Array of strings

illegalCommodities

  • Commodities that this faction considers illegal. Refers to commodities by the ID field defined in \data\campaign\commodities.csv. Array of strings

music

  • Defines when to play which music for this faction. When to play music is the element, possibilities include theme, market_neutral, market_hostile, market_friendly, encounter_neutral, encounter_hostile and encounter_friendly. Music is defined by the elements inside the music element in \data\config\sounds.json. Array of elements and values

internalComms

  • Defines a faction communications channel. Refers to channels defined as elements \data\campaign\channels.json. Text field

portraits

  • Lists the portraits this faction's officers and base personnel will use. Contains two string arrays: standard_male and standard_female.

ranks

  • Custom names for the preset ranks & posts. Array
  • ranks
Not a typo; It is indeed organised as ranks ranks.
  • spaceCommander
Text Field
  • posts
  • patrolCommander
Text Field
  • fleetCommander
Text Field
  • baseCommander
Text Field

custom

  • decentralized (boolean)
Used for contact mission filtering criteria. If true, certain contact missions (Security Code and Combat Bounties) cannot choose this faction. Defaults to false. Only the Independent, Luddic Path, and Pirates use this tag.
  • no_contacts (boolean)
If true, prevents potential contacts in being added from this faction. Defaults to false. No faction uses this tag.
  • ignoreTradeWithEnemiesForReputation (boolean)
If true, this faction doesn't get mad about you trading with someone else. Defaults to false. Only the Luddic Path and Pirates use this tag.
  • postsNoBounties (boolean)
If true, this faction will not post bounties at all. Defaults to false. Only the Luddic Path and Pirates use this tag.
  • allowsTransponderOffTrade (boolean)
If true, fleets will not have a cargo scan dialog and will happily allow you to trade on their open and military markets regardless of having the transponder on. Defaults to false. Only the Independent, Luddic Path, and Pirates use this tag. (Derelict, Remnant, and OMEGA will set this as well to avoid cargo scan dialog)
  • caresAboutAtrocities (boolean)
If true, fleets will act hostile to the player's action of saturation bombardment regardless of who's being bombed. Defaults to false. Only the Hegemony, Persean League, Luddic Church, and Independent use this tag.
  • engageWhenEvenStrength (boolean)
If true, hostile fleets from this faction will chase the player when they have strength parity; otherwise, they will only attack if in physical contact or provoked in some way. Defaults to false. Only the Derelict, Luddic Path, Omega, Pirates, and Remnants use this tag.
  • offersCommissions
If true, this faction will offer commissions. Defaults to false. Boolean
  • engagesInHostilities (boolean)
If true, this faction will have the faction hostilities event with other factions. Defaults to false.
  • buysAICores
If true, base administrators/commanders will buy AI Cores from the player. Defaults to false. Boolean
  • AICoreValueMult
Multiplier for the credits reward from selling AI cores to a base administrator/commander. Number
  • AICoreRepMult
Multiplier for the reputation reward from selling AI cores to a base administrator/commander. Number
  • buysSurveyData
Boolean

shipRoles

  • An array or fleet roles, which contain arrays of variants with relative weightings. The relative weightings provide a percentage chance of that variants weighting relative to the total weightings of all variants in that array.

There is an optional special entry in this array named "fallback", which itself has an array of roles with a number. This denotes that "if we, for some reason, can't spawn any of the ships in this category, spawn the number of that role of ships instead as a replacement"

doctrine

traits

baseUIColor

  • RGBA

darkUIColor

  • RGBA

gridUIColor

  • RGBA

showInIntelTab

entityNamePrefix

displayNameIsOrAre

fleetTypeNames

personNamePrefix

personNamePrefixAOrAn

description

secondaryUIColor

  • RGBA

secondarySegments

  • Number

Possible extra elements, to confirm

  • tariffFraction
  • tollFraction
  • fineFraction
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