$MissionContext Events

From Galactineers
Jump to: navigation, search


OnBuildingDamaged()

This event is triggered when a building is under attack and receiving damage.

function OnBuildingDamaged($coordinates, $type) {
  global $MissionContext;

}
Parameters
Parameter Type Description
$coordinates array The x,y,z coordinates of the building
$coordinates string The type of building, e.g. Foundry


OnBuildingKilled()

This event is triggered when a building has been destroyed, after it has been removed from the $MissionContext->EnemiesBuildingList or $MissionContext->AlliedBuildingsList. That way you can evalueate the new state/count of buildings on the map.

function OnBuildingKilled($coordinates, $type) {
  global $MissionContext;

}
Parameters
Parameter Type Description
$coordinates array The x,y,z coordinates of the building
$coordinates string The type of building, e.g. Foundry

OnBuildingKilling()

This event is triggered when a building has been destroyed, before it gets removed from the $MissionContext->EnemiesBuildingList or $MissionContext->AlliedBuildingsList. That way you can check wether a friendly or hostile building has been destroyed.

function OnBuildingKilling($coordinates, $type) {
  global $MissionContext;

}
Parameters
Parameter Type Description
$coordinates array The x,y,z coordinates of the building
$coordinates string The type of building, e.g. Foundry

OnButtonClicked() / OnButtonRightClicked()

These events are triggered when a player clicks on a button, which has been created with the $MissionContext->AddButton command. OnButtonClicked triggers on a left click, OnButtonRightClicked triggers on a right click, if a ship is selected (regular ship interaction)

function OnButtonClicked($buttonId, $playerId) {
  global $MissionContext;

}
function OnButtonRightClicked($buttonId, $playerId, $shipId) {
  global $MissionContext;

}
Parameters
Parameter Type Description
$buttonId string The id of the button which has been clicked
$playerId string The player who clicked the button
$shipId string The id of the ship which was selected when player right-clicked the button

OnMissionInitialize()

This event is triggered during initialization of the mission. It is used to setup mission objectives, timers, counters, and everything else you need during the mission.

function OnMissionInitialize() {
  global $MissionContext;

}

OnMissionStarted()

This event is triggered when all players finished loading the mission. Can be used to e.g. display story-telling messages.

function OnMissionStarted() {
  global $MissionContext;

}


OnMissionUpdateTick()

This event is triggered once every second. It can be used to check for conditions which are not covered by any other event. Should not contain too CPU-intense code.

function OnMissionUpdateTick() {
  global $MissionContext;

}


OnShipDamaged()

This event is when a ship is under attack and receiving damage.

function OnShipDamaged($shipId) {
  global $MissionContext;

}
Parameters
Parameter Type Description
$shipId integer The Id of the ship returned from the AddShip command.


OnShipKilled()

This event is when a ship has been killed, after it has been removed from the $MissionContext->EnemiesShipList resp. $MissionContext->PlayersShipList. That way you can evaluate the new state/count of all ships on the map.

function OnShipKilled($shipId) {
  global $MissionContext;

}
Parameters
Parameter Type Description
$shipId integer The Id of the ship returned from the AddShip command.


OnShipKilling()

This event is when a ship has been killed, before it gets removed from the $MissionContext->EnemiesShipList resp. $MissionContext->PlayersShipList. That way you can check wether a friendly or a hostile ship has been killed.

function OnShipKilling($shipId) {
  global $MissionContext;

}
Parameters
Parameter Type Description
$shipId integer The Id of the ship returned from the AddShip command.


OnTimerExpired()

This event is when a timer has expired.

function OnTimerExpired($timerId) {
  global $MissionContext;

}
Parameters
Parameter Type Description
$timerId string The Id of the timer used during creation of the timer with the SetTimer command.


OnTrigger()

This event is when a trigger has been triggered.

function OnTrigger($triggerId, $shipId) {
  global $MissionContext;

}
Parameters
Parameter Type Description
$triggerId string The Id of the trigger used during creation of the trigger with the SetTrigger command.
$ship string If the trigger involved a ship (e.g. the AddInRegionTrigger or AddOutsideRegionTrigger), the ship Id returned from the AddShip command is passed.