Bit mask (T files)
From X-Wiki
In T files bit masks are used to hold information about lasers (and missiles in X3) which can be fitted on certain ship.
Contents |
Priciple
See Mask (computing) for general information how masks work.
Bit mask is represented as integer having 32 bits. Every bit represents one entry in T file (TMissiles or TLaser).
Example
Following laser mask allows a ship to mount 3 lasers:
- Alpha Impulse Ray Emmitter
- Alpha High Energy Plasma Thrower
- Alpha Flak Artillery Array
Mask: 145
145 decadic is 10010001 in binary.
In the bit mask the following bits are set to 1:
- 0 - 1st laser from TLaser (Alpha Impulse Ray Emmitter)
- 4 - 5th laser from TLaser (Alpha High Energy Plasma Thrower)
- 7 - 8th laser from TLaser (Alpha Flak Artillery Array)
- Note: Bit indexes are always counted from zero. Example is based on TLaser file from 04.cat
Laser mask
Laser mask is used in TShips (X2/X3) to specify weapons (lasers) which can be equipped on certain ship.
Missile mask
In X3, missile mask is used in TShips to specify missiles which can be equipped on certain ship.

