Logo FSBarV1_Archived

GameEvent Type

Discriminated union representing all game events that the BAR engine can emit during an AI session. Each case corresponds to a protobuf event from the HighBar V2 proxy.

Union cases

Union case Description

CommandFinished(unitId, commandId, commandTopicId)

Full Usage: CommandFinished(unitId, commandId, commandTopicId)

Parameters:
    unitId : int
    commandId : int
    commandTopicId : int

A unit's command finished execution.

unitId : int
commandId : int
commandTopicId : int

EnemyCreated enemyId

Full Usage: EnemyCreated enemyId

Parameters:
    enemyId : int

An enemy unit was created (first sighted during construction).

enemyId : int

EnemyDamaged(enemyId, attackerId, damage, weaponDefId)

Full Usage: EnemyDamaged(enemyId, attackerId, damage, weaponDefId)

Parameters:
    enemyId : int
    attackerId : int option
    damage : float32
    weaponDefId : int

An enemy unit took damage. Includes attacker (if known), damage amount, and weapon def.

enemyId : int
attackerId : int option
damage : float32
weaponDefId : int

EnemyDestroyed(enemyId, attackerId)

Full Usage: EnemyDestroyed(enemyId, attackerId)

Parameters:
    enemyId : int
    attackerId : int option

An enemy unit was destroyed. Includes the attacker's unit ID if known.

enemyId : int
attackerId : int option

EnemyEnterLOS enemyId

Full Usage: EnemyEnterLOS enemyId

Parameters:
    enemyId : int

An enemy unit entered our line of sight.

enemyId : int

EnemyEnterRadar enemyId

Full Usage: EnemyEnterRadar enemyId

Parameters:
    enemyId : int

An enemy unit entered our radar coverage.

enemyId : int

EnemyFinished enemyId

Full Usage: EnemyFinished enemyId

Parameters:
    enemyId : int

An enemy unit finished construction.

enemyId : int

EnemyLeaveLOS enemyId

Full Usage: EnemyLeaveLOS enemyId

Parameters:
    enemyId : int

An enemy unit left our line of sight.

enemyId : int

EnemyLeaveRadar enemyId

Full Usage: EnemyLeaveRadar enemyId

Parameters:
    enemyId : int

An enemy unit left our radar coverage.

enemyId : int

Init teamId

Full Usage: Init teamId

Parameters:
    teamId : int

AI initialization with the assigned team ID. First event received after handshake.

teamId : int

Load

Full Usage: Load

Game load event (save/load system).

LuaMessage(data, inMessageId)

Full Usage: LuaMessage(data, inMessageId)

Parameters:
    data : string
    inMessageId : int

A Lua message was received from the game's widget/gadget layer.

data : string
inMessageId : int

Message(player, message)

Full Usage: Message(player, message)

Parameters:
    player : int
    message : string

Chat or system message from a player.

player : int
message : string

PlayerCommand(units, commandTopicId, commandId)

Full Usage: PlayerCommand(units, commandTopicId, commandId)

Parameters:
    units : int list
    commandTopicId : int
    commandId : int

A player issued a command to one or more units.

units : int list
commandTopicId : int
commandId : int

Release

Full Usage: Release

AI release signal. The engine is shutting down this AI's participation.

Save

Full Usage: Save

Game save event (save/load system).

SeismicPing(x, y, z, strength)

Full Usage: SeismicPing(x, y, z, strength)

Parameters:
    x : float32
    y : float32
    z : float32
    strength : float32

A seismic ping was detected at the given world position with a given strength.

x : float32
y : float32
z : float32
strength : float32

Shutdown reason

Full Usage: Shutdown reason

Parameters:
    reason : string

The game is shutting down. The reason indicates why (GameOver, Disconnect, Error).

reason : string

UnitCaptured(unitId, oldTeamId, newTeamId)

Full Usage: UnitCaptured(unitId, oldTeamId, newTeamId)

Parameters:
    unitId : int
    oldTeamId : int
    newTeamId : int

A friendly unit was captured by another team.

unitId : int
oldTeamId : int
newTeamId : int

UnitCreated(unitId, builderId)

Full Usage: UnitCreated(unitId, builderId)

Parameters:
    unitId : int
    builderId : int

A friendly unit has been created (construction started). Includes the builder's unit ID.

unitId : int
builderId : int

UnitDamaged(unitId, attackerId, damage, weaponDefId, isParalyzer)

Full Usage: UnitDamaged(unitId, attackerId, damage, weaponDefId, isParalyzer)

Parameters:
    unitId : int
    attackerId : int option
    damage : float32
    weaponDefId : int
    isParalyzer : bool

A friendly unit took damage. Includes attacker (if known), damage amount, weapon def, and paralyzer flag.

unitId : int
attackerId : int option
damage : float32
weaponDefId : int
isParalyzer : bool

