Rules.csv

From Starsector Wiki
Jump to navigation Jump to search

The rules.csv file, located at data/campaign/rules.csv is the primary, but not only, means of creating dialog interactions. This includes almost all situations where the player engages with an entity – a planet, fleet, or character – where a textbox pops up and allows the player to choose from a set of responses. After choosing a response, stuff happens, more text is displayed, and a new set of possible responses is presented. This interaction loop proceeds until the dialog is closed.

This system is the basis for conversations with NPCs, for most interactions with campaign objects (planets, derelicts, sensor arrays, jump-points), and nearly all of the missions and story events.

In short, rules.csv contains the data used by what amounts to a custom scripting language that hooks into the game code to drive almost all content which doesn’t involve the combat map or the campaign map.

There is a comprehensive explanation and tutorial, written by Fractal Softworks, on the blog.

An alternative Rules.csv Tutorial is available here on the wiki.

Editing

SafariJohn's Rules Tool can make working with rules.csv easier.

It may also be edited as a spreadsheet using Google Docs, Rons CSV Editor, or LibreOffice Calc. Excel may export the .csv incorrectly, depending on your locale.

If working with rules.csv raw, do not enable special characters or multi-line cells.

Rules.csv does not accept UTF-8 formatting with BOM, and attempting to format it as such will cause the game not to load.

FireBest

FireBest dynamically builds a list of possibilities and chooses one path to execute next. A parameter is specified to build the list; for example, FireBest InspectionResultResponse will build a list of all entries with the parameter InspectionResultResponse as their trigger.

Each entry may optionally specify a weighting and FireBest will pick from this weighted list. The conditions column may optionally specify conditions where that entry is eligible to be picked.

FireAll

FireAll dynamically builds a list similar to FireBest except it will execute all matching entries. Of particular note is FireAll PopulateOptions which is used extensively with conditions to build dialog choices.

Scripts

Scripts can be fired from rules.csv events provided they are in a specified Java package. The packages are defined within settings.json in the ruleCommandPackages element.

Icon check temp.png
Only up to date for version 0.96a. It is likely still broadly correct but not verified for the most up to date data yet. Please double check the Version History.

---

Return to Modding