Difference between revisions of "Rulesets (OpenXcom)"

From UFOpaedia
Jump to navigation Jump to search
(Added blaster tech requirement removal step to Early Blaster)
m (→‎Modular Rulesets: ordering rulesets)
 
(9 intermediate revisions by 3 users not shown)
Line 11: Line 11:
 
[[Image:OpenXcomNotepadYaml.png|right|thumb|Notepad++ Settings for editing OpenXcom YAML files]]
 
[[Image:OpenXcomNotepadYaml.png|right|thumb|Notepad++ Settings for editing OpenXcom YAML files]]
  
OpenXcom exposes its inner workings to users and modders in the form of [[:Wikipedia:YAML|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.
+
OpenXcom exposes its inner workings to users and modders in the form of [[:Wikipedia:YAML|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. Make sure you use UTF-8 encoding! (this is important for when you add strings and translations)
  
 
===Notepad++===
 
===Notepad++===
Line 17: Line 17:
  
 
===Can't Notepad++?===
 
===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.
+
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. There's also [http://yaml-online-parser.appspot.com/ online YAML validators].
  
 
*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.  
 
*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.  
Line 30: Line 30:
 
==A couple other examples==
 
==A couple other examples==
 
1. Fusion Ball Launcher balance update: Let's make something other than plasma cannons useful
 
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_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)
+
*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
 
*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 - <i>shoot down Supply Ships and Large Scouts without getting hit</i>, and a reason for Laser Cannons - ''shoot down Harvesters or Abductors safely and shoot down Large Scouts at equal range''.
 
:Now there's a reason to build Fusion-Ball Launchers - ''shoot down Battleships and Terrorships'', 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 - ''shoot down Harvesters or Abductors safely and shoot down Large Scouts at equal range''.
Line 62: Line 62:
 
     personnel: 500
 
     personnel: 500
  
Then to load your extra ruleset into the game, you just go in your ''[[Customizing (OpenXcom)|options.cfg]]'' file and add it like so:
+
Then to load your extra ruleset into the game, you just go in your ''[[Options (OpenXcom)|options.cfg]]'' file and add it like so:
  
 
  rulesets:
 
  rulesets:
Line 68: Line 68:
 
   - BiggerQuarters
 
   - BiggerQuarters
  
Now when you start up the game, it'll automatically combine all the rulesets listed in the ''options.cfg''. Note that the order is important, as subsequent rulesets will modify the contents of previous ones (if the '''type''' is the same), so in this case ''BiggerQuarters'' will modify the STR_LIVING_QUARTERS of ''Xcom1Ruleset'', which is what you want. Normally you always want ''Xcom1Ruleset'' to come first.
+
Now when you start up the game, it'll automatically combine all the rulesets listed in the ''options.cfg''. Note that the order is important, as subsequent rulesets will modify the contents of previous ones (if the '''type''' is the same), so in this case ''BiggerQuarters'' will modify the STR_LIVING_QUARTERS of ''Xcom1Ruleset'', which is what you want. Normally you always want ''Xcom1Ruleset'' to come first.  Note that you can also specify the order of your rulesets when starting your game by selecting the rulesets in the order you would like to have them applied.
  
== External Links ==
+
If you need to specifically erase a field, for example to clear requirements for something (like making an item or research available from the start of the game), you can use "" for an empty string, [] for an empty list and {} for an empty map. For example:
  
* [http://openxcom.org/forum/index.php/board,8.0.html Modding forum]
+
requires: []
  
== Reference ==
+
If you want to remove an entire entry from a previous ruleset, you just need to specify "delete: STR_ID", for example:
  
A reference of all the customizable values of everything in a ruleset. Some guidelines:
+
facilities:
* If a value is omitted from the ruleset, the default is used. You cannot omit ''required'' values.
+
  - delete: STR_LIVING_QUARTERS
* 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 ===
+
But be careful, as this will break any saves already using that item. If you want people to be able to use your new ruleset on existing saves, it's safer to just disable it, like adding a requirement that can not be met. For example, if you want to make the Heavy Plasma unavailable for the player, you can add an otherwise non-existing research topic (for example "STR_ALIENS_ONLY", so it can be easily identified for later modifications...). this would have to be researched in order to use the weapon, but since it isn't defined anywhere else, it effectively disables the weapon for the player:
  
Defines one of the [[Country Funding (EU)|funding nations]], listed in ''"countries:"''. They're used for activity graphs and player scoring.
+
  - type: STR_HEAVY_PLASMA
 +
    requires:
 +
      - STR_ALIENS_ONLY
  
{| class="wikitable" width="100%"
+
== See Also ==
! width="150"| Value
 
! width="*"  | Description
 
! width="80" | 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'''
 
| List of "rectangles" 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 ===
+
* [[Ruleset Reference (OpenXcom)|Ruleset Reference]]
 
+
* [http://openxcom.org/forum/index.php/board,8.0.html Modding forum]
Defines one of the [[Geoscape (EU)#World Regions/Countries|world regions]], listed in ''"regions:"''. They're used for base placement, activity graphs and mission spawning.
 
 
 
{| class="wikitable" width="100%"
 
! width="150"| Value
 
! width="*"  | Description
 
! width="80" | Default
 
|-
 
| '''type'''
 
| String ID of the region name.
 
| ''required''
 
|-
 
| '''cost'''
 
| Amount of money spent building an X-COM base in this region (first base is free).
 
| 0
 
|-
 
| '''areas'''
 
| List of "rectangles" on the globe defined as ''[lon1, lat1, lon2, lat2]''. Any activity within these areas counts towards the region's graph activity.
 
| -
 
|-
 
| '''cities'''
 
| 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 "rectangles" (''[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 [[Base Facilities (EU)|facilities]] that can be built in an X-COM base, listed in ''"facilities:"''.
 
 
 
{| class="wikitable" width="100%"
 
! width="150"| Value
 
! width="*"  | Description
 
! width="80" | Default
 
|-
 
| '''type'''
 
| String ID of the facility name.
 
| ''required''
 
|-
 
| '''requires'''
 
| List of [[#Research|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'''
 
| Amount of money spent to build this facility in the base.
 
| 0
 
|-
 
| '''buildTime'''
 
| Amount of days it takes for this facility to be built.
 
| 0
 
|-
 
| '''monthlyCost'''
 
| Amount of money spent monthly for the maintenance of this facility.
 
| 0
 
|-
 
| '''storage'''
 
| Amount of storage space (for items) this facility provides. See [[Base Stores]].
 
| 0
 
|-
 
| '''personnel'''
 
| Amount of personnel (soldiers, scientsts, engineers) these quarters can contain.
 
| 0
 
|-
 
| '''aliens'''
 
| Amount of live aliens this facility can contain. Only checked if the ''alienContainmentLimitEnforced'' option is enabled.
 
| 0
 
|-
 
| '''crafts'''
 
| Amount of X-COM craft this facility can contain.
 
| 0
 
|-
 
| '''labs'''
 
| Amount of lab space this facility provides for research projects.
 
| 0
 
|-
 
| '''workshops'''
 
| Amount of workshop space this facility provides for manufacture projects.
 
| 0
 
|-
 
| '''psiLabs'''
 
| Amount of soldier space this facility provides for psionic training.
 
| 0
 
|-
 
| '''radarRange'''
 
| Maximum radar detection range of this facility, in nautical miles.
 
| 0
 
|-
 
| '''radarChance'''
 
| Chance (0-100%) of this radar detecting a UFO that enters its range.
 
| 0
 
|-
 
| '''defense'''
 
| Offensive power provided by this base defense against attacking UFOs.
 
| 0
 
|-
 
| '''hitRatio'''
 
| Chance (0-100) of the base defense hitting an attacking UFO.
 
| 0
 
|-
 
| '''fireSound'''
 
| Sound ID from [[SOUND#SAMPLE.CAT|SAMPLE.CAT]] played when the base defense fires.
 
| -1
 
|-
 
| '''hitSound'''
 
| Sound ID from [[SOUND#SAMPLE.CAT|SAMPLE.CAT]] played when the base defense hits a target.
 
| -1
 
|-
 
| '''mapName'''
 
| [[MAPS|Map]] associated to this facility in Battlescape base defenses.
 
| -
 
|-
 
|}
 
 
 
=== Crafts ===
 
 
 
Defines one of the [[Craft|X-COM crafts]] that go on interception missions, listed in ''"crafts:"''.
 
 
 
{| class="wikitable" width="100%"
 
! width="150"| Value
 
! width="*"  | Description
 
! width="80" | Default
 
|-
 
| '''type'''
 
| String ID of the craft name.
 
| ''required''
 
|-
 
| '''requires'''
 
| List of [[#Research|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 this craft in the Basescape and from [[INTICON.PCK]] used to draw the damage indicator in dogfights.
 
| -1
 
|-
 
| '''fuelMax'''
 
| Maximum amount of fuel this craft can carry. Crafts use up fuel based on their speed while travelling.
 
| 0
 
|-
 
| '''damageMax'''
 
| Maximum amount of damage this 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 this craft can equip. The UI can only display a max of 2 weapons.
 
| 0
 
|-
 
| '''soldiers'''
 
| Amount of soldiers this craft can carry.
 
| 0
 
|-
 
| '''vehicles'''
 
| Amount of vehicles this craft can carry.
 
| 0
 
|-
 
| '''costBuy'''
 
| Amount of money spent for purchasing this craft. If set to 0, the craft will not be available in the Purchase/Recruit screen.
 
| 0
 
|-
 
| '''costRent'''
 
| Amount of money spent monthly for renting this craft. If set to 0, the craft is not on rental and won't count towards base maintenance.
 
| 0
 
|-
 
| '''costSell'''
 
| Amount of money gained for selling this craft.
 
| 0
 
|-
 
| '''refuelItem'''
 
| Item required for refuelling this craft. If no item is specified, the craft uses human fuel.
 
| 0
 
|-
 
| '''repairRate'''
 
| Amount of damage restored every hour while [[Repairs|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 hours it takes to purchase/transfer this craft to a base.
 
| 0
 
|-
 
| '''score'''
 
| [[Score]] lost when this craft is destroyed.
 
| 0
 
|-
 
| '''spacecraft'''
 
| Can this craft go to [[Cydonia]]?
 
| false
 
|-
 
| '''battlescapeTerrainData'''
 
| [[#Terrains|Terrain]] associated to this craft in Battlescape missions.
 
|}
 
 
 
=== Craft Weapons ===
 
 
 
Defines one of the [[Craft Armaments|weapons]] equipped by X-COM craft for shooting down UFOs, listed in ''"craftWeapons:"''.
 
 
 
{| class="wikitable" width="100%"
 
! width="150"| Value
 
! width="*"  | Description
 
! width="80" | Default
 
|-
 
| '''type'''
 
| String ID of the weapon name.
 
| ''required''
 
|-
 
| '''sprite'''
 
| Sprite ID from [[BASEBITS.PCK]] used to draw the weapon in the Basescape and from [[INTICON.PCK]] used to draw the weapon in dogfights.
 
| -1
 
|-
 
| '''sound'''
 
| Sound ID from [[SOUND#SAMPLE.CAT|SAMPLE.CAT]] played when this weapon fires.
 
| -1
 
|-
 
| '''damage'''
 
| Amount of damage this weapon does to enemy UFOs.
 
| 0
 
|-
 
| '''range'''
 
| Maximum range of this weapon in dogfights (in meters).
 
| 0
 
|-
 
| '''accuracy'''
 
| Chance (0-100%) of each shot hitting the enemy UFO.
 
| 0
 
|-
 
| '''reloadCautious'''
 
| Time this weapon takes to fire between each shot in ''Cautious Mode''.
 
| 0
 
|-
 
| '''reloadStandard'''
 
| Time this weapon takes to fire between each shot in ''Standard Mode''.
 
| 0
 
|-
 
| '''reloadAggressive'''
 
| Time this weapon takes to fire between each shot in ''Aggressive Mode''.
 
| 0
 
|-
 
| '''ammoMax'''
 
| Maximum amount of ammo this weapon can carry.
 
| 0
 
|-
 
| '''rearmRate'''
 
| Amount of ammo restored every 30 mins while the craft is [[Rearming]] in base. If specified, a '''clip''' is spent each time.
 
| 1
 
|-
 
| '''projectileType'''
 
| Type of the weapon projectile, used for the projectile sprite in dogfights:
 
* 0 - [[Stingray]]
 
* 1 - [[Avalanche]]
 
* 2 - [[Cannon]]
 
* 3 - [[Fusion Ball]]
 
* 4 - [[Laser Cannon]]
 
* 5 - [[Plasma Beam]]
 
| 2
 
|-
 
| '''projectileSpeed'''
 
| Speed of the weapon projectile in dogfights.
 
| 0
 
|-
 
| '''launcher'''
 
| String ID of the [[#Items|item]] required to equip this weapon.
 
| -
 
|-
 
| '''clip'''
 
| String ID of the [[#Items|item]] required to rearm this weapon.
 
| -
 
|}
 
 
 
=== Items ===
 
 
 
Defines the Geoscape and Battlescape properties of an [[Equipment (EU)|item]] that can be stored in X-COM bases, listed in ''"items:"''.
 
 
 
{| class="wikitable" width="100%"
 
! width="150"| Value
 
! width="*"  | Description
 
! width="80" | Default
 
|-
 
| '''type'''
 
| String ID of the internal item name.
 
| ''required''
 
|-
 
| '''name'''
 
| String ID of the displayed item name, for cases where it's different from the internal name. If omitted, '''type''' is used.
 
| -
 
|-
 
| '''requires'''
 
| List of [[#Research|topics]] (string IDs) that must be researched to unlock this item. If none are specified, this item is unlocked from the start. Soldiers can only use unlocked items in the Battlescape.
 
| -
 
|-
 
| '''size'''
 
| Space occupied by this item in [[Base Stores]]. Can be a decimal value.
 
| 0.0
 
|-
 
| '''costBuy'''
 
| Amount of money spent for purchasing this item. If set to 0, this item will not be available in the Purchase/Recruit screen.
 
| 0
 
|-
 
| '''costSell'''
 
| Amount of money gained for selling this item.
 
| 0
 
|-
 
| '''transferTime'''
 
| Number of hours it takes to purchase/transfer this item to a base.
 
| 24
 
|-
 
| '''weight'''
 
| [[Item_Weight|Weight]] occupied by this item in a soldier's inventory.
 
| 999
 
|-
 
| '''bigSprite'''
 
| Sprite ID from [[BIGOBS.PCK]] used to draw this item in a soldier's inventory and UFOpaedia.
 
| -1
 
|-
 
| '''floorSprite'''
 
| Sprite ID from [[FLOOROB.PCK]] used to draw this item on the floor of a Battlescape tile.
 
| -1
 
|-
 
| '''handSprite'''
 
| Sprite ID from [[HANDOB.PCK]] used to draw this item on a soldier's hand in the Battlescape.
 
| 120
 
|-
 
| '''bulletSprite'''
 
| Sprite ID from ''BulletSprites.png'' used to draw this weapon's projectile on the Battlescape:
 
* 0 - [[Rocket Launcher]]
 
* 1 - [[Pistol]]
 
* 2 - [[Rifle]]
 
* 3 - [[Auto Cannon]]
 
* 4 - [[Heavy Cannon]]
 
* 5 - [[Laser Pistol]]
 
* 6 - [[Laser Rifle]]
 
* 7 - [[Heavy Laser]]
 
* 8 - [[Plasma Rifle|Plasma]]
 
* 9 - [[Small Launcher]]
 
* 10 - [[Blaster Launcher]]
 
| -1
 
|-
 
| '''fireSound'''
 
| Sound ID from [[SOUND#SAMPLE2.CAT|SAMPLE2.CAT]] played when this weapon fires.
 
| -1
 
|-
 
| '''hitSound'''
 
| Sound ID from [[SOUND#SAMPLE2.CAT|SAMPLE2.CAT]] played when this weapon hits a target.
 
| -1
 
|-
 
| '''hitAnimation'''
 
| Sprite ID from [[SMOKE.PCK]] used to draw the weapon's "hit explosion".
 
'''NOTE''': Do not define this value for melee/psi weapons, they use [[HIT.PCK]] instead.
 
| 0
 
|-
 
| '''power'''
 
| Average damage of the weapon, in most cases it will be +-50% this value.
 
| 0
 
|-
 
| '''compatibleAmmo'''
 
| List of string IDs of the ammo items that can be loaded on this weapon. If none are specified, the weapon doesn't need ammo.
 
| -
 
|-
 
| '''damageType'''
 
| What type of [[damage]] does this weapon do:
 
* 0 - None
 
* 1 - Armor Piercing
 
* 2 - Incendiary
 
* 3 - High Explosive
 
* 4 - Laser
 
* 5 - Plasma
 
* 6 - Stun
 
* 7 - Melee
 
* 8 - Acid
 
* 9 - Smoke
 
| 0
 
|-
 
| '''tuAuto'''
 
'''accuracyAuto'''
 
| The percentage (0-100%) of [[Time Units]] (from the soldier's total) required to fire an Auto Shot. If 0, the weapon does not have an Auto Shot.
 
The base accuracy (0-100%) applied to a soldier's [[Firing Accuracy]] when firing an Auto Shot.
 
| 0
 
0
 
|-
 
| '''tuSnap'''
 
'''accuracySnap'''
 
| The percentage (0-100%) of [[Time Units]] (from the soldier's total) required to fire a Snap Shot. If 0, the weapon does not have a Snap Shot.
 
The base accuracy (0-100%) applied to a soldier's [[Firing Accuracy]] when firing a Snap Shot.
 
| 0
 
0
 
|-
 
| '''tuAimed'''
 
'''accuracyAimed'''
 
| The percentage (0-100%) of [[Time Units]] (from the soldier's total) required to fire an Aimed Shot. If 0, the weapon does not have an Aimed Shot.
 
The base accuracy (0-100%) applied to a soldier's [[Firing Accuracy]] when firing an Aimed Shot.
 
| 0
 
0
 
|-
 
|-
 
| '''tuMelee'''
 
'''accuracyMelee'''
 
| The percentage (0-100%) of [[Time Units]] (from the soldier's total) required to do a melee attack (Hit). If 0, the weapon does not have a melee attack.
 
The base accuracy (0-100%) applied to a soldier's [[Melee Accuracy]] when doing a melee attack.
 
| 0
 
0
 
|-
 
| '''clipSize'''
 
| The amount of ammo stored in each weapon clip. If -1 is specified, this weapon has infinite ammo.
 
| 0
 
|-
 
| '''battleType'''
 
| Defines the weapon's behavior in the Battlescape:
 
* 0 - None (Geoscape-only item)
 
* 1 - [[Weapons|Firearm]]
 
* 2 - Ammo
 
* 3 - Melee
 
* 4 - [[Grenade]]
 
* 5 - [[Proximity Grenade]]
 
* 6 - [[Medi-Kit (EU)|Medi-Kit]]
 
* 7 - [[Motion Scanner]]
 
* 8 - [[Mind Probe]]
 
* 9 - [[Electro-flare]]
 
* 10 - Corpse
 
| 0
 
|-
 
| '''twoHanded'''
 
| Is this weapon two-handed? (incurs an accuracy penalty if used with both hands occupied)
 
| false
 
|-
 
| '''waypoint'''
 
| Does this weapon use waypoints? (eg. [[Blaster Launcher]])
 
| false
 
|-
 
| '''fixedWeapon'''
 
| Is this weapon fixed? (it's part of a unit, eg. tanks and terrorist units)
 
| false
 
|-
 
| '''invWidth'''
 
| Item width in a soldier's inventory (in grid units).
 
| 1
 
|-
 
| '''invHeight'''
 
| Item height in a soldier's inventory (in grid units).
 
| 1
 
|-
 
| '''painKiller'''
 
| Amount of painkillers contained in a [[Medi-Kit (EU)|Medi-Kit]].
 
| 0
 
|-
 
| '''heal'''
 
| Amount of heal's contained in a [[Medi-Kit (EU)|Medi-Kit]].
 
| 0
 
|-
 
| '''stimulant'''
 
| Amount of stimulants contained in a [[Medi-Kit (EU)|Medi-Kit]].
 
| 0
 
|-
 
| '''woundRecovery'''
 
| Amount of [[Fatal Wounds]] treated by each heal of a [[Medi-Kit (EU)|Medi-Kit]].
 
| 0
 
|-
 
| '''healthRecovery'''
 
| Amount of [[Health]] recovered by each heal of a [[Medi-Kit (EU)|Medi-Kit]].
 
| 0
 
|-
 
| '''stunRecovery'''
 
| Amount of [[Stun]] removed by each stimulant of a [[Medi-Kit (EU)|Medi-Kit]].
 
| 0
 
|-
 
| '''energyRecovery'''
 
| Amount of [[Energy]] recovered by each stimulant of a [[Medi-Kit (EU)|Medi-Kit]].
 
| 0
 
|-
 
| '''tuUse'''
 
| Amount of [[Time Units]] required to use this item (for non-offensive items). It's a flat rate if '''flatRate''' is true, otherwise it's a percentage (0-100%).
 
| 0
 
|-
 
| '''recoveryPoints'''
 
| [[Score]] gained for recovering this alien artifact.
 
| 0
 
|-
 
| '''armor'''
 
| How much damage is needed to destroy this item on the ground.
 
| 20
 
|-
 
| '''recover'''
 
| Is this item recoverable? (gets transported to the X-COM base on mission success)
 
| false
 
|-
 
| '''turretType'''
 
| Sprite ID from [[TANKS.PCK]] of the turret to assign to this tank:
 
* 0 - [[Tank/Cannon]]
 
* 1 - [[Tank/Rocket Launcher]]
 
* 2 - [[Tank/Laser Cannon]]
 
* 3 - [[Hovertank/Plasma]]
 
* 4 - [[Hovertank/Launcher]]
 
| -1
 
|-
 
| '''liveAlien'''
 
| Does this item represent a live alien? (counts towards [[Alien Containment]])
 
| false
 
|-
 
| '''blastRadius'''
 
| Size of the projectile explosions. 0 for no explosion. -1 to automatically calculate based on weapon power and damage type.
 
| -1
 
|-
 
| '''flatRate'''
 
| Is '''tuUse''' a flat rate (true) or a percentage (false)?
 
| false
 
|-
 
| '''arcingShot'''
 
| Does this weapon fire in an arc?
 
| false
 
|-
 
| '''attraction'''
 
| Represents how likely an alien is to pick up this item. Values below 5 will be ignored (by design).
 
| 0
 
|-
 
| '''maxRange'''
 
| Maximum range at which this weapon can operate (0 for infinite range).
 
| 0
 
|-
 
| '''bulletSpeed'''
 
| How much faster (or slower, if you use a negative number) is a projectile fired from this weapon compared to the average.
 
| 0
 
|-
 
| '''autoShots'''
 
| How many auto shots does this weapon fire.
 
| 3
 
|}
 
 
 
=== UFOs ===
 
 
 
Defines one of the [[UFOs]] that invade Earth, listed in ''"ufos:"''.
 
 
 
{| class="wikitable" width="100%"
 
! width="150"| Value
 
! width="*"  | Description
 
! width="80" | Default
 
|-
 
| '''type'''
 
| String ID of the UFO name.
 
| ''required''
 
|-
 
| '''size'''
 
| String ID of the UFO size.
 
| STR_VERY_SMALL
 
|-
 
| '''sprite'''
 
| Sprite ID from [[INTERWIN.DAT]] used to draw this UFO in the dogfight view and UFOpaedia.
 
| -1
 
|-
 
| '''damageMax'''
 
| Maximum amount of damage this UFO can take. If the UFO takes 50% damage, it crash lands. If it takes 100% damage, it is destroyed.
 
| 0
 
|-
 
| '''speedMax'''
 
| Maximum speed in nautical miles.
 
| 0
 
|-
 
| '''accel'''
 
| Aceeleration value shown in the UFOpaedia.
 
| 0
 
|-
 
| '''power'''
 
| Damage power of this UFO's weapon in dogfights.
 
| 0
 
|-
 
| '''range'''
 
| Maximum range of this UFO's weapon in dogfights (in meters).
 
| 0
 
|-
 
| '''score'''
 
| [[Score]] gained when this UFO is destroyed, or half this score if it crash lands.
 
| 0
 
|-
 
| '''reload'''
 
| Time the UFO's weapon takes to fire between each shot.
 
| 0
 
|-
 
| '''breakOffTime'''
 
| Minimum amount of time for the UFO to be able to break off of a dogfight.
 
| 0
 
|-
 
| '''battlescapeTerrainData'''
 
| [[#Terrains|Terrain]] associated to this UFO in Battlescape missions.
 
| ''required''
 
|-
 
|}
 
 
 
=== Inventory Sections ===
 
 
 
Defines one of the sections of the [[Inventory TU Table|Battlescape inventory]] (eg. Backpack), listed in ''"invs:"''.
 
 
 
{| class="wikitable" width="100%"
 
! width="150"| Value
 
! width="*"  | Description
 
! width="80" | Default
 
|-
 
| '''type'''
 
| String ID of the inventory name.
 
| ''required''
 
|-
 
| '''x'''
 
'''y'''
 
| Pixel coordinates of this section on the inventory screen.
 
| 0
 
0
 
|-
 
| '''type'''
 
| Type of this section:
 
* 0 = Slot section, can contain as many items as will fit on the slots.
 
* 1 = Hand section, can only contain one item regardless of size.
 
* 2 = Ground section, can contain infinite items.
 
| 0
 
|-
 
| '''slots'''
 
| List of the grid slots (''[x, y]'') that this section is composed of. For example, to make a 2x2 section, you would have ''[0, 0] [0, 1] [1, 0] [1, 1]''.
 
| -
 
|-
 
| '''costs'''
 
| List of [[Time Units]] costs to move an item from this section to another one (eg. ''STR_BACKPACK: 16'' means it will cost 16 TUs to move an item from this section to the Backpack).
 
| -
 
|-
 
|}
 
 
 
=== Terrains ===
 
 
 
Defines one of the [[TERRAIN|terrains]] used to generate a Battlescape map, listed in "terrains:".
 
 
 
{| class="wikitable" width="100%"
 
! width="150"| Value
 
! width="*"  | Description
 
! width="80" | Default
 
|-
 
| '''name'''
 
| String ID of the terrain name.
 
| ''required''
 
|-
 
| '''largeBlockLimit'''
 
| Maximum amount of large blocks that can be used on map generation.
 
| 0
 
|-
 
| '''textures'''
 
| List of [[TEXTURE.DAT|Geoscape textures]] that correspond to this terrain.
 
| -
 
|-
 
| '''hemisphere'''
 
| Geoscape hemisphere associated with this terrain:
 
* -1 - Northern hemisphere.
 
* 0 - Both hemispheres.
 
* 1 - Southern hemisphere.
 
| 0
 
|-
 
| '''mapDataSets'''
 
| List of filenames (each with matching [[MCD]]/[[Image Formats#PCK|PCK/TAB]] files) that contain the tiles of this terrain.
 
| -
 
|-
 
| '''mapBlocks'''
 
| List of map blocks (see below) that are used for generating a map.
 
| -
 
|}
 
 
 
==== Map Blocks ====
 
 
 
{| class="wikitable" width="100%"
 
! width="150"| Value
 
! width="*"  | Description
 
! width="80" | Default
 
|-
 
| '''name'''
 
| Filename of the [[MAPS|map]].
 
| ''required''
 
|-
 
| '''width'''
 
| Width of this map block in Battlescape grid units.
 
| 0
 
|-
 
| '''length'''
 
| Length of this map block in Battlescape grid units.
 
| 0
 
|-
 
| '''height'''
 
| Height of this map block in Battlescape grid units.
 
| 1
 
|-
 
| '''type'''
 
| Type of this map block:
 
* -1 - Undefined
 
* 0 - Default
 
* 1 - Landing Zone (for placing X-COM / alien craft)
 
* 2 - E-W Road (for city maps)
 
* 3 - N-S Road (for city maps)
 
* 4 - Road Crossing (for city maps)
 
* 5 - Dirt (for filling empty base blocks)
 
* 6 - X-COM spawn point (for [[Alien Base]] / [[Cydonia]] missions)
 
* 7 - [[Alien Base]] Target
 
* 8 - [[Cydonia]] Target
 
| -1
 
|-
 
| '''subType'''
 
| Sub-type of this map block (see '''type''').
 
| -1
 
|-
 
| '''frequency'''
 
| Frequency of this block in a map.
 
| 1
 
|-
 
| '''maxCount'''
 
| Maximum amount of times this block can be used in a map. If -1 there is no limit.
 
| -1
 
|}
 
 
 
=== Armor ===
 
 
 
Defines a Battlescape unit's [[armor]] as well as visual representation (so every unit has an armor), listed in ''"armors:"''.
 
 
 
{| class="wikitable" width="100%"
 
! width="150"| Value
 
! width="*"  | Description
 
! width="80" | Default
 
|-
 
| '''type'''
 
| String ID of the armor name.
 
| ''required''
 
|-
 
| '''spriteSheet'''
 
| Sprite sheet from [[UNITS]] used to draw a unit wearing this armor.
 
| -
 
|-
 
| '''spriteInv'''
 
| Sprite used for the [[Inventory Backgrounds]] of a unit wearing this armor.
 
| -
 
|-
 
| '''corpseItem'''
 
| String ID of the corpse [[#Items|item]] generated when a unit wearing this armor is killed.
 
| -
 
|-
 
| '''storeItem'''
 
| String ID of the [[#Items|item]] that represents this armor in [[Base Stores]].
 
| -
 
|-
 
| '''frontArmor'''
 
| Protection provided on the front of the unit.
 
| 0
 
|-
 
| '''sideArmor'''
 
| Protection provided on the sides of the unit.
 
| 0
 
|-
 
| '''rearArmor'''
 
| Protection provided on the rear of the unit.
 
| 0
 
|-
 
| '''underArmor'''
 
| Protection provided under the unit (eg. from explosions).
 
| 0
 
|-
 
| '''drawingRoutine'''
 
| Drawing routine used to put together the body parts in the unit's '''spriteSheet''':
 
* 0 = [[Soldier]], [[Sectoid]], [[Muton]]
 
* 1 = [[Floater]]
 
* 2 = [[HWP]]
 
* 3 = [[Cyberdisk]]
 
* 4 = [[Civilian]], [[Ethereal]]
 
* 5 = [[Sectopod]], [[Reaper]]
 
* 6 = [[Snakeman]]
 
* 7 = [[Chryssalid]]
 
* 8 = [[Silacoid]]
 
* 9 = [[Celatid]]
 
| 0
 
|-
 
| '''movementType'''
 
| Type of movement provided by this armor:
 
* 0 = Walking
 
* 1 = Flying
 
* 2 = Sliding (no walking animation)
 
| 0
 
|-
 
| '''damageModifier'''
 
| List of decimal damage modifiers (1.0 = 100%) this armor applies to each damage type (see [[#Items|Items section]]) received. Modifiers must be specified for all damage types, in this order:
 
* None
 
* Armor Piercing
 
* Incendiary
 
* High Explosive
 
* Laser
 
* Plasma
 
* Stun
 
* Melee
 
* Acid
 
* Smoke
 
|
 
- 1.0<br>
 
- 1.0<br>
 
- 1.0<br>
 
- 1.0<br>
 
- 1.0<br>
 
- 1.0<br>
 
- 1.0<br>
 
- 1.0<br>
 
- 1.0<br>
 
- 1.0
 
|-
 
| '''size'''
 
| Size of the unit wearing this armor, in Battlescape grid units. Every unit is square, so a size of 2 means 2x2.
 
| 1
 
|-
 
| '''loftempsSet'''
 
| List of [[LOFTEMPS]] IDs (one per unit tile, so a 1x1 unit has 1, a 2x2 unit has 4, etc.) used to represent a unit wearing this armor in 3D space.
 
| -
 
|}
 
 
 
=== Player Units (Soldiers) ===
 
 
 
Defines a [[soldier]] recruited by X-COM, listed in ''"soldiers:"''. Currently only one soldier unit type (''XCOM'') is supported.
 
 
 
Unit stats are represented as follows:
 
* [[Time Units|tu]]
 
* [[Energy|stamina]]
 
* [[Health|health]]
 
* [[Bravery|bravery]] (always a multiple of 10)
 
* [[Reactions|reactions]]
 
* [[Firing Accuracy|firing]]
 
* [[Throwing Accuracy|throwing]]
 
* [[Strength|strength]]
 
* [[Psi Strength|psiStrength]]
 
* [[Psi Skill|psiSkill]]
 
* [[Melee Accuracy|melee]] (not visible)
 
 
 
{| class="wikitable" width="100%"
 
! width="150"| Value
 
! width="*"  | Description
 
! width="80" | Default
 
|-
 
| '''type'''
 
| String ID of the soldier name.
 
| ''required''
 
|-
 
| '''minStats'''
 
| Minimum values used to generate the soldier's [[Starting Stats]]. In this case, ''psiSkill'' is treated as the initial stat (not generated).
 
| -
 
|-
 
| '''maxStats'''
 
| Maximum values used to generate the soldier's [[Starting Stats]]. In this case, ''psiSkill'' is treated as the minimum value for the first month of psi training (actual value is 100%-150%).
 
| -
 
|-
 
| '''statCaps'''
 
| Maximum stats this soldier can gain through [[Experience]]. '''NOTE:''' A stat will still go over the limit once, and then will no longer increase (see [[Experience#Regarding Caps|Regarding Caps]]).
 
| -
 
|-
 
| '''armor'''
 
| String ID of the [[#Armor|armor]] this soldier uses by default.
 
| -
 
|-
 
| '''standHeight'''
 
| Height of this soldier when standing.
 
| 0
 
|-
 
| '''kneelHeight'''
 
| Height of this soldier when kneeling.
 
| 0
 
|-
 
| '''floatHeight'''
 
| Distance between the bottom of this unit and the ground.
 
| 0
 
|}
 
 
 
=== AI Units (Aliens/Civilians) ===
 
 
 
Defines an [[Alien Life Forms|alien]] (enemy) or [[civilian]] (neutral) unit, listed in ''"units:"''. Every different alien rank is a different unit, since they have completely different stats. Unit stats are represented as follows:
 
* [[Time Units|tu]]
 
* [[Energy|stamina]]
 
* [[Health|health]]
 
* [[Bravery|bravery]] (always a multiple of 10)
 
* [[Reactions|reactions]]
 
* [[Firing Accuracy|firing]]
 
* [[Throwing Accuracy|throwing]]
 
* [[Strength|strength]]
 
* [[Psi Strength|psiStrength]]
 
* [[Psi Skill|psiSkill]]
 
* [[Melee Accuracy|melee]] (not visible)
 
 
 
{| class="wikitable" width="100%"
 
! width="150"| Value
 
! width="*"  | Description
 
! width="80" | Default
 
|-
 
| '''type'''
 
| String ID of the unit name.
 
| ''required''
 
|-
 
| '''race'''
 
| String ID of the unit race (for alien units).
 
| -
 
|-
 
| '''rank'''
 
| String ID of the unit rank (for alien units).
 
| -
 
|-
 
| '''stats'''
 
| Battlescape stats of this unit.
 
| -
 
|-
 
| '''armor'''
 
| String ID of the [[#Armor|armor]] this unit uses by default.
 
| -
 
|-
 
| '''standHeight'''
 
| Height of this unit when standing.
 
| 0
 
|-
 
| '''floatHeight'''
 
| Distance between the bottom of this unit and the ground.
 
| 0
 
|-
 
| '''value'''
 
| [[Score]] this unit is worth.
 
| 0
 
|-
 
| '''deathSound'''
 
| Sound ID from [[SOUND#SAMPLE2.CAT|SAMPLE2.CAT]] played when this unit dies.
 
| -1
 
|-
 
| '''aggroSound'''
 
| Sound ID from [[SOUND#SAMPLE2.CAT|SAMPLE2.CAT]] played when this unit aggros.
 
| -1
 
|-
 
| '''moveSound'''
 
| Sound ID from [[SOUND#SAMPLE2.CAT|SAMPLE2.CAT]] played when this unit moves.
 
| -1
 
|-
 
| '''intelligence'''
 
| Intelligence of this unit's AI. The higher the value, the longer this unit remembers player troops.
 
| 0
 
|-
 
| '''aggression'''
 
| Aggression of this unit's AI. The higher the value, the more ruthless the unit.
 
| 0
 
|-
 
| '''specab'''
 
| Special ability of this unit:
 
* 0 = None
 
* 1 = [[Cyberdisc|Explodes on Death]]
 
* 2 = [[Bio-Drone|Burns Floor]]
 
* 3 = [[Zombie|Respawns on Death]]
 
| 0
 
|-
 
| '''zombieUnit'''
 
| String ID of the unit used for zombification (eg. [[Chrysallid]]s turn units into [[Zombie]]s).
 
| -
 
|-
 
| '''spawnUnit'''
 
| String ID of the unit used to respawn on death (eg. [[Zombie]]s respawn as [[Chrysallid]]s).
 
| -
 
|-
 
| '''livingWeapon'''
 
| Is this unit a living weapon? (only attacks with a '''fixedWeapon''')
 
| false
 
|-
 
|}
 
 
 
=== Alien Races ===
 
 
 
Defines a [[Alien Life Forms|race]] used in [[Alien Missions]], listed in ''"alienRaces:"''. Heavily tied with deployment data.
 
 
 
{| class="wikitable" width="100%"
 
! width="150"| Value
 
! width="*"  | Description
 
! width="80" | Default
 
|-
 
| '''id'''
 
| String ID of the alien race name.
 
| ''required''
 
|-
 
| '''members'''
 
| Alien crew associated with this alien race (eg. race units + terrorist units), defined by a list of unit string IDs. Order here will define rank in terms of deployment. generally speaking the order is:
 
* 0 - Commander
 
* 1 - Leader
 
* 2 - Engineer
 
* 3 - Medic
 
* 4 - Navigator
 
* 5 - Soldier
 
* 6 - Terrorist 1
 
* 7 - Terrorist 2
 
but of course, not all races have all ranks, so the "fill in" rank would be listed multiple times (see ethereals).
 
| -
 
|}
 
 
 
=== Alien Deployments ===
 
 
 
Defines a Battlescape deployment data used in [[Alien Missions]] (such as alien and map configurations), listed in ''"alienDeployments:"''.
 
 
 
{| class="wikitable" width="100%"
 
! width="150"| Value
 
! width="*"  | Description
 
! width="80" | Default
 
|-
 
| '''type'''
 
| String ID of the deployment name.
 
| ''required''
 
|-
 
| '''width'''
 
| Width of the Battlescape map in grid units.
 
| 0
 
|-
 
| '''length'''
 
| Length of the Battlescape map in grid units.
 
| 0
 
|-
 
| '''height'''
 
| Vertical height of the Battlescape map in grid units.
 
| 0
 
|-
 
| '''civilians'''
 
| Amount of civilians to deploy.
 
| 0
 
|-
 
| '''roadTypeOdds'''
 
| Odds as a % of generating each type of road (E-W Road, N-S Road, Crossing) odds for crossing are: 100 - EW - NS.
 
| [0 0]
 
|-
 
| '''terrain'''
 
| String ID of the [[#Terrains|terrain]] used to generate this map. This is not used for UFO sites where the terrain comes from the Geoscape.
 
| -
 
|-
 
| '''shade'''
 
| Shade of the map (0-15, where 0 is full daytime and 15 is full nighttime). This is not used for UFO sites where the shade comes from the Geoscape.
 
| 0
 
|-
 
| '''nextStage'''
 
| String ID of the next deployment stage to use after this one, for multi-stage missions.
 
| -
 
|-
 
| '''data'''
 
| List of deployment data for each alien rank on this mission (see below).
 
| -
 
|}
 
 
 
==== Deployment Data ====
 
 
 
{| class="wikitable" width="100%"
 
! width="150"| Value
 
! width="*"  | Description
 
! width="80" | Default
 
|-
 
| '''alienRank'''
 
| [[Alien Rank|Rank]] associated with this deployment data, as defined by the order of the race in question (see above)
 
| ''required''
 
|-
 
| '''lowQty'''
 
| Maximum quantity of aliens to spawn (beginner).
 
| 0
 
|-
 
| '''highQty'''
 
| Maximum quantity of aliens to spawn (superhuman).
 
| 0
 
|-
 
| '''dQty'''
 
| Minimum Desired Quantity of aliens to spawn.
 
| 0
 
|-
 
| '''percentageOutsideUfo'''
 
| Percentage (0-100%) of aliens to spawn outside in UFO sites.
 
| 0
 
|-
 
| '''itemSets'''
 
| Three lists (one for each alien technology level) of [[#Items|items]] (string IDs) for the aliens to equip.
 
| ''required''
 
|-
 
|}
 
 
 
=== Research ===
 
 
 
Defines a [[Research|research topic]] that X-COM scientists can investigate, listed in ''"research:"''.
 
 
 
{| class="wikitable" width="100%"
 
! width="150"| Value
 
! width="*"  | Description
 
! width="80" | Default
 
|-
 
| '''name'''
 
| String ID of the research project's name (or item, if a '''lookup''' is defined).
 
| ''required''
 
|-
 
| '''lookup'''
 
| String ID of the research project's display name and UFOPaedia article reference.
 
| -
 
|-
 
| '''cost'''
 
| Number of man hours (on average) required to complete this project.
 
| 0
 
|-
 
| '''points'''
 
| [[Score]] earned for completing this project.
 
| 0
 
|-
 
| '''needItem'''
 
| Does this project require an [[#Items|item]] of the same name?
 
| false
 
|-
 
| '''dependencies'''
 
| List of research projects that can unlock access to this one. If the full list is researched, or if one of the projects on the list "unlocks" this one,  it becomes available.
 
| -
 
|-
 
| '''unlocks'''
 
| List of research projects unlocked, regardless of other dependencies, but not requirements, by completing this project (for example, any live alien unlocks "alien origins").
 
| -
 
|-
 
| '''requires'''
 
| List of research projects unilaterally required before this project can be unlocked (for example, "the martian solution" will not even be considered for unlocking until AFTER "alien origins" is completed).
 
| -
 
|-
 
| '''getOneFree'''
 
| List of "bonus" research projects that may be granted when completing this project (for example, alien medics will give you information on other alien races).
 
| -
 
|-
 
|}
 
 
 
=== Manufacture ===
 
 
 
Defines a [[Manufacture|manufacture project]] that X-COM engineers can produce, listed in ''"manufacture:"''.
 
 
 
{| class="wikitable" width="100%"
 
! width="150"| Value
 
! width="*"  | Description
 
! width="80" | Default
 
|-
 
| '''name'''
 
| String ID of the manufacturing project's name (and the item it produces).
 
| ''required''
 
|-
 
| '''category'''
 
| String ID of the manufacturing project's category.
 
| -
 
|-
 
| '''requires'''
 
| List of [[#Research|topics]] (string IDs) that must be researched to unlock this project. If none are specified, this project is unlocked from the start.
 
| -
 
|-
 
| '''space'''
 
| Amount of [[Workshop]] space required to begin this project.
 
| 0
 
|-
 
| '''time'''
 
| Number of man hours (on average) required per item.
 
| 0
 
|-
 
| '''cost'''
 
| Monetary deduction per item manufactured.
 
| 0
 
|-
 
| '''requiredItems'''
 
| List of [[#Items|items]] required and consumed per item manufactured.
 
| -
 
|-
 
|}
 
 
 
=== UFOpaedia Article ===
 
 
 
Defines an article in the in-game [[UFOpaedia]], listed in ''"ufopaedia:"''.
 
 
 
{| class="wikitable" width="100%"
 
! width="150"| Value
 
! width="*"  | Description
 
! width="80" | Default
 
|-
 
| '''id'''
 
| String ID of the article name. This must match the ID of the object associated with this article, if applicable.
 
| ''required''
 
|-
 
| '''title'''
 
| String ID of the article title. If omitted, the '''id''' is used.
 
| -
 
|-
 
| '''type_id'''
 
| Type of this article:
 
* 0 = Unknown
 
* 1 = [[Craft]]
 
* 2 = [[Craft Armaments]]
 
* 3 = [[HWP]]
 
* 4 = [[Equipment (EU)|Equipment]]
 
* 5 = [[Armour]]
 
* 6 = [[Base Facilities]]
 
* 7 = Text & Image (eg. [[Alien Life Forms]], [[UFO Components]])
 
* 8 = Text (eg. [[Alien Research]])
 
* 9 = [[UFO]]
 
| 0
 
|-
 
| '''section'''
 
| String ID of the UFOpaedia section this article belongs in.
 
| -
 
|-
 
| '''requires'''
 
| List of [[#Research|topics]] (string IDs) that must be researched to unlock this article. If none are specified, this article is unlocked from the start.
 
| -
 
|-
 
| '''image_id'''
 
| Filename of the [[UP001.SPK-UP042.SPK|background image]] displayed on this article, if applicable.
 
| -
 
|-
 
| '''text'''
 
| String ID of the description displayed on this article.
 
| -
 
|-
 
| '''text_width'''
 
| Maximum width of the text displayed, only applicable to ''Text & Image'' articles.
 
| 0
 
|-
 
| '''rect_stats'''
 
| Rectangle ('''x''', '''y''', '''width''', '''height''') of the stats text on the screen, only applicable to ''Craft'' articles.
 
| 0
 
|-
 
| '''rect_text'''
 
| Rectangle ('''x''', '''y''', '''width''', '''height''') of the description text on the screen, only applicable to ''Craft'' articles.
 
| 0
 
|-
 
| '''weapon'''
 
| String ID of the weapon, only applicable to ''HWP'' articles.
 
| -
 
|}
 
 
 
=== UFO Trajectories ===
 
 
 
Defines a trajectory carried out by an UFO during an [[#Alien Missions|alien mission]], listed in ''"ufoTrajectories:"''.
 
 
 
{| class="wikitable" width="100%"
 
! width="150"| Value
 
! width="*"  | Description
 
! width="80" | Default
 
|-
 
| '''id'''
 
| String ID of the trajectory name.
 
| ''required''
 
|-
 
| '''groundTimer'''
 
| Amount of seconds for the UFO to spend on Ground waypoints.
 
| 0
 
|-
 
| '''waypoints'''
 
| List of waypoints for the UFO to traverse, defined as ''[zone, altitude, speed]''.<br>
 
'''zone''': Globe zone where the waypoint is located.<br>
 
'''altitude''': UFO altitude after reaching this waypoint:
 
* 0 - Ground
 
* 1 - Very Low
 
* 2 - Low
 
* 3 - High
 
* 4 - Very High
 
'''speed''': UFO speed after reaching this waypoint, as a percentage (0-100%) of its maximum speed.
 
| -
 
|}
 
 
 
=== Alien Missions ===
 
 
 
Defines an [[Alien Missions|alien mission]] carried out by UFOs on the Geoscape, listed in ''"alienMissions:"''.
 
 
 
{| class="wikitable" width="100%"
 
! width="150"| Value
 
! width="*"  | Description
 
! width="80" | Default
 
|-
 
| '''type'''
 
| String ID of the mission type.
 
| ''required''
 
|-
 
| '''points'''
 
| [[Score]] allocated to aliens for successfully completing this mission.
 
| 0
 
|-
 
| '''raceWeights'''
 
| List of alien races likely to carry out this mission, and the % chance of them being allocated to this mission, listed by "number of months after game beginning".
 
| ''required''
 
|-
 
| '''waves'''
 
| List of UFO waves to spawn as this mission progresses, as described below.
 
| ''required''
 
|}
 
 
 
==== Waves ====
 
 
 
{| class="wikitable" width="100%"
 
! width="150"| Value
 
! width="*"  | Description
 
! width="80" | Default
 
|-
 
| '''ufo'''
 
| String ID of the [[#UFOs|UFO]] to spawn.
 
| ''required''
 
|-
 
| '''count'''
 
| Number of UFOs to spawn.
 
| 0
 
|-
 
| '''trajectory'''
 
| String ID of the [[#UFO Trajectories|trajectory]] for this UFO to use when entering Earth's atmosphere.
 
| ''required''
 
|-
 
| '''timer'''
 
| How long after the previous wave should this wave arrive?
 
| 0
 
|-
 
|}
 
 
 
=== Alien Item Levels ===
 
 
 
This is a list of item level probabilities, with a number between 0 and 2 representing an item level from plasma pistols to heavy plasmas, as defined in the deployments, expressing a 10% probability for that item level being used.
 
 
 
For example:
 
[ 2, 0, 0, 0, 0, 0, 0, 1, 1, 1 ]
 
would represent a 60% chance for pistols, 30% rifles, and 10% heavy weapons.<br>
 
Note that the order does not matter, but the length DOES. each line MUST have 10 digits.
 
 
 
Each line represents a month after the beginning of the game, and there is no limit to the number defined.<br>
 
OpenXCom will use the most recently available item level in the event the game goes on forever.
 
 
 
=== Extra Sprites ===
 
 
 
Adds or replaces sprites in an existing [[Image Formats|X-COM image file]], listed in ''"extraSprites:"''.
 
 
 
{| class="wikitable" width="100%"
 
! width="150"| Value
 
! width="*"  | Description
 
! width="80" | Default
 
|-
 
| '''type'''
 
| Filename of the original/new image to modify.
 
| ''required''
 
|-
 
| '''width'''
 
'''height'''
 
| Size of the sprite(s) in pixels.
 
| 0
 
0
 
|-
 
| '''singleImage'''
 
| Is the image file just a single sprite (true) or a spritesheet (false)?
 
| false
 
|-
 
| '''subX'''
 
'''subY'''
 
| Size of the subdivision in pixels. If a subdivision is specified, then the image file is divided into chunks to form the sprites (eg. spritesheets).
 
| 0
 
0
 
|-
 
| '''files'''
 
| List of the new sprites to add/replace, listed as ''spriteID: filename''.
 
| -
 
|}
 
 
 
Example:
 
- type: GIANTBUNNY.PCK
 
  width: 32
 
  height: 40
 
  files:
 
    0: Resources/Bunny/Bunny00.png
 
    1: Resources/Bunny/Bunny01.bmp
 
    2: Resources/Bunny/Bunny02.gif
 
 
 
=== Extra Sounds ===
 
 
 
Adds or replaces sounds in an existing [[SOUND|X-COM sound file]], listed in ''"extraSounds:"''.
 
 
 
{| class="wikitable" width="100%"
 
! width="150"| Value
 
! width="*"  | Description
 
! width="80" | Default
 
|-
 
| '''type'''
 
| ID of the original sound file to modify:
 
* BATTLE.CAT - Battlescape sounds, corresponds to ''SOUND1.CAT'' or ''SAMPLE2.CAT'' (55 sounds).
 
* INTRO.CAT - Intro sounds, corresponds to ''INTRO.CAT'' or ''SAMPLE3.CAT'', probably best not to mess with these.
 
* GEO.CAT - Geoscape sounds, corresponds to ''SOUND1.CAT'' or ''SAMPLE2.CAT'' (14 sounds).
 
| ''required''
 
|-
 
| '''files'''
 
| List of the new sounds to add/replace, listed as ''soundID: filename''.
 
| -
 
|}
 
 
 
Example:
 
- type: BATTLE.CAT
 
  files:
 
    55: Resources/Sounds/sample.wav
 
 
 
=== Extra Strings ===
 
 
 
Adds or replaces text strings in an existing [[Translations (OpenXcom)|OpenXcom language file]], listed in ''"extraStrings:"''.
 
 
 
{| class="wikitable" width="100%"
 
! width="150"| Value
 
! width="*"  | Description
 
! width="80" | Default
 
|-
 
| '''type'''
 
| Filename of the original language file to modify, sans extension.
 
| ''required''
 
|-
 
| '''strings'''
 
| List of the new strings to add/replace, listed as ''stringID: text''.
 
| -
 
|}
 
  
Example:
 
- type: English
 
  strings:
 
    STR_SNIPER_RIFLE: Sniper Rifle
 
    STR_SNIPER_RIFLE_CLIP: Sniper Rifle Clip
 
- type: EnglishUk
 
  strings:
 
    STR_SNIPER_RIFLE: Sniper Rifle
 
    STR_SNIPER_RIFLE_CLIP: Sniper Rifle Clip
 
- type: German
 
  strings:
 
    STR_SNIPER_RIFLE: Scharfschützengewehr
 
    STR_SNIPER_RIFLE_CLIP: Scharfschützengewehrmunition
 
- type: Russian
 
  strings:
 
    STR_SNIPER_RIFLE: Снайперская винтовка
 
    STR_SNIPER_RIFLE_CLIP: Магазин к снайп. винтовке
 
 
 
[[Category:OpenXcom]]
 
[[Category:OpenXcom]]

Latest revision as of 22:53, 13 February 2015

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)

Notepad++ Settings for editing OpenXcom YAML files

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. Make sure you use UTF-8 encoding! (this is important for when you add strings and translations)

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. There's also online YAML validators.

  • 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. Open the Data\Ruleset\Xcom1Ruleset.rul file in your YAML editor.
  2. Collapse everything (Alt-0 in Notepad++) and then open (uncollapse) the "facilities:" section.
  3. Open "- type: STR_LIVING_QUARTERS"
  4. change "personnel: 50" to "personnel: 500"
  5. 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 those 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"
  • Finally if you want to be able to equip blasters to your squad and use them you will have to remove the tech requirement. Go back to "items:" and completely remove the section for tech requirements from both blasters and bombs.
Start a new game, load up blasters on your sky-ranger, 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

However, editing the main Xcom1Ruleset.rul is bad practice, as your changes will be wiped by any new versions, and it makes it a pain to keep updating and combining different rulesets. Instead you should make it modular, by making your own ruleset file (saved in data\Ruleset) with only the changes it makes to the base game, for example a BiggerQuarters.rul:

facilities:
  - type: STR_LIVING_QUARTERS
    personnel: 500

Then to load your extra ruleset into the game, you just go in your options.cfg file and add it like so:

rulesets:
  - Xcom1Ruleset
  - BiggerQuarters

Now when you start up the game, it'll automatically combine all the rulesets listed in the options.cfg. Note that the order is important, as subsequent rulesets will modify the contents of previous ones (if the type is the same), so in this case BiggerQuarters will modify the STR_LIVING_QUARTERS of Xcom1Ruleset, which is what you want. Normally you always want Xcom1Ruleset to come first. Note that you can also specify the order of your rulesets when starting your game by selecting the rulesets in the order you would like to have them applied.

If you need to specifically erase a field, for example to clear requirements for something (like making an item or research available from the start of the game), you can use "" for an empty string, [] for an empty list and {} for an empty map. For example:

requires: []

If you want to remove an entire entry from a previous ruleset, you just need to specify "delete: STR_ID", for example:

facilities:
  - delete: STR_LIVING_QUARTERS

But be careful, as this will break any saves already using that item. If you want people to be able to use your new ruleset on existing saves, it's safer to just disable it, like adding a requirement that can not be met. For example, if you want to make the Heavy Plasma unavailable for the player, you can add an otherwise non-existing research topic (for example "STR_ALIENS_ONLY", so it can be easily identified for later modifications...). this would have to be researched in order to use the weapon, but since it isn't defined anywhere else, it effectively disables the weapon for the player:

 - type: STR_HEAVY_PLASMA
   requires:
     - STR_ALIENS_ONLY

See Also