$MissionContext Commands

From Galactineers
Revision as of 18:54, 15 March 2016 by LInsoDeTeh (talk | contribs)
Jump to navigationJump to search

AddInRegionTrigger()

This command adds a trigger for when a ship is inside a certain region. The function call like this:

$MissionContext->AddInRegionTrigger($triggerId, $regionId, $shipId)
Parameters
Parameter Type Description
$triggerId string The Id which is passed in the OnTrigger event handler and can be used in the RemoveTrigger command.
$regionId string The Id of a region that has been defined with the SetRegion command before.
$shipId integer The Id of a ship

Example

$MissionContext->SetRegion('myCircle', array(10, 12), 7);
$MissionContext->AddInRegionTrigger('myTrigger', 'myCircle', 17);

AddOutsideRegionTrigger()

This command adds a trigger for when a ship is not inside a certain region. The function signature and parameters are identical to the AddInRegionTrigger command.


AddShip()

This command adds a new ship to the map. The function call looks like this:

$shipId = $MissionContext->AddShip($definitionId, $coordinates, $rotation, $owner)
Parameters
Parameter Type Description
$definitionId string The Id of the <ShipDefinition> from the shipdefinitions.xml.
$coordinates array The x and z coordinates where to spawn the ship.
$rotation integer The rotation (in degrees) of the ship.
$owner string The PlayerId of the ship owner. 'X' for enemies, 'Y' for allies, the playerId from the $MissionContext->PlayerList property for a player.
Return Value
Type Description
int The Id of the ship on the map for use in MoveShip command or OnShipKilled trigger for example.

Examples

$shipId = $MissionContext->AddShip('PirateProbe', array(10, 12), 0, 'X');
$playerId = $MissionContext->PlayersList[0];
$shipId2 = $MissionContext->AddShip('Rosinante', array(6, -7), 45, $playerId);

MoveShip()

This command moves an existing ship to the target coordinates.

| class="wikitable" |+ Parameters |- ! Parameter ! Type ! Description |- | $shipId || integer || The Id of the ship received from the AddShip command or from the $MissionContext->PlayerShipList or $MissionContext->EnemyShipList properties. |- | $coordinates || array || The x and z coordinates where to move the ship. |}

Example

$rosinante = $MissionContext->AddShip('Rosinante', array(6, -7), 45, '4711');  
$MissionContext->MoveShip($rosinante);

RemoveCounter()

Removes an existing counter, and prevents its expiration. | class="wikitable" |+ Parameters |- ! Parameter ! Type ! Description |- | $counterId || string || The Id of the counter used when creating the counter with the SetCounter command. |}