Difference between revisions of "UNITPOS.DAT"

From UFOpaedia
Jump to navigation Jump to search
m (added my notes on offset 8)
(Hooray for Seb76)
Line 13: Line 13:
 
<b>3/03</b> - ???
 
<b>3/03</b> - ???
  
<b>4/04</b> - ???
+
<b>4-7/04-07</b> - A four byte value pointing to the memory location of the corresponding [[UNITREF.DAT]] record. Probably somewhat redundant when stored to disk (as it'd need to be re-written as soon as you load the game anyway).
 
 
<b>5/05</b> - ???
 
 
 
<b>6/06</b> - Seems to be the same number for all records, but does vary between saves.
 
 
 
<b>7/07</b> - Always 0?
 
  
 
<b>8/08</b> - ???
 
<b>8/08</b> - ???
  
BB's notes:
+
<i>At the beginning of combat all X-Com controlled units are set to 255, and aliens to 1. When a unit is spotted, or even hits (I believe even with AoE) the units involved will have this counter set to 0. Every turn the unit is ''not'' seen by the other side this counter increments by 1 (and I assume maxes at 255). See the [[Talk:UNITPOS.DAT|discussion page]] for more.
 
 
Always seems to be 255 for X-Com controlled (as opposed to owned) units.
 
 
 
This is NOT race specific, but has something to do with whether a unit has been seen or not. I've observed this value changing to 0 as soon as an alien is spotted by a player controlled unit, even if the alien didn't see the other unit approach.
 
  
[[User:Pi Masta|Pi Masta]] Notes:
+
- [[User:Pi Masta|Pi Masta]]</i>
At the beginning of combat all X-Com controlled units are set to 255, and aliens to 1. When a unit is spotted, or even hits (I believe even with AoE) the units involved will have this counter set to 0. Every turn the unit is ''not'' seen by the other side this counter increments by 1 (and I assume maxes at 255). See the [[Talk:UNITPOS.DAT|discussion page]] for more.
 
  
 
<b>9/09</b> - Owner flag. Possible values:
 
<b>9/09</b> - Owner flag. Possible values:
Line 50: Line 39:
 
Ignore bits 4 and 5 if bit 3 is unflagged.
 
Ignore bits 4 and 5 if bit 3 is unflagged.
  
<b>11/0B</b> - ???
+
<b>11/0B</b> - ??? Unknown, never seen it flag.
  
<b>12/0C</b> - ???
+
<b>12/0C</b> - ??? Unknown, never seen it flag.
  
<b>13/0D</b> - ???
+
<b>13/0D</b> - ??? Unknown, never seen it flag.
  
 
==See Also==
 
==See Also==

Revision as of 04:14, 10 February 2008

Stores positioning information for units in the playing field. Each large unit takes four individual records, small units have one record each.

There are 80 records of 14 values of one byte each. 1120 bytes in total. The same format is used by the files UNIPOS.DAT, and the MissDat version of UNITPOS.DAT.

Structure

0/00 - Y position. 255 if unit specifically unused.

1/01 - X position.

2/02 - Z position. (0 is top level).

3/03 - ???

4-7/04-07 - A four byte value pointing to the memory location of the corresponding UNITREF.DAT record. Probably somewhat redundant when stored to disk (as it'd need to be re-written as soon as you load the game anyway).

8/08 - ???

At the beginning of combat all X-Com controlled units are set to 255, and aliens to 1. When a unit is spotted, or even hits (I believe even with AoE) the units involved will have this counter set to 0. Every turn the unit is not seen by the other side this counter increments by 1 (and I assume maxes at 255). See the discussion page for more.

- Pi Masta

9/09 - Owner flag. Possible values:

  0: X-Com
  1: Alien
  2: Civilian

10/0A - Unit info flags. Bits (from left to right, 87654321):

  (  1) 1: 0 = Invisible, 1 = visible (i.e., unit has been spotted by the enemy).
  (  2) 2: 0 = Dead or unconcious, 1 = active.
  (  4) 3: 0 = Small unit, 1 = big unit.
  (  8) 4: 0 = Left section of unit, 1 = right side of unit.
  ( 16) 5: 0 = Upper side of unit, 1 = lower side of unit.
  ( 32) 6: Only seems to flag for certain tank parts. Could be where tank will fire from?
  ( 64) 7: 0 = Normal, 1 = under mind control.
  (128) 8: Unused?

Ignore bits 4 and 5 if bit 3 is unflagged.

11/0B - ??? Unknown, never seen it flag.

12/0C - ??? Unknown, never seen it flag.

13/0D - ??? Unknown, never seen it flag.

See Also