Jump to content

LOC.DAT: Difference between revisions

From UFOpaedia
Volutar (talk | contribs)
mNo edit summary
Structure: Some TFTD object types
Line 2: Line 2:
==Structure==
==Structure==
'''00:''' Object type:
'''00:''' Object type:
     00 - Unused entry
    '''UFO'''                      '''TFTD'''
     01 - Alien Ship
     00 - Unused Entry        00 - ???
     02 - X-Com Ship
     01 - Alien Ship         01 - Landed USO ''(may well be all USOs)''
     03 - X-Com Base
     02 - X-Com Ship         02 - ???
     04 - Alien Base
     03 - X-Com Base         03 - ???
     05 - Crash Site
     04 - Alien Base          04 - Alien Base
     06 - Landed UFO
     05 - Crash Site          05 - Crash Site
     07 - Waypoint
     06 - Landed UFO         06 - ???
     08 - Terror Site
     07 - Waypoint           07 - ???
     08 - Terror Site        08 - ???
                            81 - Port Attack
                            82 - Island Attack
                            83 - Passenger/Cargo Ship
                            84 - Artefact Site


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

Revision as of 07:37, 21 May 2011

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

00: Object type:

   UFO                      TFTD
   00 - Unused Entry        00 - ???
   01 - Alien Ship          01 - Landed USO (may well be all USOs)
   02 - X-Com Ship          02 - ???
   03 - X-Com Base          03 - ???
   04 - Alien Base          04 - Alien Base
   05 - Crash Site          05 - Crash Site
   06 - Landed UFO          06 - ???
   07 - Waypoint            07 - ???
   08 - Terror Site         08 - ???
                            81 - Port Attack
                            82 - Island Attack
                            83 - Passenger/Cargo Ship
                            84 - Artefact Site

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

0 = Sectoid
1 = Snakeman
2 = Ethereal
3 = Muton
4 = Floater

02-03: Horizontal coordinates or longitude (low bit then high bit respectively). 0 - 2880

04-05: Vertical coordinates or latitude (low bit then high bit respectively). -720 - 720

06-07: 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.

08-09: Fractional part of how much is left to the next globe coordinate (cell_size mod speed), used only for moving objects.

0A-0B: 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.

0C-0D: [UNUSED]

0E: Craft transfer mode:

0 = Not transferred
1 = In transfer
2 = Selected to transfer (temporary value)

0F: [UNUSED]

10-13: 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