Difference between revisions of "Rulesets (OpenXcom)"

From UFOpaedia
Jump to navigation Jump to search
m (grammar and spelling)
Line 1: Line 1:
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.
+
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.
  
 
__TOC__
 
__TOC__
Line 10: Line 10:
  
 
===Instructions for Nerds===
 
===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.
+
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===
 
===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...
+
* 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.
+
* 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.
+
* 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.
 
* 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.
+
* 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====
 
====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.   
+
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)====
 
====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.
+
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.

Revision as of 10:09, 23 February 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?

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 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.