UnitDestroyed(unitId, attackerId)

Full Usage: UnitDestroyed(unitId, attackerId)

Parameters:
    unitId : int
    attackerId : int option

A friendly unit was destroyed. Includes the attacker's unit ID if known.

unitId : int
attackerId : int option

UnitFinished unitId

Full Usage: UnitFinished unitId

Parameters:
    unitId : int

A friendly unit has finished construction and is now fully operational.

unitId : int

UnitGiven(unitId, oldTeamId, newTeamId)

Full Usage: UnitGiven(unitId, oldTeamId, newTeamId)

Parameters:
    unitId : int
    oldTeamId : int
    newTeamId : int

A friendly unit was given to another team (e.g., via share).

unitId : int
oldTeamId : int
newTeamId : int

UnitIdle unitId

Full Usage: UnitIdle unitId

Parameters:
    unitId : int

A friendly unit has become idle (completed its command queue).

unitId : int

UnitMoveFailed unitId

Full Usage: UnitMoveFailed unitId

Parameters:
    unitId : int

A friendly unit failed to reach its move destination (path blocked or unreachable).

unitId : int

Unknown

Full Usage: Unknown

An unrecognized event type. Indicates a protocol extension or unknown event.

Update frame

Full Usage: Update frame

Parameters:
    frame : int

Frame update tick. Carries the current simulation frame number.

frame : int

WeaponFired(unitId, weaponDefId)

Full Usage: WeaponFired(unitId, weaponDefId)

Parameters:
    unitId : int
    weaponDefId : int

A friendly unit fired a weapon.

unitId : int
weaponDefId : int

Instance members

Instance member Description

this.IsCommandFinished

Full Usage: this.IsCommandFinished

Returns: bool
Returns: bool

this.IsEnemyCreated

Full Usage: this.IsEnemyCreated

Returns: bool
Returns: bool

this.IsEnemyDamaged

Full Usage: this.IsEnemyDamaged

Returns: bool
Returns: bool

this.IsEnemyDestroyed

Full Usage: this.IsEnemyDestroyed

Returns: bool
Returns: bool

this.IsEnemyEnterLOS

Full Usage: this.IsEnemyEnterLOS

Returns: bool
Returns: bool

this.IsEnemyEnterRadar

Full Usage: this.IsEnemyEnterRadar

Returns: bool
Returns: bool

this.IsEnemyFinished

Full Usage: this.IsEnemyFinished

Returns: bool
Returns: bool

this.IsEnemyLeaveLOS

Full Usage: this.IsEnemyLeaveLOS

Returns: bool
Returns: bool

this.IsEnemyLeaveRadar

Full Usage: this.IsEnemyLeaveRadar

Returns: bool
Returns: bool

this.IsInit

Full Usage: this.IsInit

Returns: bool
Returns: bool

this.IsLoad

Full Usage: this.IsLoad

Returns: bool
Returns: bool

this.IsLuaMessage

Full Usage: this.IsLuaMessage

Returns: bool
Returns: bool

this.IsMessage

Full Usage: this.IsMessage

Returns: bool
Returns: bool

this.IsPlayerCommand

Full Usage: this.IsPlayerCommand

Returns: bool
Returns: bool

this.IsRelease

Full Usage: this.IsRelease

Returns: bool
Returns: bool

this.IsSave

Full Usage: this.IsSave

Returns: bool
Returns: bool

this.IsSeismicPing

Full Usage: this.IsSeismicPing

Returns: bool
Returns: bool

this.IsShutdown

Full Usage: this.IsShutdown

Returns: bool
Returns: bool

this.IsUnitCaptured

Full Usage: this.IsUnitCaptured

Returns: bool
Returns: bool

this.IsUnitCreated

Full Usage: this.IsUnitCreated

Returns: bool
Returns: bool

this.IsUnitDamaged

Full Usage: this.IsUnitDamaged

Returns: bool
Returns: bool

this.IsUnitDestroyed

Full Usage: this.IsUnitDestroyed

Returns: bool
Returns: bool

this.IsUnitFinished

Full Usage: this.IsUnitFinished

Returns: bool
Returns: bool

this.IsUnitGiven

Full Usage: this.IsUnitGiven

Returns: bool
Returns: bool

this.IsUnitIdle

Full Usage: this.IsUnitIdle

Returns: bool
Returns: bool

this.IsUnitMoveFailed

Full Usage: this.IsUnitMoveFailed

Returns: bool
Returns: bool

this.IsUnknown

Full Usage: this.IsUnknown

Returns: bool
Returns: bool

this.IsUpdate

Full Usage: this.IsUpdate

Returns: bool
Returns: bool

this.IsWeaponFired

Full Usage: this.IsWeaponFired

Returns: bool
Returns: bool

Type something to start searching.