Difference between revisions of "Rulesets (OpenXcom)"

From UFOpaedia
Jump to navigation Jump to search
(Full re-write of article)
Line 1: Line 1:
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__
 
 
==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:  
 
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
 
*The costs, stats and characteristics of all items, units, facilities, x-com craft and UFOs
Line 12: Line 6:
 
*The starting funding of different countries
 
*The starting funding of different countries
  
==Viewing and Editing Rulesets (YAML)==
+
__TOC__
Editing YAML is about as hard as editing an *.ini config file, though slightly more involved.
+
 
 +
==Editing Rulesets (YAML)==
 +
OpenXcom exposes its inner workings to users and modders in the form of YAML text files(*.rul). Although YAML can be edited with any text editor, such as Notepad, it is much easier to use a dedicated YAML editor.
 +
 
 +
===Notepad++===
 +
You can open any rulesets (or savegame files) in Notepad++ and select Language>YAML. This will help you keep the proper tabbing structure and also allow you to collapse large regions. You can set Notepad++ to recognize *.rul, *.sav and *.cfg files as YAML file extensions under preferences so that you don't have to set the language every time you edit one of OpenXcoms files.
 +
 
 +
===Can't Notepad++?===
 +
Alternatively you could conjure up a Google search and look for YAML editors that are compatible with your OS. There are YAML plugins for both Visual Studio and Eclipse. Yedit for eclipse is popular.
 +
 
 +
*Note: You should be able to collapse regions in whatever YAML editor you use. If not, you're in for a lot of scrolling as the files are quite large.
 +
 
 +
==Your First Edit (Cheat)==
 +
:1. Collapse everything (Alt-0 in Notepad++) and then open (uncollapse) the "facilities:" section.
 +
:2. Open "- type: STR_LIVING_QUARTERS"
 +
:3. change "personnel: 50" to "personnel: 500"
 +
:4. Congratulations! You can now have 500 personal per living quarters.
 +
 
 +
==A couple other examples==
 +
1. Fusion Ball Launcher balance update: Let's make something other then plasma cannons useful
 +
*change "craftWeapons:" -> "type: STR_FUSION_BALL_UC>" -> "ammoMax: 2" to "ammoMax: 6"
 +
*change "craftWeapons:" -> "type: STR_PLASMA_BEAM_UC>" -> "range: 52" to "range: 40" (just inside a terror-ships range)
 +
*set the range for Laser Cannons to 34 (same as large scout) and set Stingray and avalanche ranges even shorter
 +
:Now there's a reason to build Fusion-Ball Launchers - <i>shoot down Battleships and Terrorships</i>, there's also a reason for Plasma Beams - <i>shoot down Supply Ships and Large Scouts without getting hit</i>, and a reason for Laser Cannons - <i>shoot down Harvesters or Abductors safetly and shoot down Large Scouts at equal range</i>.
  
===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===
+
2. Sectopod Buff: It's time to put the fear of Sectopod in those power-suit/hovertank squads that think Ethereal Terrorsites are some kind of joke!
* Install Notepad++ or if you are on a Mac then get TextWrangler. If you are on Linux and you cannot find a YAML editor...
+
* "units:" -> "- type: STR_SECTOPOD_TERRORIST" -> "stats:" set TUs to 110, stamina to 125, Firing Accuracy to 100, Psi-Strength to 160 and health to 135.
* 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.
+
* Note the field "armor: SECTOPOD_ARMOR". So close "units:" and open "armors:" -> "type: SECTOPOD_ARMOR"
* 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.
+
* Set rear armor to 130 (a sectopod has a finely armored buttox, thankyou).  
* It should be pretty obvious how to change stuff at this point. You may want to make a backup before editing anything though.
+
* Open "damageModifier:" (it's part of the armor) and find a "- 1.5" and a "- 0.8" just below it. These are the values for how much damage a unit wearing sectopod armor takes from laser(1.5x) and plasma(0.8x). Increase the laser bonus to 1.8 and reduce the plasma further to 0.65 (it's now actually worth it to bring laser weapons just for the sectopods)
* 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.
+
*Close "armors:" and open "items:" -> "type: SECTOPOD_WEAPON" and lets give it a good 145 weapon power. No need to adjust the weapon accuracy since we already increased the stat.
 +
:Now you can go back to having nightmares about Sectopods, just like you did when you were a young child who got in trouble for playing X-COM on the family computer after bed-time when you hadn't even done you're homework.
  
====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)====
+
3. Early Blaster: The best time to have a blaster launcher is in the back of a skyranger full of rookies.
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.
+
* Go to "items:" and pick anything that's purchasable. Copy the line with "costBuy:" and a number. Make sure you copy the tabs before "costBuy:". <i>The best way to do this is to put the cursor at the end of the line above it, shift-downarrow and shift-end to select the entire line and the line-break characters.</i>
 +
* Go to "type: STR_BLASTER_LAUNCHER" and add the "costBuy:" line. <i>If the new line your adding doesn't look like the other lines in your YAML editor (like if it's red or black text instead of blue) then it's probably wrong and you probably have incorrect tab or line-break characters in it.</i>
 +
* Remove the section "required:"
 +
