GameEvents¶
Constructors¶
Constructor |
Description |
---|---|
Events¶
Event |
Description |
---|---|
Invoked when an actor is created during a game. |
|
Invoked when an actor dies. |
|
Invoked when an actor dies. |
|
Invoked when an actor has selected a loadout. |
|
Invoked when an actor spawns. |
|
Invoked when a capture point is captured. |
|
Invoked when a capture point is neutralized |
|
Invoked when an explosion goes off. |
|
Invoked when an explosion goes off. |
|
Invoked when a match ends. |
|
Invoked when an overlay text is shown. |
|
Invoked when the player deals damage. |
|
Invoked when the player repairs a vehicle. |
|
Invoked when a projectile is spawned. |
|
Invoked when a squad is assigned a new order. |
|
Invoked when a squad is created. |
|
Invoked when a squad requested a new order, but none were available. |
|
Invoked when a squad requests a new order. |
|
Invoked when a turret is activated. |
|
Invoked when a vehicle is destroyed. |
|
Invoked when a vehicle starts burning. |
|
Invoked when a vehicle stops burning. |
|
Invoked when a vehicle is spawned. |
Methods¶
Method |
Description |
---|---|
Details¶
-
class
GameEvents
¶ -
GameEvents
GameEvents
()¶
-
static const ScriptEvent
onActorCreated
¶ Callback Signature:
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 yourStart()
function.
-
static const ScriptEvent
onActorDied
¶ Callback Signature:
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.
-
void
-
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.
-
void
-
static const ScriptEvent
onActorSpawn
¶ Callback Signature:
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.
-
void
-
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.
-
void
-
static const ScriptEvent
onExplosion
¶ Callback Signature:
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.
-
void
-
static const ScriptEvent
onMatchEnd
¶ Callback Signature:
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!
-
void
-
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!
-
void
-
static const ScriptEvent
onPlayerRepairedVehicle
¶ Callback Signature:
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.
-
void
-
static const ScriptEvent
onSquadAssignedNewOrder
¶ Callback Signature:
Invoked when a squad is assigned a new order.
-
static const ScriptEvent
onSquadCreated
¶ Callback Signature:
Invoked when a squad is created.
-
static const ScriptEvent
onSquadFailedToAssignNewOrder
¶ Callback Signature:
Invoked when a squad requested a new order, but none were available.
-
static const ScriptEvent
onSquadRequestNewOrder
¶ Callback Signature:
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.
-
void
-
static const ScriptEvent
onVehicleDestroyed
¶ Callback Signature:
-
void
callback
(Vehicle vehicle, DamageInfo info)¶
Invoked when a vehicle is destroyed.
-
void
-
static const ScriptEvent
onVehicleDisabled
¶ Callback Signature:
-
void
callback
(Vehicle vehicle, DamageInfo info)¶
Invoked when a vehicle starts burning.
-
void
-
static const ScriptEvent
onVehicleExtinguished
¶ Callback Signature:
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.
-
void
-
string
ToString
()¶
-
GameEvents