scmJS docs

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>;

units

units(): UnitsDat | null;

weapons

weapons(): WeaponsDat | null;

upgrades

upgrades(): UpgradesDat | null;

techs

techs(): TechdataDat | null;

sprites

sprites(): SpritesDat | null;

flingy

flingy(): FlingyDat | null;

images

images(): ImagesDat | null;

race

race(unitId: number): Race;

Which race a unit type belongs to, from its flags.

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.

readySound: Uint16Array

The unit's voice, as sfxdata.dat ids (0 for none): the one it says when trained, and first–last ranges for a click, repeated clicks and an order. Only the first VOICED_UNITS have ready / annoyed / yes sounds; every unit has a "what".

whatSoundStart: Uint16Array
whatSoundEnd: Uint16Array
annoyedSoundStart: Uint16Array
annoyedSoundEnd: Uint16Array
yesSoundStart: Uint16Array
yesSoundEnd: Uint16Array

FlingyDatinterface

interface FlingyDat
sprite: Uint16Array

sprites.dat index.

SpritesDatinterface

interface SpritesDat
image: Uint16Array

images.dat index.

ImagesDatinterface

interface ImagesDat
grp: Uint32Array

1-based images.tbl index of the GRP path, relative to unit\.

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
label: Uint16Array

The weapon's name: a 1-based stat_txt.tbl index, 0 for none.

damage: Uint16Array
bonus: Uint16Array

Added per upgrade level.

Racetype

type Race = "zerg" | "terran" | "protoss" | null;

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.

label: Uint16Array

The upgrade's name: a 1-based stat_txt.tbl index, 0 for none.

icon: Uint16Array

Its button picture: a frame of unit\cmdbtns\cmdicons.grp.

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.

label: Uint16Array

The technology's name: a 1-based stat_txt.tbl index, 0 for none.

icon: Uint16Array

Its button picture: a frame of unit\cmdbtns\cmdicons.grp.

scmJS 0.7.3 + main@e2d8ba5 · Generated from the repository. The source is under the MIT license, which does not cover what ATTRIBUTION.md lists. StarCraft and Brood War are trademarks of Blizzard Entertainment; this project ships none of their data.