Rulesets (OpenXcom)

From UFOpaedia
Jump to navigation Jump to search

OpenXcom exposes it's inner workings to users and modders in the form of a YAML text file called a ruleset (*.rul). These text files contain 'rules' that describe a wide variety of the games behavior. Although rulesets can be edited with any text editor (like notepad) but it is much easier to use a YAML editor.

What is a ruleset?

Naturally a ruleset is composed of rules, or groups of rules. Each rule describes a single thing about the game. A rule might describe what research projects become available after researching laser weapons, how much damage a pistol clip does, or the max flight speed of a Terror Ship. Rulesets are in YAML text files.

Viewing and Editing Rulesets (YAML)

Editing YAML is about as hard as editing an *.ini config file, though slightly more involved.

Instructions for Nerds

You can open any rulesets (or savegame files) in notepad++ and select Language>YAML. Alternatively you could conjure up a google search. There are YAML plugins for visual studio and eclipse.

Instructions for Noobs

  • Install Notepad++ or if your on a mac then get TextWrangler. If you're on linux and you can't find a YAML editor...
  • Go to OpenXcom\Data\Ruleset and open a/the *.rul file. That means a file that ends with .rul, you may have to unhide filename extensions.
  • In Notepad++ click Language>YAML. Otherwise if your editor doesn't let you collapse sections of the ruleset, try renaming the file to something that ends with .yml, as your editor may not recognize it as YAML.
  • It should be pretty obvious how to change stuff at this point. You may want to make a backup before editing anything though.
  • for further information there are plenty of sites that help explain YAML files, just search for .yml or YAML instead of ruleset, as rulesets are specific to OpenXcom where as YAML is much more widely used.

Note

You should be able to use the vertical bar on the left of the editor to collapse regions of the rulesets file that you aren't interested in. If not, then something is wrong. That's OK though if you don't mind scrolling pas literally thousands of lines to get to the rules near the bottom.

Your First Edit (Cheat)

At the very top off the file you will see where the facilities list starts followed by a list of facilities and various attributes about them. Locate the living quarters facility and change the number next to "Personnel:" from 50 to however many people you think should actually be able to live in a living quarters (maybe 2000). Congratulations, you have just modded OpenXcoms living quarters to hold more people, don't forget to save.