api.data
DataApi
The game's own tables, as the editor decoded them: units.dat and its neighbours.
names gives the labels, this gives the numbers — hit points, costs, build times,
weapons, flags, the sprite and image each unit draws through.
Everything is null until the tables are loaded (load), and stays null when the game
data was never extracted.
Members
ready
ready(): boolean;
load
load(): Promise<boolean>;
weapons
weapons(): WeaponsDat | null;
upgrades
upgrades(): UpgradesDat | null;
techs
techs(): TechdataDat | null;
sprites
sprites(): SpritesDat | null;
imagePath
imagePath(imageId: number): string | null;
The GRP path an image id draws from, relative to unit\.
Types
Declarations only this group names.
UnitsDatinterface
interface UnitsDat
flingy: Uint8Array | flingy.dat index. |
|---|---|
subunit: Uint16Array | First subunit (turret), or NO_UNIT. |
direction: Uint8Array | Starting facing 0–31 (0 = up, 8 = right, 16 = down), or RANDOM_DIRECTION. |
shieldEnable: Uint8Array | |
shieldAmount: Uint16Array | |
hitPoints: Uint32Array | Fixed point: hit points × 256. |
elevation: Uint8Array | |
flags: Uint32Array | UnitFlag bits. |
placementWidth: Uint16Array | StarEdit placement box, pixels. Buildings are placed on the tile grid by this box. |
placementHeight: Uint16Array | |
extentLeft: Uint16Array | Collision extents from the unit's centre, pixels. |
extentUp: Uint16Array | |
extentRight: Uint16Array | |
extentDown: Uint16Array | |
mineralCost: Uint16Array | |
vespeneCost: Uint16Array | |
buildTime: Uint16Array | Game frames. |
armor: Uint8Array | |
groundWeapon: Uint8Array | weapons.dat ids, or NO_WEAPON. |
airWeapon: Uint8Array | |
groupFlags: Uint8Array | Bit 0 Zerg, 1 Terran, 2 Protoss, 3 men, 4 building, 5 factory, 6 independent, 7 neutral. |
availability: Uint16Array | StarEdit availability flags; all zero for the legacy layout. |
ImagesDatinterface
interface ImagesDat
grp: Uint32Array | 1-based images.tbl index of the GRP path, relative to |
|---|---|
graphicTurns: Uint8Array | 1 when the GRP holds 17 frames per facing set (directions 0–16, the rest mirrored). |
drawFunction: Uint8Array | |
remapping: Uint8Array | |
iscript: Uint32Array | iscript.bin id of the image's animation script. |
lo: Uint32Array[] | 1-based images.tbl indices of the overlay position files (0 = none), in LO_KINDS order. |
WeaponsDatinterface
interface WeaponsDat
damage: Uint16Array | |
|---|---|
bonus: Uint16Array | Added per upgrade level. |
UpgradesDatinterface
interface UpgradesDat
The columns Upgrade Settings shows as defaults: base cost and per-level factor for minerals, gas and time, plus the level cap.
mineralCost: Uint16Array | |
|---|---|
mineralFactor: Uint16Array | |
vespeneCost: Uint16Array | |
vespeneFactor: Uint16Array | |
timeCost: Uint16Array | Game frames. |
timeFactor: Uint16Array | |
maxRepeats: Uint8Array | Highest level the upgrade goes to (3 for armour / weapons, 1 for the rest). |
broodWar: Uint8Array | 1 for upgrades only Brood War has. |
TechdataDatinterface
interface TechdataDat
The columns Technology Settings shows as defaults.
mineralCost: Uint16Array | |
|---|---|
vespeneCost: Uint16Array | |
researchTime: Uint16Array | Game frames. |
energyCost: Uint16Array | |
broodWar: Uint8Array | 1 for abilities only Brood War has. |