Difference between revisions of "Rulesets (OpenXcom)"

From UFOpaedia
Jump to navigation Jump to search
m (grammar and spelling)
Line 4: Line 4:
  
 
==What is a ruleset?==
 
==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.
+
 
 +
In OpenXcom a ruleset is an easy to edit text file that contains settings (rules) that describe almost everything about how the game operates. Here are just some of the things that are in the ruleset:
 +
*The costs, stats and characteristics of all items, units, facilities, x-com craft and UFOs
 +
*Dependencies and costs for research and manufacture
 +
*What you have in your first base when you create a new game
 +
*The time it takes for purchased personnel to arrive
 +
*The starting funding of different countries
  
 
==Viewing and Editing Rulesets (YAML)==
 
==Viewing and Editing Rulesets (YAML)==

Revision as of 02:32, 20 April 2013

OpenXcom exposes its 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 game's behavior. Although rulesets can be edited with any text editor, such as Notepad, it is much easier to use a YAML editor.

What is a ruleset?

In OpenXcom a ruleset is an easy to edit text file that contains settings (rules) that describe almost everything about how the game operates. Here are just some of the things that are in the ruleset:

  • The costs, stats and characteristics of all items, units, facilities, x-com craft and UFOs
  • Dependencies and costs for research and manufacture
  • What you have in your first base when you create a new game
  • The time it takes for purchased personnel to arrive
  • The starting funding of different countries

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 you are on a Mac then get TextWrangler. If you are on Linux and you cannot 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 does not 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 whereas 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 are not interested in. If not, then something is wrong. That is OK though if you do not mind scrolling past literally thousands of lines to get to the rules near the bottom.

Your First Edit (Cheat)

At the very top of 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 OpenXcom's living quarters to hold more people. Do not forget to save.