* Do the last two things for Blaster Bombs as well.
 +
* Open "startingBase:" -> "lon: 0.0" -> "items:" and replace "STR_CANNON" and "STR_CANNON_ROUNDS_X50" with "STR_BLASTER_BOMB" and "STR_BLASTER_LAUNCHER"
 +
:Start a new game, load up blasters on your skyranger, and land by a medium scout. Now hit the side of the medium scout with one shot to make a hole, hit that silly glowy thing in the middle with the second shot. Voila, that rookie killing death-trap is now just like a crash-site, except with even less live aliens inside.

Revision as of 04:30, 20 April 2013

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

Editing Rulesets (YAML)

OpenXcom exposes its inner workings to users and modders in the form of YAML text files(*.rul). Although YAML can be edited with any text editor, such as Notepad, it is much easier to use a dedicated YAML editor.

Notepad++

You can open any rulesets (or savegame files) in Notepad++ and select Language>YAML. This will help you keep the proper tabbing structure and also allow you to collapse large regions. You can set Notepad++ to recognize *.rul, *.sav and *.cfg files as YAML file extensions under preferences so that you don't have to set the language every time you edit one of OpenXcoms files.

Can't Notepad++?

Alternatively you could conjure up a Google search and look for YAML editors that are compatible with your OS. There are YAML plugins for both Visual Studio and Eclipse. Yedit for eclipse is popular.

  • Note: You should be able to collapse regions in whatever YAML editor you use. If not, you're in for a lot of scrolling as the files are quite large.

Your First Edit (Cheat)

1. Collapse everything (Alt-0 in Notepad++) and then open (uncollapse) the "facilities:" section.
2. Open "- type: STR_LIVING_QUARTERS"
3. change "personnel: 50" to "personnel: 500"
4. Congratulations! You can now have 500 personal per living quarters.

A couple other examples

1. Fusion Ball Launcher balance update: Let's make something other then plasma cannons useful

  • change "craftWeapons:" -> "type: STR_FUSION_BALL_UC>" -> "ammoMax: 2" to "ammoMax: 6"
  • change "craftWeapons:" -> "type: STR_PLASMA_BEAM_UC>" -> "range: 52" to "range: 40" (just inside a terror-ships range)
  • set the range for Laser Cannons to 34 (same as large scout) and set Stingray and avalanche ranges even shorter
Now there's a reason to build Fusion-Ball Launchers - shoot down Battleships and Terrorships, there's also a reason for Plasma Beams - shoot down Supply Ships and Large Scouts without getting hit, and a reason for Laser Cannons - shoot down Harvesters or Abductors safetly and shoot down Large Scouts at equal range.


2. Sectopod Buff: It's time to put the fear of Sectopod in those power-suit/hovertank squads that think Ethereal Terrorsites are some kind of joke!

  • "units:" -> "- type: STR_SECTOPOD_TERRORIST" -> "stats:" set TUs to 110, stamina to 125, Firing Accuracy to 100, Psi-Strength to 160 and health to 135.
  • Note the field "armor: SECTOPOD_ARMOR". So close "units:" and open "armors:" -> "type: SECTOPOD_ARMOR"
  • Set rear armor to 130 (a sectopod has a finely armored buttox, thankyou).
  • Open "damageModifier:" (it's part of the armor) and find a "- 1.5" and a "- 0.8" just below it. These are the values for how much damage a unit wearing sectopod armor takes from laser(1.5x) and plasma(0.8x). Increase the laser bonus to 1.8 and reduce the plasma further to 0.65 (it's now actually worth it to bring laser weapons just for the sectopods)
  • Close "armors:" and open "items:" -> "type: SECTOPOD_WEAPON" and lets give it a good 145 weapon power. No need to adjust the weapon accuracy since we already increased the stat.
Now you can go back to having nightmares about Sectopods, just like you did when you were a young child who got in trouble for playing X-COM on the family computer after bed-time when you hadn't even done you're homework.


3. Early Blaster: The best time to have a blaster launcher is in the back of a skyranger full of rookies.

  • Go to "items:" and pick anything that's purchasable. Copy the line with "costBuy:" and a number. Make sure you copy the tabs before "costBuy:". The best way to do this is to put the cursor at the end of the line above it, shift-downarrow and shift-end to select the entire line and the line-break characters.
  • Go to "type: STR_BLASTER_LAUNCHER" and add the "costBuy:" line. If the new line your adding doesn't look like the other lines in your YAML editor (like if it's red or black text instead of blue) then it's probably wrong and you probably have incorrect tab or line-break characters in it.
  • Remove the section "required:"
  • Do the last two things for Blaster Bombs as well.
  • Open "startingBase:" -> "lon: 0.0" -> "items:" and replace "STR_CANNON" and "STR_CANNON_ROUNDS_X50" with "STR_BLASTER_BOMB" and "STR_BLASTER_LAUNCHER"
Start a new game, load up blasters on your skyranger, and land by a medium scout. Now hit the side of the medium scout with one shot to make a hole, hit that silly glowy thing in the middle with the second shot. Voila, that rookie killing death-trap is now just like a crash-site, except with even less live aliens inside.