Difference between revisions of "Rulesets (OpenXcom)"
m (→Countries) |
|||
Line 83: | Line 83: | ||
|- | |- | ||
| '''fundingBase''' | | '''fundingBase''' | ||
− | | | + | | Country's base funding, in thousands. The starting funding can be anywhere between 1x and 2x the base funding. |
| 0 | | 0 | ||
|- | |- | ||
| '''fundingCap''' | | '''fundingCap''' | ||
− | | | + | | Country's funding cap, in thousands. Once a country reaches this maximum, it will no longer increase its funding. |
| 0 | | 0 | ||
|- | |- | ||
| '''labelLon''' | | '''labelLon''' | ||
'''labelLat''' | '''labelLat''' | ||
− | | | + | | Longitude and latitude coordinates of the country's label on the globe. This label is only shown when the globe is zoomed in and "detail" is turned on. |
| 0.0 | | 0.0 | ||
0.0 | 0.0 |
Revision as of 01:31, 6 September 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, manufacture and UFOpedia
- Your starting base
- The costs of personnel and transfer time.
- The stats of the funding countries and regions of the world.
You can find the rulesets in your Data\Ruleset folder.
Editing Rulesets (YAML)
OpenXcom exposes its inner workings to users and modders in the form of YAML text files. Although YAML can be edited with any text editor, such as Notepad, it is much easier to use a dedicated YAML editor. YAML has a special syntax so any incorrect whitespace or character can cause an error, but it's a simple human-readable format so you should be able to figure it out by looking at the existing rulesets.
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 OpenXcom's 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)
- Open the Data\Ruleset\Xcom1Ruleset.rul file in your YAML editor.
- Collapse everything (Alt-0 in Notepad++) and then open (uncollapse) the "facilities:" section.
- Open "- type: STR_LIVING_QUARTERS"
- change "personnel: 50" to "personnel: 500"
- 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 than 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 safely 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:" (its 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 let's 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 your 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-down-arrow 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. Voilà, that rookie killing death-trap is now just like a crash-site, except with even less live aliens inside.
Modular Rulesets
External Links
Reference
A reference of all the customizable values of everything in a ruleset. Some guidelines:
- If a value is omitted from the ruleset, the default is used. You cannot omit required values.
- Text strings (eg. names) are represented by string IDs from the [Translations (OpenXcom)|language files]
- Numerical IDs (used for sprites, sounds, etc.) start at 0, not 1.
- Boolean (yes/no) values are represented by true/false.
- World coordinates are represented in degrees (see WORLD.DAT).
- Money amounts (prices, costs, etc.) are represented in dollars.
Countries
Defines one of the funding nations, listed in "countries:". They're used for activity graphs and player scoring.
Value | Description | Default |
---|---|---|
type | String ID of the country name. | required |
fundingBase | Country's base funding, in thousands. The starting funding can be anywhere between 1x and 2x the base funding. | 0 |
fundingCap | Country's funding cap, in thousands. Once a country reaches this maximum, it will no longer increase its funding. | 0 |
labelLon
labelLat |
Longitude and latitude coordinates of the country's label on the globe. This label is only shown when the globe is zoomed in and "detail" is turned on. | 0.0
0.0 |
areas | A list of "square areas" on the globe defined as [lon1 lat1 lon2 lat2]. Any activity within these areas counts towards the country's graph activity and affects their opinion of the player. | - |
Regions
Defines one of the world regions, listed in "regions:". They're used for base placement, activity graphs and mission spawning.
Value | Description | Default |
---|---|---|
type | String ID of the region name. | required |
cost | Total cost for placing an X-COM base in this region. | 0 |
areas | A list of "square areas" on the globe defined as [lon1, lat1, lon2, lat2]. Any activity within these areas counts towards the region's graph activity. | - |
cities | A list of cities belonging to this region. They will be displayed on the globe and used for terror site missions. Each city is defined by their lon and lat coordinates and a name string ID. | - |
regionWeight | Weight of this region when selecting regions for alien missions. | 0 |
missionWeights | Weighted list of the different mission types for this region (eg. STR_ALIEN_RESEARCH: 14). | - |
missionZones | List of square areas ([lon1, lat1, lon2, lat2]) defining the mission zones for this region. | - |
missionRegion | Spawn mission in this region instead (used for regions without land). | - |
Base Facilities
Defines one of the facilities that can be built in an X-COM base.
Value | Description | Default |
---|---|---|
type | String ID of the facility name. | required |
requires | List of topics (string IDs) that must be researched to unlock this facility. If none are specified, this facility is unlocked from the start. | - |
spriteShape | Sprite ID from BASEBITS.PCK used to draw the facility's outer shape in the Basescape and UFOpaedia. | -1 |
spriteFacility | Sprite ID from BASEBITS.PCK used to draw the facility's contents in the Basescape and UFOpaedia. Drawn on top of spriteShape. | -1 |
lift | Is this facility an Access Lift? All base facilities must be connected to the lift. | false |
hyper | Is this facility a Hyperwave Decoder? Displays extra information for detected UFOs. Only valid for radar facilities. | false |
mind | Is this facility a Mind Shield? Reduces the chance of UFOs finding your base. Does not stack. | false |
grav | Is this facility a Grav Shield? Doubles the power of your base defenses. Does not stack. | false |
size | Size of the facility, in grid units. Every facility is square, so a size of 1 means 1x1, 2 means 2x2, etc. Bigger facilities are made up of multiple sprites, for example a 2x2 facility will use 4 sprites for spriteShape and 4 sprites for spriteFacility (top-left, top-right, bottom-left, bottom-right). | 1 |
buildCost | The cost it takes to build this facility on the base. | 0 |
buildTime | The amount of days it takes for this facility to be built. | 0 |
monthlyCost | The monthly maintenace cost for this facility. | 0 |
storage | The amount of storage space (for items) this facility provides. See Base Stores. | 0 |
personnel | The amount of personnel (soldiers, scientsts, engineers) these quarters can contain. | 0 |
aliens | The amount of live aliens this facility can contain. Only checked if the alienContainmentLimitEnforced option is enabled. | 0 |
crafts | The amount of X-COM craft this facility can contain. | 0 |
labs | The amount of lab space this facility provides for research projects. | 0 |
workshops | The amount of workshop space this facility provides for manufacture projects. | 0 |
psiLabs | The amount of soldier space this facility provides for psionic training. | 0 |
radarRange | The maximum radar detection range of this facility, in nautical miles. | 0 |
radarChance | The chance (0-100%) of this radar detecting a UFO that enters its range. | 0 |
defense | The offensive power this base defense provides against attacking UFOs. | 0 |
hitRatio | The chance (0-100) of the base defense hitting an attacking UFO. | 0 |
fireSound | Sound ID (from SAMPLE.CAT) played when the base defense fires. | -1 |
hitSound | Sound ID (from SAMPLE.CAT) played when the base defense hits a target. | -1 |
mapName | The name of the map associated to this facility in Battlescape base defenses. |
Crafts
Defines one of the X-COM crafts that go on interception missions.
Value | Description | Default |
---|---|---|
type | String ID of the craft name. | required |
requires | List of topics (string IDs) that must be researched to unlock this craft. If none are specified, this craft is unlocked from the start. | - |
sprite | Sprite ID from BASEBITS.PCK used to draw the craft in the Basescape and from INTICON.PCK used to draw the craft in dogfights. | -1 |
fuelMax | Maximum amount of fuel the craft can carry. Crafts use up fuel based on their speed while travelling. | 0 |
damageMax | Maximum amount of damage the craft can take. If this amount is exceeded, the craft is destroyed. | 0 |
speedMax | Maximum speed in nautical miles. Crafts travel at max speed when flying and half speed when patrolling. | 0 |
accel | Aceeleration value shown in the UFOpaedia. | 0 |
weapons | Amount of craft weapons the craft can equip. The UI can only display a max of 2 weapons. | 0 |
soldiers | Amount of soldiers the craft can carry. | 0 |
vehicles | Amount of vehicles the craft can carry. | 0 |
costBuy | Amount of money spent for purchasing the craft. If set to 0, the craft cannot be purchased. | 0 |
costRent | Monthly cost for renting the craft. If set to 0, the craft is not on rental. | 0 |
costSell | Amount of money gained for selling the craft. | 0 |
refuelItem | Item required for refuelling the craft. If no item is specified, the craft uses human fuel. | 0 |
repairRate | Amount of damage restored every hour while Repairing in base. | 1 |
refuelRate | Amount of fuel restored every 30 mins while Refueling in base. If specified, a refuelItem is spent each time. | 1 |
radarRange | Detection range of the craft's radar in nautical miles. Every craft radar has a 100% detection chance. | 600 |
transferTime | Number of days it takes to purchase/transfer the craft to a base. | 0 |
score | Score lost when this craft is destroyed. | 0 |
spacecraft | Can this craft go to Cydonia? | false |
Craft Weapons
Value | Description | Default |
---|---|---|
type | String ID of the region name. | required |
Items
Value | Description | Default |
---|---|---|
type | String ID of the region name. | required |
UFOs
Value | Description | Default |
---|---|---|
type | String ID of the region name. | required |
Inventory Slots
Value | Description | Default |
---|---|---|
type | String ID of the region name. | required |
Terrains
Value | Description | Default |
---|---|---|
type | String ID of the region name. | required |
Armor
Value | Description | Default |
---|---|---|
type | String ID of the region name. | required |
Soldiers (X-COM Units)
Value | Description | Default |
---|---|---|
type | String ID of the region name. | required |
Enemy / Neutral Units
Value | Description | Default |
---|---|---|
type | String ID of the region name. | required |
Alien Races
Value | Description | Default |
---|---|---|
type | String ID of the region name. | required |
Alien Deployments
Value | Description | Default |
---|---|---|
type | String ID of the region name. | required |
Research
Value | Description | Default |
---|---|---|
type | String ID of the region name. | required |
Manufacture
Value | Description | Default |
---|---|---|
type | String ID of the region name. | required |
UFOpaedia Entry
Value | Description | Default |
---|---|---|
type | String ID of the region name. | required |
UFO Trajectories
Value | Description | Default |
---|---|---|
type | String ID of the region name. | required |
Alien Missions
Value | Description | Default |
---|---|---|
type | String ID of the region name. | required |
Alien Item Levels
Value | Description | Default |
---|---|---|
type | String ID of the region name. | required |