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
|
Full Usage:
CommandFinished(unitId, commandId, commandTopicId)
Parameters:
int
commandId : int
commandTopicId : int
|
A unit's command finished execution.
|
Full Usage:
EnemyCreated enemyId
Parameters:
int
|
An enemy unit was created (first sighted during construction).
|
Full Usage:
EnemyDamaged(enemyId, attackerId, damage, weaponDefId)
Parameters:
int
attackerId : int option
damage : float32
weaponDefId : int
|
An enemy unit took damage. Includes attacker (if known), damage amount, and weapon def.
|
Full Usage:
EnemyDestroyed(enemyId, attackerId)
Parameters:
int
attackerId : int option
|
An enemy unit was destroyed. Includes the attacker's unit ID if known.
|
Full Usage:
EnemyEnterLOS enemyId
Parameters:
int
|
An enemy unit entered our line of sight.
|
Full Usage:
EnemyEnterRadar enemyId
Parameters:
int
|
An enemy unit entered our radar coverage.
|
Full Usage:
EnemyFinished enemyId
Parameters:
int
|
An enemy unit finished construction.
|
Full Usage:
EnemyLeaveLOS enemyId
Parameters:
int
|
An enemy unit left our line of sight.
|
Full Usage:
EnemyLeaveRadar enemyId
Parameters:
int
|
An enemy unit left our radar coverage.
|
Full Usage:
Init teamId
Parameters:
int
|
AI initialization with the assigned team ID. First event received after handshake.
|
Full Usage:
Load
|
Game load event (save/load system). |
Full Usage:
LuaMessage(data, inMessageId)
Parameters:
string
inMessageId : int
|
A Lua message was received from the game's widget/gadget layer.
|
Full Usage:
Message(player, message)
Parameters:
int
message : string
|
Chat or system message from a player.
|
Full Usage:
PlayerCommand(units, commandTopicId, commandId)
Parameters:
int list
commandTopicId : int
commandId : int
|
A player issued a command to one or more units.
|
Full Usage:
Release
|
AI release signal. The engine is shutting down this AI's participation. |
Full Usage:
Save
|
Game save event (save/load system). |
Full Usage:
SeismicPing(x, y, z, strength)
Parameters:
float32
y : float32
z : float32
strength : float32
|
A seismic ping was detected at the given world position with a given strength.
|
Full Usage:
Shutdown reason
Parameters:
string
|
The game is shutting down. The reason indicates why (GameOver, Disconnect, Error).
|
Full Usage:
UnitCaptured(unitId, oldTeamId, newTeamId)
Parameters:
int
oldTeamId : int
newTeamId : int
|
A friendly unit was captured by another team.
|
Full Usage:
UnitCreated(unitId, builderId)
Parameters:
int
builderId : int
|
A friendly unit has been created (construction started). Includes the builder's unit ID.
|
Full Usage:
UnitDamaged(unitId, attackerId, damage, weaponDefId, isParalyzer)
Parameters:
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.
|
Full Usage:
UnitDestroyed(unitId, attackerId)
Parameters:
int
attackerId : int option
|
A friendly unit was destroyed. Includes the attacker's unit ID if known.
|
Full Usage:
UnitFinished unitId
Parameters:
int
|
A friendly unit has finished construction and is now fully operational.
|
Full Usage:
UnitGiven(unitId, oldTeamId, newTeamId)
Parameters:
int
oldTeamId : int
newTeamId : int
|
A friendly unit was given to another team (e.g., via share).
|
Full Usage:
UnitIdle unitId
Parameters:
int
|
A friendly unit has become idle (completed its command queue).
|
Full Usage:
UnitMoveFailed unitId
Parameters:
int
|
A friendly unit failed to reach its move destination (path blocked or unreachable).
|
Full Usage:
Unknown
|
An unrecognized event type. Indicates a protocol extension or unknown event. |
Full Usage:
Update frame
Parameters:
int
|
Frame update tick. Carries the current simulation frame number.
|
Full Usage:
WeaponFired(unitId, weaponDefId)
Parameters:
int
weaponDefId : int
|
A friendly unit fired a weapon.
|
Instance members
| Instance member |
Description
|
Full Usage:
this.IsCommandFinished
Returns: bool
|
|
Full Usage:
this.IsEnemyCreated
Returns: bool
|
|
Full Usage:
this.IsEnemyDamaged
Returns: bool
|
|
Full Usage:
this.IsEnemyDestroyed
Returns: bool
|
|
Full Usage:
this.IsEnemyEnterLOS
Returns: bool
|
|
Full Usage:
this.IsEnemyEnterRadar
Returns: bool
|
|
Full Usage:
this.IsEnemyFinished
Returns: bool
|
|
Full Usage:
this.IsEnemyLeaveLOS
Returns: bool
|
|
Full Usage:
this.IsEnemyLeaveRadar
Returns: bool
|
|
Full Usage:
this.IsInit
Returns: bool
|
|
Full Usage:
this.IsLoad
Returns: bool
|
|
Full Usage:
this.IsLuaMessage
Returns: bool
|
|
Full Usage:
this.IsMessage
Returns: bool
|
|
Full Usage:
this.IsPlayerCommand
Returns: bool
|
|
Full Usage:
this.IsRelease
Returns: bool
|
|
Full Usage:
this.IsSave
Returns: bool
|
|
Full Usage:
this.IsSeismicPing
Returns: bool
|
|
Full Usage:
this.IsShutdown
Returns: bool
|
|
Full Usage:
this.IsUnitCaptured
Returns: bool
|
|
Full Usage:
this.IsUnitCreated
Returns: bool
|
|
Full Usage:
this.IsUnitDamaged
Returns: bool
|
|
Full Usage:
this.IsUnitDestroyed
Returns: bool
|
|
Full Usage:
this.IsUnitFinished
Returns: bool
|
|
Full Usage:
this.IsUnitGiven
Returns: bool
|
|
Full Usage:
this.IsUnitIdle
Returns: bool
|
|
Full Usage:
this.IsUnitMoveFailed
Returns: bool
|
|
Full Usage:
this.IsUnknown
Returns: bool
|
|
Full Usage:
this.IsUpdate
Returns: bool
|
|
Full Usage:
this.IsWeaponFired
Returns: bool
|
|
FSBarV1_Archived