Difference between revisions of "OBPOS.DAT"

From UFOpaedia
Jump to navigation Jump to search
m (→‎See Also: Category)
Line 1: Line 1:
[[User:NKF|NKF]]: Minor correction, that's for geodata\obdata.dat - i.e. object information. Obpos is battlescape object information. Just to toss my notes on obpos in here for temporary reference. Remove as necessary after incorporating it into the apropriate format:
+
This file is used by save games to record the location of items mid-battle.
  
[[User:Bomb Bloke|BB]]: Oops, my bad. My only notes at this time are what you gave me. I've chopped the obdata.dat notes out.
+
16 single byte values per record, with 170 records in the file.
  
<pre>
+
This format is also used by [[OBPOS2.DAT]] and [[OBPOSREF.DAT]].
16 bytes per entry, 170 possible entries
 
  
Byte:
+
== Structure ==
0: Object type
 
  Object is the item ID# in geodata\obdata.dat
 
  Value of 255/-1 = item in this slot is meant to be unused or destroyed.
 
  
1: Y  \
+
<b>0/00</b>: Object type (Object is the item ID# in geodata\obdata.dat). Value of 255/-1 = item in this slot is meant to be unused or destroyed.
2: X  -> Object coordinates when on the ground.  
 
3: Z  /
 
      These values are meant to tell the game where the items physically are.
 
      They determine where an unconcious unit will wake up.
 
      They tell the game where to centre an explosion for area effect items.
 
  
      Oddly enough, these values ARE NOT UPDATED when in inventory.
+
<b>1/01</b>: Y coordinate when on the ground.  
      All items that start in your inventory default to the equipment pile.  
 
  
4: Owner of item
+
<b>2/02</b>: X coordinate when on the ground.  
  References the units in unitpos. First unit unit index is 0, naturally.
 
  Just tells the game who's holding the current item.
 
  If 255 = object will be on the ground.
 
  
5: Inventory slot (from left to right)
+
<b>3/03</b>: Z coordinate when on the ground.
 +
 
 +
The three above values are meant to tell the game where the items physically are. They determine where an unconcious unit will wake up. They tell the game where to centre an explosion for area effect items. 
 +
 
 +
Oddly enough, these values ARE NOT UPDATED when in inventory. All items that start in your inventory default to the equipment pile. All items that start in the alien inventories are at location (0,0,0).
 +
 
 +
<b>4/04</b>: Owner of item. References the units in unitpos. First unit unit index is 0, naturally. Just tells the game who's holding the current item. If 255 = object will be on the ground.
 +
 
 +
<b>5/05</b>: Inventory slot (from left to right):
 
     0 = Right hand (it's right in the battlescape, but not in the inventory)
 
     0 = Right hand (it's right in the battlescape, but not in the inventory)
 
     1 = Left hand
 
     1 = Left hand
Line 34: Line 29:
 
     19 - 22 = top row of belt
 
     19 - 22 = top row of belt
 
     23 - 24 = side pockets of belt
 
     23 - 24 = side pockets of belt
    WARNING: If adding an item to the hand slots, remember to update the hand
+
WARNING: If adding an item to the hand slots, remember to update the hand slot images in UNITREF for the soldier involved.  
    slot images in UNITREF for the soldier involved.  
 
6: -1/255 by default
 
  
7: Object the current item is loaded into
+
<b>6/06</b>: -1/255 by default.
  Uses obpos item index - first object in obpos is 0
 
  -1/255 by default for no item.  
 
  
8: Item quantity 1 (Actually a multiple use value)  
+
<b>7/07</b>: Object the current item is loaded into. -1/255 by default for no item. (Uses obpos item index - first object in obpos is 0).
  For ammo: Ammo quantity
 
  For Medikits:  - painkiller
 
  For Grenade 'turn to detonate on' trigger
 
  
  0 = grenade object has not been primed.
+
<b>8/08</b>: Item Quantity 1:
  
  Non zero positive value = What turn to explode on.
+
For ammo: Ammo quantity.
  Grenade will explode if current 'turn' is equal or
 
  greater than this number. See wglob.dat for No. of turns.
 
  
  When priming grenades this is set to the current turn
+
For Medikits: Painkillers remaining.
  number +1 for every additional turn added onto the timer.  
 
  
  Refer to wglob for current number of turns. (Uses actual turns, not turns/2)  
+
For Grenade: 'Turn to detonate on' trigger (0 = grenade object has not been primed).
  
9 : Item Quantity 2
+
Non zero positive value = What turn to explode on. Grenade will explode if current 'turn' is equal or greater than this number. See wglob.dat for No. of turns.
    For Medikits: stimulants
 
    For Grenades: Ownership flag (unitpos reference)
 
  
      For remembering who last threw the live grenade. For morale loss
+
When priming grenades this is set to the current turn number +1 for every additional turn added onto the timer. Refer to wglob for current number of turns. (Uses actual turns, not turns/2)
      calculations and for determining the soldier's combat experience.  
 
      Refers to unit 0 by default. Refers to unit in unitpos.  
 
  
 +
<b>9/09</b>: Item Quantity 2:
  
 +
For Medikits: Stimulants remaining.
 +
 +
For Grenades: Ownership flag (unitpos reference). For remembering who last threw the live grenade. For morale loss calculations and for determining the soldier's combat experience. Refers to unit 0 by default. Refers to unit in unitpos.
 
        
 
        
10: Item Quantity 3
+
<b>10/0A</b>: Item Quantity 3:
    For Medikits: Heal
+
 
    No other use documented.
+
Medikit's Heal uses remaining.
11:
+
 
12:
+
<b>11/0B</b>: ???
13:
+
 
14:
+
<b>12/0C</b>: ???
15:
+
 
</pre>
+
<b>13/0D</b>: ???
 +
 
 +
<b>14/0E</b>: ???
 +
 
 +
<b>15/0F</b>: ???
 +
 
  
 
==See Also==
 
==See Also==
 
* [[Saved Game Files]]
 
* [[Saved Game Files]]
 
* [[Saved_Game_Files#Battlescape_Files|Battlescape Files]]
 
* [[Saved_Game_Files#Battlescape_Files|Battlescape Files]]

Revision as of 12:55, 16 June 2006

This file is used by save games to record the location of items mid-battle.

16 single byte values per record, with 170 records in the file.

This format is also used by OBPOS2.DAT and OBPOSREF.DAT.

Structure

0/00: Object type (Object is the item ID# in geodata\obdata.dat). Value of 255/-1 = item in this slot is meant to be unused or destroyed.

1/01: Y coordinate when on the ground.

2/02: X coordinate when on the ground.

3/03: Z coordinate when on the ground.

The three above values are meant to tell the game where the items physically are. They determine where an unconcious unit will wake up. They tell the game where to centre an explosion for area effect items.

Oddly enough, these values ARE NOT UPDATED when in inventory. All items that start in your inventory default to the equipment pile. All items that start in the alien inventories are at location (0,0,0).

4/04: Owner of item. References the units in unitpos. First unit unit index is 0, naturally. Just tells the game who's holding the current item. If 255 = object will be on the ground.

5/05: Inventory slot (from left to right):

   0 = Right hand (it's right in the battlescape, but not in the inventory)
   1 = Left hand
   2 - 5 = Leg slots 
   6 - 9 = Shoulder slots
   10 - 18 = backpack
   19 - 22 = top row of belt
   23 - 24 = side pockets of belt

WARNING: If adding an item to the hand slots, remember to update the hand slot images in UNITREF for the soldier involved.

6/06: -1/255 by default.

7/07: Object the current item is loaded into. -1/255 by default for no item. (Uses obpos item index - first object in obpos is 0).

8/08: Item Quantity 1:

For ammo: Ammo quantity.

For Medikits: Painkillers remaining.

For Grenade: 'Turn to detonate on' trigger (0 = grenade object has not been primed).

Non zero positive value = What turn to explode on. Grenade will explode if current 'turn' is equal or greater than this number. See wglob.dat for No. of turns.

When priming grenades this is set to the current turn number +1 for every additional turn added onto the timer. Refer to wglob for current number of turns. (Uses actual turns, not turns/2)

9/09: Item Quantity 2:

For Medikits: Stimulants remaining.

For Grenades: Ownership flag (unitpos reference). For remembering who last threw the live grenade. For morale loss calculations and for determining the soldier's combat experience. Refers to unit 0 by default. Refers to unit in unitpos.

10/0A: Item Quantity 3:

Medikit's Heal uses remaining.

11/0B: ???

12/0C: ???

13/0D: ???

14/0E: ???

15/0F: ???


See Also