Difference between revisions of "LOC.DAT"
Jump to navigation
Jump to search
(made notes stand out more, added probable bounds on coordinates, and more) |
m (→Structure) |
||
(25 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
− | + | LOC.DAT has a row width of 20 bytes. There are a total of 50 records (not all of them necessarily used) for a fixed file size of 1,000 bytes. Most of this info is from [[User:NKF|NKF]] (thanks a lot) and some was ripped from [http://www.stonepool.com/xcom/hacking/index.html Hatfarm / Chris Voss's great pages]. |
|
− | '''LOC.DAT:''' Each entry is 20 bytes long (most of this info is from NKF, thanks a lot) |
||
+ | ==Structure== |
||
− | '''00:''' Object type: |
||
+ | {| class="wikitable" |
||
− | 00 - Unused entry |
||
+ | |- |
||
− | 01 - Alien Ship |
||
+ | !Offset<br>(Decimal) |
||
− | 02 - X-Com Ship |
||
+ | !Offset<br>(Hex) |
||
− | 03 - X-Com Base |
||
+ | !Usage |
||
+ | |- valign="top" |
||
+ | !<span id="0"></span>0 |
||
+ | !<span id="0x00"></span>0x00 |
||
+ | |Object type: |
||
+ | 00 - Unused Entry |
||
+ | 01 - Alien Ship (moving or crashed) ''[CE: moving or landed]'' |
||
+ | 02 - X-COM Ship |
||
+ | 03 - X-COM Base |
||
04 - Alien Base |
04 - Alien Base |
||
05 - Crash Site |
05 - Crash Site |
||
− | 06 - Landed UFO |
+ | 06 - Landed UFO ''unused'' |
07 - Waypoint |
07 - Waypoint |
||
− | 08 - Terror Site |
+ | 08 - Terror Site ''unused in TFTD, see below:'' |
+ | |||
+ | ''Extras for TFTD only:'' |
||
+ | 0x51 - Port Attack |
||
+ | 0x52 - Island Attack |
||
+ | 0x53 - Passenger/Cargo Ship |
||
+ | 0x54 - Artefact Site |
||
+ | |- valign="top" |
||
+ | !<span id="1"></span>1 |
||
+ | !<span id="0x01"></span>0x01 |
||
+ | |Object table reference - Possible values - 00 to FF - Just a reference. This just shows how many there are of this type on the geoscape. If the object is either a UFO (Alien Ship for TFTD) or X-COM craft, then this is the index into [[CRAFT.DAT]]. If the object is an X-Com base, then this is the index into [[BASE.DAT]] and if it is an [[Alien Base]] this byte contains the race: |
||
+ | '''UFO''' '''TFTD''' |
||
− | '''01:''' Object table reference - Possible values - 00 to FF - Just a reference. This just shows how many there are of this type on the geoscape. (UFOs and X-COM craft are both type ship and will both increment this number.) This is used for determining base number, for use in other files. |
||
+ | 0 = [[Sectoid]] [[Aquatoid]] |
||
− | :''What's the last sentence suppose to mean? The next base number for Alien Bases? I thought that was in [[UIGLOB.DAT]] --[[User:Pi Masta|Pi Masta]]'' |
||
+ | 1 = [[Snakeman]] [[Gillman]] |
||
− | |||
+ | 2 = [[Ethereal]] [[Lobsterman]] |
||
− | '''02-03:''' Horizontal starting coordinates (low bit then high bit respectively). 0 - 2880 |
||
+ | 3 = [[Muton]] [[Tasoth]] |
||
− | |||
+ | 4 = [[Floater]] [[Mixed Crew]] (Type I) |
||
− | '''04-05:''' Vertical starting coordinates (low bit then high bit respectively). -720 - 720 |
||
+ | 5 = Final mission mix [[Mixed Crew]] (Type II) |
||
− | |||
+ | |- valign="top" |
||
− | :'''NOTE''': Ships don't land on the exact place that the alien ship is, that's why there will be discrepancies between the alien and x-com ship destination info. |
||
+ | !<span id="2-3"></span>2-3 |
||
− | |||
+ | !<span id="0x02-0x03"></span>0x02-0x03 |
||
− | '''06-07:''' Horizontal destination coordinates (low bit then high bit respectively). 0 - 2880 |
||
+ | |Horizontal coordinates or longitude (low bit then high bit respectively). 0 - 2880 |
||
− | |||
+ | |- valign="top" |
||
− | '''08-09:''' Vertical destination coordinates (low bit then high bit respectively). -720 - 720 |
||
+ | !<span id="4-5"></span>4-5 |
||
− | |||
+ | !<span id="0x04-0x05"></span>0x04-0x05 |
||
− | :'''NOTE''': The maximum and minimum values for the coordinates is assumed to be the same as [[WORLD.DAT]] (which makes sense). They haven't actually been tested. (''I'm too lazy for that --[[User:Pi Masta|Pi Masta]]'') |
||
+ | |Vertical coordinates or latitude (low bit then high bit respectively). -720 - 720 |
||
− | |||
+ | |- valign="top" |
||
− | '''0A-0B:''' Appears to be the 'count suffix' of the item, eg: Skyranger-'''1''' or Crash Site-'''47'''. It appears to have no meaning for XCOM Bases, but for other types where it is set, the next byte (0B) always seems to be 0, and is probably the high byte but I've never gotten over 255 UFO's or crafts to test this. ''--[[User:Pi Masta|Pi Masta]]'' |
||
+ | !<span id="6-7"></span>6-7 |
||
− | |||
+ | !<span id="0x06-0x07"></span>0x06-0x07 |
||
− | '''0C-0F:''' NEED HELP |
||
+ | |For crash site or terror site - countdown timer (in hours). For moving objects - how many game ticks (5s) have to pass until craft moved to next globe coordinate (''cell_size div speed''). |
||
− | |||
+ | :'''NOTE''': Ground UFOs are treated as ''moving'' objects, except for speed = 0. |
||
− | '''10:''' Something to do with visibility, not really sure however. |
||
+ | |- valign="top" |
||
− | Possible bit field? --[[User:Pi Masta|Pi Masta]] 16:55, 13 March 2007 (PDT) |
||
+ | !<span id="8-9"></span>8-9 |
||
− | bit |
||
+ | !<span id="0x08-0x09"></span>0x08-0x09 |
||
− | 2 (value 4) seen this change on alien crafts when I targeted it for the first time |
||
+ | |Fractional part of how much is left to the next globe coordinate (''cell_size mod speed''), used only for moving objects. |
||
− | 1 (value 2) Alien craft always have this flagged, for Xcom craft 0 - At base or patrolling, 1 - Moving (moving bit field?) |
||
+ | |- valign="top" |
||
− | 0 (value 1) not visible/detected field, 0 - visible, 1 - not visible |
||
+ | !<span id="10-11"></span>10-11 |
||
− | |||
+ | !<span id="0x0A-0x0B"></span>0x0A-0x0B |
||
− | '''11-13:''' NEED HELP |
||
+ | |Count suffix of the item, eg: Skyranger-'''1''' or Crash Site-'''47'''. It appears to have no meaning for XCOM Bases, but for other types where it is set, 0B is the high byte for when you go over 255 UFO's or crafts, etc. |
||
− | |||
+ | |- valign="top" |
||
− | :'''NOTE''': Other files (e.g., [[CRAFT.DAT]]) reference the entry number for the base. For example, if the value is 0A then that base is in entry 10 of this file. |
||
+ | !<span id="12-13"></span>12-13 |
||
+ | !<span id="0x0C-0x0D"></span>0x0C-0x0D |
||
+ | |[UNUSED] |
||
+ | |- valign="top" |
||
+ | !<span id="14"></span>14 |
||
+ | !<span id="0x0E"></span>0x0E |
||
+ | |Craft transfer mode: |
||
+ | 0 = Not transferred |
||
+ | 1 = In transfer |
||
+ | 2 = Selected to transfer (temporary value) |
||
+ | |- valign="top" |
||
+ | !<span id="15"></span>15 |
||
+ | !<span id="0x0F"></span>0x0F |
||
+ | |[UNUSED] |
||
+ | |- valign="top" |
||
+ | !<span id="16-19"></span>16-19 |
||
+ | !<span id="0x10-0x13"></span>0x10-0x13 |
||
+ | |Globe object visiblity/mobility bitfield: |
||
+ | 0 (value 1) Hidden object flag (unrevealed alien bases, xcom crafts at base, |
||
+ | undetected UFOs) |
||
+ | 1 (value 2) Moving object flag (UFOs, flying XCOM crafts except for when |
||
+ | patrolling). |
||
+ | 2 (value 4) Targeted UFO flag (set to 1 when alien craft targeted). |
||
+ | Used for UFO decode menu popup when UFO craft reappears. |
||
+ | |- |
||
+ | |} |
||
==See Also== |
==See Also== |
||
Line 51: | Line 95: | ||
* [[Saved Game Files]] |
* [[Saved Game Files]] |
||
[[Category:Game Files]] |
[[Category:Game Files]] |
||
+ | [[Category:Enemy Unknown/UFO Defense]] |
Latest revision as of 12:52, 21 March 2015
LOC.DAT has a row width of 20 bytes. There are a total of 50 records (not all of them necessarily used) for a fixed file size of 1,000 bytes. Most of this info is from NKF (thanks a lot) and some was ripped from Hatfarm / Chris Voss's great pages.
Structure
Offset (Decimal) |
Offset (Hex) |
Usage |
---|---|---|
0 | 0x00 | Object type:
00 - Unused Entry 01 - Alien Ship (moving or crashed) [CE: moving or landed] 02 - X-COM Ship 03 - X-COM Base 04 - Alien Base 05 - Crash Site 06 - Landed UFO unused 07 - Waypoint 08 - Terror Site unused in TFTD, see below: Extras for TFTD only: 0x51 - Port Attack 0x52 - Island Attack 0x53 - Passenger/Cargo Ship 0x54 - Artefact Site |
1 | 0x01 | Object table reference - Possible values - 00 to FF - Just a reference. This just shows how many there are of this type on the geoscape. If the object is either a UFO (Alien Ship for TFTD) or X-COM craft, then this is the index into CRAFT.DAT. If the object is an X-Com base, then this is the index into BASE.DAT and if it is an Alien Base this byte contains the race:
UFO TFTD 0 = Sectoid Aquatoid 1 = Snakeman Gillman 2 = Ethereal Lobsterman 3 = Muton Tasoth 4 = Floater Mixed Crew (Type I) 5 = Final mission mix Mixed Crew (Type II) |
2-3 | 0x02-0x03 | Horizontal coordinates or longitude (low bit then high bit respectively). 0 - 2880 |
4-5 | 0x04-0x05 | Vertical coordinates or latitude (low bit then high bit respectively). -720 - 720 |
6-7 | 0x06-0x07 | For crash site or terror site - countdown timer (in hours). For moving objects - how many game ticks (5s) have to pass until craft moved to next globe coordinate (cell_size div speed).
|
8-9 | 0x08-0x09 | Fractional part of how much is left to the next globe coordinate (cell_size mod speed), used only for moving objects. |
10-11 | 0x0A-0x0B | Count suffix of the item, eg: Skyranger-1 or Crash Site-47. It appears to have no meaning for XCOM Bases, but for other types where it is set, 0B is the high byte for when you go over 255 UFO's or crafts, etc. |
12-13 | 0x0C-0x0D | [UNUSED] |
14 | 0x0E | Craft transfer mode:
0 = Not transferred 1 = In transfer 2 = Selected to transfer (temporary value) |
15 | 0x0F | [UNUSED] |
16-19 | 0x10-0x13 | Globe object visiblity/mobility bitfield:
0 (value 1) Hidden object flag (unrevealed alien bases, xcom crafts at base, undetected UFOs) 1 (value 2) Moving object flag (UFOs, flying XCOM crafts except for when patrolling). 2 (value 4) Targeted UFO flag (set to 1 when alien craft targeted). Used for UFO decode menu popup when UFO craft reappears. |
See Also
- BASE.DAT - Contains information about Xcom bases
- CRAFT.DAT - Contains information on the crafts
- GEODATA.DAT - Contains information about what crafts and terrain a battle should use
- WORLD.DAT - Defines the zones and terrain on the globe
- Saved Game Files