GameEvents

Constructors

Constructor

Description

GameEvents()

Events

Event

Description

onActorCreated

Invoked when an actor is created during a game.

onActorDied

Invoked when an actor dies.

onActorDiedInfo

Invoked when an actor dies.

onActorSelectedLoadout

Invoked when an actor has selected a loadout.

onActorSpawn

Invoked when an actor spawns.

onCapturePointCaptured

Invoked when a capture point is captured.

onCapturePointNeutralized

Invoked when a capture point is neutralized

onExplosion

Invoked when an explosion goes off.

onExplosionInfo

Invoked when an explosion goes off.

onMatchEnd

Invoked when a match ends.

onOverlayText

Invoked when an overlay text is shown.

onPlayerDealtDamage

Invoked when the player deals damage.

onPlayerRepairedVehicle

Invoked when the player repairs a vehicle.

onProjectileSpawned

Invoked when a projectile is spawned.

onSquadAssignedNewOrder

Invoked when a squad is assigned a new order.

onSquadCreated

Invoked when a squad is created.

onSquadFailedToAssignNewOrder

Invoked when a squad requested a new order, but none were available.

onSquadRequestNewOrder

Invoked when a squad requests a new order.

onTurretActivated

Invoked when a turret is activated.

onVehicleDestroyed

Invoked when a vehicle is destroyed.

onVehicleDisabled

Invoked when a vehicle starts burning.

onVehicleExtinguished

Invoked when a vehicle stops burning.

onVehicleSpawn

Invoked when a vehicle is spawned.

Methods

Method

Description

ToString()

Details

class GameEvents
GameEvents GameEvents()
static const ScriptEvent onActorCreated

Callback Signature:

void callback(Actor)

Invoked when an actor is created during a game. Please note this event is typically not invoked for actors created at the very start of the game, such as the default actors in the game. To access those actors, you can get ActorManager.actors in your Start() function.

static const ScriptEvent onActorDied

Callback Signature:

void callback(Actor actor, Actor killer, bool isSilentKill)

Warning

This property is deprecated. Use onActorDiedInfo instead!

Invoked when an actor dies. Silent kills should typically not count towards team score. Example of silent kill: When the player takes over a bot, the bot actor is silently killed.

static const ScriptEvent onActorDiedInfo

Callback Signature:

void callback(Actor actor, DamageInfo info, bool isSilentKill)

Invoked when an actor dies. Silent kills should typically not count towards team score. Example of silent kill: When the player takes over a bot, the bot actor is silently killed.

static const ScriptEvent onActorSelectedLoadout

Callback Signature:

void callback(Actor, LoadoutSet, LoadoutPickStrategy)

Invoked when an actor has selected a loadout. This function is called just before the actor spawns, allowing you to modify their spawn loadout by changing the loadout object. For the player actor, the loadout strategy is nil.

static const ScriptEvent onActorSpawn

Callback Signature:

void callback(Actor)

Invoked when an actor spawns.

static const ScriptEvent onCapturePointCaptured

Callback Signature:

void callback(CapturePoint capturePoint, Team newOwner)

Invoked when a capture point is captured. IE when it’s owner is set to Team.Blue or Team.Red.

static const ScriptEvent onCapturePointNeutralized

Callback Signature:

void callback(CapturePoint capturePoint, Team previousOwner)

Invoked when a capture point is neutralized IE when it’s owner is set to Team.Neutral.

static const ScriptEvent onExplosion

Callback Signature:

void callback(Vector3 position, float range, Actor source)

Warning

This property is deprecated. Use onExplosionInfo instead!

Invoked when an explosion goes off.

static const ScriptEvent onExplosionInfo

Callback Signature:

void callback(ExplosionInfo info)

Invoked when an explosion goes off.

static const ScriptEvent onMatchEnd

Callback Signature:

void callback(Team)

Note

This event can be consumed by calling CurrentEvent.Consume(). Consuming this event stops the default victory screen from playing and the match ending.

Invoked when a match ends.

static const ScriptEvent onOverlayText

Callback Signature:

void callback(string text, float showDuration)

Invoked when an overlay text is shown. This is a good event to drive custom UI from!

static const ScriptEvent onPlayerDealtDamage

Callback Signature:

void callback(DamageInfo damage, HitInfo hit)

Invoked when the player deals damage. This is a good event to drive UI feedback effects such as hitmarkers from!

static const ScriptEvent onPlayerRepairedVehicle

Callback Signature:

void callback(Vehicle vehicle, float amount)

Invoked when the player repairs a vehicle. This is a good event to drive UI feedback effects such as repair info from!

static const ScriptEvent onProjectileSpawned

Callback Signature:

void callback(Projectile)

Invoked when a projectile is spawned.

static const ScriptEvent onSquadAssignedNewOrder

Callback Signature:

void callback(Squad, Order)

Invoked when a squad is assigned a new order.

static const ScriptEvent onSquadCreated

Callback Signature:

void callback(Squad)

Invoked when a squad is created.

static const ScriptEvent onSquadFailedToAssignNewOrder

Callback Signature:

void callback(Squad)

Invoked when a squad requested a new order, but none were available.

static const ScriptEvent onSquadRequestNewOrder

Callback Signature:

void callback(Squad)

Note

This event can be consumed by calling CurrentEvent.Consume(). Consuming this event stops the squad from automatically being assigned an order.

Invoked when a squad requests a new order.

static const ScriptEvent onTurretActivated

Callback Signature:

void callback(Vehicle turret, TurretSpawner spawner)

Invoked when a turret is activated.

static const ScriptEvent onVehicleDestroyed

Callback Signature:

void callback(Vehicle vehicle, DamageInfo info)

Invoked when a vehicle is destroyed.

static const ScriptEvent onVehicleDisabled

Callback Signature:

void callback(Vehicle vehicle, DamageInfo info)

Invoked when a vehicle starts burning.

static const ScriptEvent onVehicleExtinguished

Callback Signature:

void callback(Vehicle vehicle)

Invoked when a vehicle stops burning.

static const ScriptEvent onVehicleSpawn

Callback Signature:

void callback(Vehicle vehicle, VehicleSpawner spawner)

Invoked when a vehicle is spawned. Note that if the vehicle isn’t spawned by a VehicleSpawner, the spawner value is nil.

string ToString()