Difference between revisions of "Modding:PVEMissions:mission.php:MissionContextCommands"
LInsoDeTeh (talk | contribs) |
LInsoDeTeh (talk | contribs) |
||
(64 intermediate revisions by the same user not shown) | |||
Line 25: | Line 25: | ||
</source> | </source> | ||
+ | |||
+ | ==AddButton()== | ||
+ | This command adds a custom button at a given location (e.g. a building), which can be used for quests, story, or objectives. | ||
+ | <source lang="php"> | ||
+ | $MissionContext->AddButton($buttonId, $coordinates, $buttonType) | ||
+ | </source> | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+ Parameters | ||
+ | |- | ||
+ | ! Parameter | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | $buttonId|| string || The id of the button, which can be used to enable/disable the button with the '''$MissionContext->EnableButtonForPlayer''' command, and which is handed to the '''OnButtonClicked''' event. | ||
+ | |- | ||
+ | | $coordinates || array|| An array with the x, y, z coordinates of the location where to spawn the button. | ||
+ | |- | ||
+ | | $buttonType|| string || Defines the icon of the button. Possible values are: ''ship, arrowleft, arrowright, refresh, build, delete, jump, money, edit, sticky, arena, statistics, follow, hold, energy, chat, level, cargo'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | '''Example:''' | ||
+ | <source lang="php"> | ||
+ | $MissionContext->AddButton('myButtonId', array(10, 3, 12), 'hold'); | ||
+ | $MissionContext->AddButton($someButtonId, array(10, 3, 12), 'money'); | ||
+ | </source> | ||
==AddInRegionTrigger()== | ==AddInRegionTrigger()== | ||
Line 43: | Line 70: | ||
| $regionId || string || The Id of a region that has been defined with the ''SetRegion'' command before. | | $regionId || string || The Id of a region that has been defined with the ''SetRegion'' command before. | ||
|- | |- | ||
− | | $shipId || integer || The Id of a ship | + | | $shipId || integer || The Id of a ship. 0 if this trigger should accept any ship. |
|} | |} | ||
Line 50: | Line 77: | ||
$MissionContext->SetRegion('myCircle', array(10, 12), 7); | $MissionContext->SetRegion('myCircle', array(10, 12), 7); | ||
$MissionContext->AddInRegionTrigger('myTrigger', 'myCircle', 17); | $MissionContext->AddInRegionTrigger('myTrigger', 'myCircle', 17); | ||
+ | </source> | ||
+ | |||
+ | ==AddItem()== | ||
+ | Adds an item from the [[Modding:IDLists:BuildableItems|Buildable Items List]] to the map. | ||
+ | <source lang="php"> | ||
+ | $MissionContext->AddItem($itemId, $coordinates, $rotation) | ||
+ | </source> | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+ Parameters | ||
+ | |- | ||
+ | ! Parameter | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | $itemId|| number|| The Id of the item to be placed. Can be found in the [[Modding:IDLists:BuildableItems|Buildable Items List]]. | ||
+ | |- | ||
+ | | $coordinates|| array || The x, y, z coordinates where the item should be placed. | ||
+ | |- | ||
+ | | $rotation|| integer || The rotation of the item. Allowed values: 0, 1, 2, 3. | ||
+ | |} | ||
+ | |||
+ | '''Example:''' | ||
+ | <source lang="php"> | ||
+ | $MissionContext->AddItem(1, array(10, 3, 12), 1); | ||
+ | </source> | ||
+ | |||
+ | ==AddObstacles()== | ||
+ | This command fills up a region with blocks, so it becomes unpassable: | ||
+ | <source lang="php"> | ||
+ | $MissionContext->AddObstacles($regionId, $materialId, $height, $density) | ||
+ | </source> | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+ Parameters | ||
+ | |- | ||
+ | ! Parameter | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | $regionId || string || The Id of a region that has been defined with the ''SetRegion'' command before, or placed in the editor. | ||
+ | |- | ||
+ | | $materialId || integer || The Id of the material the block should have. Taken from [[Modding:IDLists:Blocks|Blocks Id List]] | ||
+ | |- | ||
+ | | $height || integer || number of blocks above and beyond the ship height that should be filled too (e.g. to create a wall) | ||
+ | |- | ||
+ | | $density || integer || ''=0:'' solid obstacle. ''1-100'' The higher, the more dense. ''10'' is approx. like the Ice biome. | ||
+ | |} | ||
+ | |||
+ | '''Example:''' | ||
+ | <source lang="php"> | ||
+ | $MissionContext->AddObstacles('myRegion', 2, 16, 10); //Ice blocks with density like normal ice biome | ||
+ | $MissionContext->AddObstacles($someRegion, 1, 2, 0); //Solid carbon wall of height 5. | ||
</source> | </source> | ||
Line 59: | Line 139: | ||
− | == | + | ==AddShipByDefinition() / SpawnShipByDefinition() == |
− | + | These commands add a new ship to the map, based on a ship definition from [[Modding:PVEMissions:shipdefinitions.xml|shipdefinitions.xml]]. ''AddShipByDefinition() adds the ship via map coordinates, ''SpawnShipByDefinition()'' adds the ship at a given spawn location. | |
+ | The function calls look like this: | ||
<source lang="php"> | <source lang="php"> | ||
− | $shipId = $MissionContext-> | + | $shipId = $MissionContext->AddShipByDefinition($definitionId, $coordinates, $rotation, $owner, $playJumpAnimation) |
+ | $shipId = $MissionContext->SpawnShipByDefinition($definitionId, $spawnLocationId, $rotation, $owner, $playJumpAnimation) | ||
</source> | </source> | ||
Line 75: | Line 157: | ||
|- | |- | ||
| $coordinates || array || The x and z coordinates where to spawn the ship. | | $coordinates || array || The x and z coordinates where to spawn the ship. | ||
+ | |- | ||
+ | | $spawnLocationId || string || The Id of the spawn location present in the map created with the editor. | ||
+ | |- | ||
+ | | $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. | ||
+ | |- | ||
+ | | $playJumpAnimation || bool || Determines if a jump portal animation should be played when the ship appears. | ||
+ | |} | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+ Return Value | ||
+ | |- | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | int || The Id of the ship on the map for use in ''MoveShip'' command or ''OnShipKilled'' trigger for example. ''null'', if the ship could not be added. | ||
+ | |} | ||
+ | |||
+ | '''Examples:''' | ||
+ | <source lang="php"> | ||
+ | $shipId = $MissionContext->AddShipByDefinition('PirateProbe', array(10, 12), 0, General::$NeutralPlayerId, false); | ||
+ | $shipId2 = $MissionContext->SpawnShipByDefinition('PirateProbe', SpawnLocations::$JumpPortalAtBase, 0, General::$NeutralPlayerId, false); | ||
+ | </source> | ||
+ | <source lang="php"> | ||
+ | $shipId3 = $MissionContext->AddShipByDefinition(ShipDefinitions::$Rosinante, array(6, -7), 45, $this->PlayerOne, false); | ||
+ | $shipId4 = $MissionContext->SpawnShipByDefinition(ShipDefinitions::$Rosinante, SpawnLocations::$JumpPortalAtBase, 45, $this->PlayerOne, false); | ||
+ | </source> | ||
+ | |||
+ | |||
+ | ==AddShipByPlayerShipId() / SpawnShipByPlayerShipId() == | ||
+ | These commands add a new ship to the map, based on an Id of a ship players brought into the mission (e.g. to copy or reconstruct ships). ''AddShipByPlayerShipId() adds the ship via map coordinates, ''SpawnShipByPlayerShipId()'' adds the ship at a given spawn location. | ||
+ | The function calls look like this: | ||
+ | <source lang="php"> | ||
+ | $shipId = $MissionContext->AddShipByPlayerShipId($shipId, $coordinates, $rotation, $owner, $playJumpAnimation) | ||
+ | $shipId = $MissionContext->SpawnShipByPlayerShipId($shipId, $spawnLocationId, $rotation, $owner, $playJumpAnimation) | ||
+ | </source> | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+ Parameters | ||
+ | |- | ||
+ | ! Parameter | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | $shipId|| integer|| The Id of the player ship, taken from ''$MissionContext->PlayersShipList''. | ||
+ | |- | ||
+ | | $coordinates || array || The x and z coordinates where to spawn the ship. | ||
+ | |- | ||
+ | | $spawnLocationId || string || The Id of the spawn location present in the map created with the editor. | ||
|- | |- | ||
| $rotation || integer || The rotation (in degrees) of 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. | | $owner || string || The PlayerId of the ship owner. 'X' for enemies, 'Y' for allies, the playerId from the ''$MissionContext->PlayerList'' property for a player. | ||
+ | |- | ||
+ | | $playJumpAnimation || bool || Determines if a jump portal animation should be played when the ship appears. | ||
|} | |} | ||
Line 87: | Line 221: | ||
! Description | ! Description | ||
|- | |- | ||
− | | int || The Id of the ship on the map for use in ''MoveShip'' command or ''OnShipKilled'' trigger for example. | + | | int || The Id of the ship on the map for use in ''MoveShip'' command or ''OnShipKilled'' trigger for example. ''null'', if the ship could not be added. |
|} | |} | ||
'''Examples:''' | '''Examples:''' | ||
<source lang="php"> | <source lang="php"> | ||
− | $shipId = $MissionContext-> | + | $existingShipId = $MissionContext->PlayersShipList[0]->ID; |
+ | $shipId = $MissionContext->AddShipByPlayerShipId(existingShipId , array(10, 12), 0, General::$NeutralPlayerId, false); | ||
+ | $shipId2 = $MissionContext->SpawnShipByPlayerShipId(existingShipId , SpawnLocations::$JumpPortalAtBase, 0, General::$NeutralPlayerId, false); | ||
</source> | </source> | ||
+ | |||
+ | ==AddShipStatusIcon()== | ||
+ | Adds an icon to the ship to display a mission status (e.g. has a quest item loaded, etc.) | ||
<source lang="php"> | <source lang="php"> | ||
− | + | $MissionContext->AddShipStatusIcon($shipId, $iconType) | |
− | |||
</source> | </source> | ||
+ | {| class="wikitable" | ||
+ | |+ Parameters | ||
+ | |- | ||
+ | ! Parameter | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | $shipId|| integer || The Id of the ship, received as return value from the '''$MissionContext->AddShip''' command or from '''$MissionContext->PlayersShipList'''. | ||
+ | |- | ||
+ | | $iconType|| string || Defines the icon type. Possible values are: ''ship, arrowleft, arrowright, refresh, build, delete, jump, money, edit, sticky, arena, statistics, follow, hold, energy, chat, level, cargo'' | ||
+ | |} | ||
− | ==MoveShip()== | + | '''Example:''' |
− | This command moves an existing ship to the target coordinates. | + | <source lang="php"> |
+ | $MissionContext->AddShipStatusIcon (17, 'refresh'); | ||
+ | $MissionContext->AddShipStatusIcon ($MissionContext-PlayersShipList[0]->ID, Icons::Cargo); | ||
+ | </source> | ||
+ | |||
+ | ==ClearShipStatusIcons()== | ||
+ | Removes all icons from a ship which have been added with ''$MissionContext->AddShipStatusIcon''. | ||
+ | <source lang="php"> | ||
+ | $MissionContext->ClearShipStatusIcons($shipId) | ||
+ | </source> | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+ Parameters | ||
+ | |- | ||
+ | ! Parameter | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | $shipId|| integer || The Id of the ship, received as return value from the '''$MissionContext->AddShip''' command or from '''$MissionContext->PlayersShipList'''. | ||
+ | |} | ||
+ | |||
+ | '''Example:''' | ||
+ | <source lang="php"> | ||
+ | $MissionContext->ClearShipStatusIcons(17); | ||
+ | </source> | ||
+ | |||
+ | ==EnableButtonForPlayer() / DisableButtonForPlayer()== | ||
+ | These commands enable/disable a button, which has been defined with '''$MissionContext->AddButton''', for a specific player | ||
+ | <source lang="php"> | ||
+ | $MissionContext->EnableButtonForPlayer($buttonId, $playerId) | ||
+ | $MissionContext->DisableButtonForPlayer($buttonId, $playerId) | ||
+ | </source> | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+ Parameters | ||
+ | |- | ||
+ | ! Parameter | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | $buttonId|| string || The Id of the button, which has been used when the button was created with '''$MissionContext->AddButton''' | ||
+ | |- | ||
+ | | $owner || string || The PlayerId for who the button should be enabled/disabled. | ||
+ | |} | ||
+ | |||
+ | '''Examples:''' | ||
+ | <source lang="php"> | ||
+ | $MissionContext->EnableButtonForPlayer('myButtonId', $PlayerOne); | ||
+ | $MissionContext->DisableButtonForPlayer($someButtonId, $MissionContext->PlayersList[0]); | ||
+ | </source> | ||
+ | |||
+ | |||
+ | ==EnableDetectors() / DisableDetectors()== | ||
+ | These commands enable/disable the detector capabilities of a ship in the mission, e.g. for a quest ship to avoid unfair advantages. | ||
+ | <source lang="php"> | ||
+ | $MissionContext->EnableDetectors($shipId) | ||
+ | $MissionContext->DisableDetectors($shipId) | ||
+ | </source> | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+ Parameters | ||
+ | |- | ||
+ | ! Parameter | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | $ship || integer|| The Id of the ship, either received as return value from '''$MissionContext->AddShip''', or from the PlayersShipList. | ||
+ | |} | ||
+ | |||
+ | '''Examples:''' | ||
+ | <source lang="php"> | ||
+ | $MissionContext->EnableDetectors('myShipId'); | ||
+ | $MissionContext->DisableDetectors($someShipId); | ||
+ | </source> | ||
+ | |||
+ | |||
+ | ==FocusCamera()== | ||
+ | This command focuses the camera on a certain map location (for story-telling purposes) for a given time. | ||
+ | <source lang="php"> | ||
+ | $MissionContext->FocusCamera($cameraCoordinates, $lookAtCoordinates, $duration, $playerId) | ||
+ | </source> | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+ Parameters | ||
+ | |- | ||
+ | ! Parameter | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | $cameraCoordinates || array || The x,y,z coordinates of the camera location (look from) | ||
+ | |- | ||
+ | | $lookAtCoordinates || array || The x,y,z coordinates of the target location (look at) | ||
+ | |- | ||
+ | | $duration || integer || The duration of the camera focus in seconds | ||
+ | |- | ||
+ | | $playerId || string|| The Id of the player for who the camera should get focused | ||
+ | |} | ||
+ | |||
+ | '''Examples:''' | ||
+ | <source lang="php"> | ||
+ | $MissionContext->FocusCamera(array(5, 10, 20), array(-2, 1, 13), 5, $MissionContext->PlayersList[0]); | ||
+ | </source> | ||
+ | |||
+ | ==MoveShip() / MoveShipToSpawnLocation() == | ||
+ | This command moves an existing ship to the target coordinates or the target spawn location. | ||
<source lang="php"> | <source lang="php"> | ||
$MissionContext->MoveShip($shipId, $coordinates) | $MissionContext->MoveShip($shipId, $coordinates) | ||
+ | $MissionContext->MoveShipToSpawnLocation($shipId, $spawnLocationId) | ||
</source> | </source> | ||
− | | class="wikitable" | + | {| class="wikitable" |
|+ Parameters | |+ Parameters | ||
|- | |- | ||
Line 116: | Line 370: | ||
|- | |- | ||
| $coordinates || array || The x and z coordinates where to move the ship. | | $coordinates || array || The x and z coordinates where to move the ship. | ||
+ | |- | ||
+ | | $spawnLocationId|| string|| The id of a spawn location created in the editor. | ||
|} | |} | ||
Line 121: | Line 377: | ||
<source lang="php"> | <source lang="php"> | ||
$rosinante = $MissionContext->AddShip('Rosinante', array(6, -7), 45, '4711'); | $rosinante = $MissionContext->AddShip('Rosinante', array(6, -7), 45, '4711'); | ||
− | $MissionContext->MoveShip($rosinante); | + | $MissionContext->MoveShip($rosinante, array(12, 22)); |
+ | $MissionContext->MoveShipToSpawnLocation($rosinante, 'MySpawnLocation'); | ||
</source> | </source> | ||
− | |||
==RemoveBlock()== | ==RemoveBlock()== | ||
This command removes a single block from the mission map. | This command removes a single block from the mission map. | ||
<source lang="php"> | <source lang="php"> | ||
− | $MissionContext->RemoveBlock($coordinates) | + | $MissionContext->RemoveBlock($coordinates, $explode) |
</source> | </source> | ||
Line 139: | Line 395: | ||
|- | |- | ||
| $coordinates || array|| An array with the x, y, z coordinates of the location where to remove the block. | | $coordinates || array|| An array with the x, y, z coordinates of the location where to remove the block. | ||
+ | |- | ||
+ | | $explode|| boolean|| Determines if the block should explode (true) or just disappear (false) | ||
+ | |} | ||
+ | |||
+ | |||
+ | '''Example:''' | ||
+ | <source lang="php"> | ||
+ | $MissionContext->RemoveBlock(array(10, 3, 12), true); | ||
+ | </source> | ||
+ | |||
+ | ==RemoveBuilding()== | ||
+ | This command removes a building from the mission map. | ||
+ | <source lang="php"> | ||
+ | $MissionContext->RemoveBuilding($coordinates, $explode) | ||
+ | </source> | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+ Parameters | ||
+ | |- | ||
+ | ! Parameter | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | $coordinates || array|| An array with the x, y, z coordinates of the building location. | ||
+ | |- | ||
+ | | $explode|| boolean|| Determines if the building should explode (true) or just disappear (false) | ||
+ | |} | ||
+ | |||
+ | |||
+ | '''Example:''' | ||
+ | <source lang="php"> | ||
+ | $MissionContext->RemoveBuilding(array(10, 3, 12)); | ||
+ | </source> | ||
+ | |||
+ | |||
+ | ==RemoveButton()== | ||
+ | This command removes a previously defined button from the mission. | ||
+ | <source lang="php"> | ||
+ | $MissionContext->RemoveButton($buttonId) | ||
+ | </source> | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+ Parameters | ||
+ | |- | ||
+ | ! Parameter | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | $buttonId|| string || The Id of the button which has been used during creation with '''$MissionContext->AddButton''' | ||
|} | |} | ||
Line 144: | Line 449: | ||
'''Example:''' | '''Example:''' | ||
<source lang="php"> | <source lang="php"> | ||
− | $MissionContext-> | + | $MissionContext->RemoveButton('myButtonId'); |
</source> | </source> | ||
Line 168: | Line 473: | ||
</source> | </source> | ||
+ | ==RemoveItem()== | ||
+ | Removes an item from the map. | ||
+ | <source lang="php"> | ||
+ | $MissionContext->RemoveItem($coordinates, $explode) | ||
+ | </source> | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+ Parameters | ||
+ | |- | ||
+ | ! Parameter | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | $coordinates|| array || The x, y, z coordinates where the item is located. | ||
+ | |- | ||
+ | | $explode || boolean|| Sets if the item should explode. | ||
+ | |} | ||
+ | |||
+ | '''Example:''' | ||
+ | <source lang="php"> | ||
+ | $MissionContext->RemoveItem(array(10, 3, 12), true); | ||
+ | </source> | ||
+ | |||
+ | ==RemoveMarker()== | ||
+ | Removes an existing target marker from the world and/or minimap. | ||
+ | <source lang="php"> | ||
+ | $MissionContext->RemoveMarker($markerId) | ||
+ | </source> | ||
+ | {| class="wikitable" | ||
+ | |+ Parameters | ||
+ | |- | ||
+ | ! Parameter | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | $markerId || string || The Id of the marker used when creating the marker with the ''SetMarker'' command. | ||
+ | |} | ||
+ | |||
+ | '''Example:''' | ||
+ | <source lang="php"> | ||
+ | $MissionContext->SetMarker('myMarker', array(12,0,10), true, false); | ||
+ | $MissionContext->RemoveMarker('myMarker'); | ||
+ | </source> | ||
==RemoveMissionObjective()== | ==RemoveMissionObjective()== | ||
Line 189: | Line 537: | ||
$MissionContext->SetMissionObjective('myObjective', array('EN' => 'This is an objective')); | $MissionContext->SetMissionObjective('myObjective', array('EN' => 'This is an objective')); | ||
$MissionContext->RemoveMissionObjective('myObjective'); | $MissionContext->RemoveMissionObjective('myObjective'); | ||
+ | </source> | ||
+ | |||
+ | |||
+ | ==RemoveObstacles()== | ||
+ | This command removes a all blocks from a region | ||
+ | <source lang="php"> | ||
+ | $MissionContext->RemoveObstacles($regionId, $explode) | ||
+ | </source> | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+ Parameters | ||
+ | |- | ||
+ | ! Parameter | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | $regionId|| array|| The Id of a region defined with the ''AddRegion'' command or in the editor. | ||
+ | |- | ||
+ | | $explode|| boolean|| Determines if the blocks should explode (true) or just disappear(false) | ||
+ | |} | ||
+ | |||
+ | |||
+ | '''Example:''' | ||
+ | <source lang="php"> | ||
+ | $MissionContext->RemoveObstacles('myRegion', true); | ||
</source> | </source> | ||
Line 208: | Line 581: | ||
| $explode || boolean || Set if the ship should be destroyed/explode (true), or just disappear (false) | | $explode || boolean || Set if the ship should be destroyed/explode (true), or just disappear (false) | ||
|} | |} | ||
+ | |||
+ | '''Example:''' | ||
+ | <source lang="php"> | ||
+ | $MissionContext->RemoveShip(17, true)); | ||
+ | </source> | ||
+ | |||
+ | ==RemoveShipStatusIcon()== | ||
+ | Removes an icon from the ship which has been added with ''$MissionContext->AddShipStatusIcon''. | ||
+ | <source lang="php"> | ||
+ | $MissionContext->RemoveShipStatusIcon($shipId, $iconType) | ||
+ | </source> | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+ Parameters | ||
+ | |- | ||
+ | ! Parameter | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | $shipId|| integer || The Id of the ship, received as return value from the '''$MissionContext->AddShip''' command or from '''$MissionContext->PlayersShipList'''. | ||
+ | |- | ||
+ | | $iconType|| string || The icon type to be removed. | ||
+ | |} | ||
+ | |||
+ | '''Example:''' | ||
+ | <source lang="php"> | ||
+ | $MissionContext->RemoveShipStatusIcon(17, 'refresh'); | ||
+ | $MissionContext->RemoveShipStatusIcon($MissionContext-PlayersShipList[0]->ID, Icons::Cargo); | ||
+ | </source> | ||
==RemoveTimer()== | ==RemoveTimer()== | ||
Line 254: | Line 656: | ||
</source> | </source> | ||
+ | |||
+ | ==RepairShip()== | ||
+ | Repairs a ship to its original ship definition | ||
+ | <source lang="php"> | ||
+ | $MissionContext->RepairShip($shipId) | ||
+ | </source> | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+ Parameters | ||
+ | |- | ||
+ | ! Parameter | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | $shipId|| integer|| The Id of the ship | ||
+ | |} | ||
+ | |||
+ | '''Example:''' | ||
+ | <source lang="php"> | ||
+ | $MissionContext->RepairShip($myShipId); | ||
+ | $MissionContext->RepairShip($MissionContext->PlayersShipList[0]->ID); | ||
+ | </source> | ||
==SendSystemMessage()== | ==SendSystemMessage()== | ||
Line 276: | Line 700: | ||
</source> | </source> | ||
+ | ==SendTagMessage()== | ||
+ | Sends a message, which is attached to an object as a tag for a certain timespan. | ||
+ | <source lang="php"> | ||
+ | $MissionContext->SendTagMessage($coordinates, $messages, $duration, $playerId) | ||
+ | </source> | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+ Parameters | ||
+ | |- | ||
+ | ! Parameter | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | $coordinates || array || The x,y,z coordinates of the location where the tag should appear. | ||
+ | |- | ||
+ | | $messages || array || The array of translated messages. | ||
+ | |- | ||
+ | | $duration|| integer || The duration to display the tag in seconds. | ||
+ | |- | ||
+ | | $playerId || string || The Id of the player who should see the tag. | ||
+ | |} | ||
+ | |||
+ | '''Example:''' | ||
+ | <source lang="php"> | ||
+ | $MissionContext->SendTagMessage(array(15, 3, -13), array('EN' => 'This is a message', 'DE' => 'Dies ist eine Nachricht'), 5, $this->PlayerOne); | ||
+ | </source> | ||
+ | |||
+ | ==SetBuildingHitpoints()== | ||
+ | This command modifies the hitpoints of a building. | ||
+ | <source lang="php"> | ||
+ | $MissionContext->SetBuildingHitpoints($coordinates, $explode) | ||
+ | </source> | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+ Parameters | ||
+ | |- | ||
+ | ! Parameter | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | $coordinates || array || An array with the x, y, z coordinates of the building location. | ||
+ | |- | ||
+ | | $hitpoints|| integer || Sets the remaining hitpoints of the building. If <= 0, ''RemoveBuilding'' with ''explode=true'' will be called. | ||
+ | |} | ||
+ | |||
+ | |||
+ | '''Example:''' | ||
+ | <source lang="php"> | ||
+ | $MissionContext->SetBuildingHitpoints(array(10, 3, 12), 1500); | ||
+ | </source> | ||
+ | |||
+ | |||
+ | ==SetBuildingOwner()== | ||
+ | This command changes the owner of a building. | ||
+ | <source lang="php"> | ||
+ | $MissionContext->SetBuildingOwner($coordinates, $ownerId) | ||
+ | </source> | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+ Parameters | ||
+ | |- | ||
+ | ! Parameter | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | $coordinates || array || An array with the x, y, z coordinates of the building location. | ||
+ | |- | ||
+ | | $ownerId|| string || ''X'' for enemies, ''Y'' for allies. | ||
+ | |} | ||
+ | |||
+ | |||
+ | '''Example:''' | ||
+ | <source lang="php"> | ||
+ | $MissionContext->SetBuildingOwner(array(10, 3, 12), 'X'); | ||
+ | </source> | ||
==SetCounter()== | ==SetCounter()== | ||
Line 303: | Line 802: | ||
</source> | </source> | ||
+ | ==SetMarker()== | ||
+ | Adds or updates a target marker visible to the player. | ||
+ | <source lang="php"> | ||
+ | $MissionContext->SetMarker($markerId, $coordinates, $inWorld, $onMiniMap) | ||
+ | </source> | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+ Parameters | ||
+ | |- | ||
+ | ! Parameter | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | $markerId || string || The Id which can be used to call ''RemoveMarker'' or ''SetMarker'' (in order to update it again) later. | ||
+ | |- | ||
+ | | $coordinates || array || The x, y, z values of the coordinates where the marker should be placed. | ||
+ | |- | ||
+ | | $inWorld || boolean || Defines if the marker should be displayed in the 3D world. | ||
+ | |- | ||
+ | | $onMiniMap || boolean || Defines if the marker should be displayed on the minimap. | ||
+ | |} | ||
+ | |||
+ | '''Example:''' | ||
+ | <source lang="php"> | ||
+ | $MissionContext->SetMarker('myWorldTarget', array(10, 0, 30), true, false); //Create | ||
+ | $MissionContext->SetMarker('myWorldTarget', array(10, 0, 30), true, true); //Update to display on minimap too | ||
+ | $MissionContext->SetMarker('myMiniMapTarget', array(30, 0, 22), false, true); //Create | ||
+ | </source> | ||
==SetMissionObjective()== | ==SetMissionObjective()== | ||
Line 402: | Line 929: | ||
$MissionContext->SetRegion('myRectangle, array(10, 12), array(5, 5)); | $MissionContext->SetRegion('myRectangle, array(10, 12), array(5, 5)); | ||
$MissionContext->SetRegion('myCircle', array(10, 12), 4); | $MissionContext->SetRegion('myCircle', array(10, 12), 4); | ||
+ | </source> | ||
+ | |||
+ | ==SetShipBehaviour()== | ||
+ | Changes the current AI behaviour for the ship. Works for non-player ships only. | ||
+ | |||
+ | <source lang="php"> | ||
+ | $MissionContext->SetShipBehaviour($shipId, $behaviour); | ||
+ | </source> | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+ Parameters | ||
+ | |- | ||
+ | ! Parameter | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | $shipId || integer || The Id of the ship which has been retreived from the ''PlayersShipList'' or via the ''AddShip'' command. | ||
+ | |- | ||
+ | | $behaviour|| string || The new ship behaviour. Valid values are: ''hold'', ''follow''. | ||
+ | |} | ||
+ | |||
+ | '''Examples:''' | ||
+ | <source lang="php"> | ||
+ | $MissionContext->SetShipBehaviour(1, 'hold'); | ||
+ | $MissionContext->SetShipBehaviour($myShipId, 'follow'); | ||
</source> | </source> | ||
Line 426: | Line 978: | ||
<source lang="php"> | <source lang="php"> | ||
$MissionContext->SetShipOwner(1,'X'); | $MissionContext->SetShipOwner(1,'X'); | ||
− | $MissionContext->SetShipOwner($myShipId, ' | + | $MissionContext->SetShipOwner($myShipId, General::PlayerOne); |
+ | </source> | ||
+ | |||
+ | ==SetShipPosition() / SetShipPositionSpawn() == | ||
+ | Changes the current location of a ship to either fixed coordinates or a spawn location. | ||
+ | |||
+ | <source lang="php"> | ||
+ | $MissionContext->SetShipPosition($shipId, $coordinates, $playJumpAnimation); | ||
+ | $MissionContext->SetShipPosition($shipId, $spawnLocationId, $playJumpAnimation); | ||
+ | </source> | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+ Parameters | ||
+ | |- | ||
+ | ! Parameter | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | $shipId|| integer || The Id of the ship which has been retreived from the ''PlayersShipList'' or via the ''AddShip'' command. | ||
+ | |- | ||
+ | | $coordinates|| array || The x and z coordinates where the ship should be located | ||
+ | |- | ||
+ | | $spawnLocationId || array ||The Id of the spawn location placed in the editor. | ||
+ | |- | ||
+ | | $playJumpAnimation|| boolean|| Play the jump portal animation at previous and new location, or not. | ||
+ | |} | ||
+ | |||
+ | '''Examples:''' | ||
+ | <source lang="php"> | ||
+ | $MissionContext->SetShipPosition(1, array(1, 10), true); | ||
+ | $MissionContext->SetShipPosition($myShipId, $someCoordinates, false); | ||
+ | $MissionContext->SetShipPositionSpawn(1, 'jumpPortalSpawnLocation', true); | ||
+ | $MissionContext->SetShipPositionSpawn($myShipId, $someSpawnLocation, false); | ||
+ | |||
+ | |||
</source> | </source> | ||
Line 432: | Line 1,018: | ||
Adds or updates a timer. It can count down secretly or be displayed (with a title) to the players. | Adds or updates a timer. It can count down secretly or be displayed (with a title) to the players. | ||
<source lang="php"> | <source lang="php"> | ||
− | $MissionContext->SetTimer($ | + | $MissionContext->SetTimer($timerId, $seconds, $display, $timerTexts); |
</source> | </source> | ||
Line 442: | Line 1,028: | ||
! Description | ! Description | ||
|- | |- | ||
− | | $ | + | | $timerId || string || The Id of the timer which can be used for the ''RemoveTimer'' or ''SetTimer'' (to update it later) commands, and which is passed to the ''OnTimerExpired'' event handler. |
|- | |- | ||
| $seconds || integer || The remaining seconds on the timer until expiration. | | $seconds || integer || The remaining seconds on the timer until expiration. |
Latest revision as of 17:46, 3 May 2017
Contents
- 1 AddBlock()
- 2 AddButton()
- 3 AddInRegionTrigger()
- 4 AddItem()
- 5 AddObstacles()
- 6 AddOutsideRegionTrigger()
- 7 AddShipByDefinition() / SpawnShipByDefinition()
- 8 AddShipByPlayerShipId() / SpawnShipByPlayerShipId()
- 9 AddShipStatusIcon()
- 10 ClearShipStatusIcons()
- 11 EnableButtonForPlayer() / DisableButtonForPlayer()
- 12 EnableDetectors() / DisableDetectors()
- 13 FocusCamera()
- 14 MoveShip() / MoveShipToSpawnLocation()
- 15 RemoveBlock()
- 16 RemoveBuilding()
- 17 RemoveButton()
- 18 RemoveCounter()
- 19 RemoveItem()
- 20 RemoveMarker()
- 21 RemoveMissionObjective()
- 22 RemoveObstacles()
- 23 RemoveShip()
- 24 RemoveShipStatusIcon()
- 25 RemoveTimer()
- 26 RemoveTrigger()
- 27 RepairShip()
- 28 SendSystemMessage()
- 29 SendTagMessage()
- 30 SetBuildingHitpoints()
- 31 SetBuildingOwner()
- 32 SetCounter()
- 33 SetMarker()
- 34 SetMissionObjective()
- 35 SetMissionFailed()
- 36 SetMissionSuccessful()
- 37 SetRegion()
- 38 SetShipBehaviour()
- 39 SetShipOwner()
- 40 SetShipPosition() / SetShipPositionSpawn()
- 41 SetTimer()
AddBlock()
This command adds a single block to the mission map.
$MissionContext->AddBlock($coordinates, $materialId)
Parameter | Type | Description |
---|---|---|
$coordinates | array | An array with the x, y, z coordinates of the location where to spawn the block. |
$materialId | integer | The Id of the material the block should have. Taken from Blocks Id List |
Example:
$MissionContext->AddBlock(array(10, 3, 12), 2); //Iron
$MissionContext->AddBlock($someLocation, 6); //Red Granite
AddButton()
This command adds a custom button at a given location (e.g. a building), which can be used for quests, story, or objectives.
$MissionContext->AddButton($buttonId, $coordinates, $buttonType)
Parameter | Type | Description |
---|---|---|
$buttonId | string | The id of the button, which can be used to enable/disable the button with the $MissionContext->EnableButtonForPlayer command, and which is handed to the OnButtonClicked event. |
$coordinates | array | An array with the x, y, z coordinates of the location where to spawn the button. |
$buttonType | string | Defines the icon of the button. Possible values are: ship, arrowleft, arrowright, refresh, build, delete, jump, money, edit, sticky, arena, statistics, follow, hold, energy, chat, level, cargo |
Example:
$MissionContext->AddButton('myButtonId', array(10, 3, 12), 'hold');
$MissionContext->AddButton($someButtonId, array(10, 3, 12), 'money');
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)
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. 0 if this trigger should accept any ship. |
Example:
$MissionContext->SetRegion('myCircle', array(10, 12), 7);
$MissionContext->AddInRegionTrigger('myTrigger', 'myCircle', 17);
AddItem()
Adds an item from the Buildable Items List to the map.
$MissionContext->AddItem($itemId, $coordinates, $rotation)
Parameter | Type | Description |
---|---|---|
$itemId | number | The Id of the item to be placed. Can be found in the Buildable Items List. |
$coordinates | array | The x, y, z coordinates where the item should be placed. |
$rotation | integer | The rotation of the item. Allowed values: 0, 1, 2, 3. |
Example:
$MissionContext->AddItem(1, array(10, 3, 12), 1);
AddObstacles()
This command fills up a region with blocks, so it becomes unpassable:
$MissionContext->AddObstacles($regionId, $materialId, $height, $density)
Parameter | Type | Description |
---|---|---|
$regionId | string | The Id of a region that has been defined with the SetRegion command before, or placed in the editor. |
$materialId | integer | The Id of the material the block should have. Taken from Blocks Id List |
$height | integer | number of blocks above and beyond the ship height that should be filled too (e.g. to create a wall) |
$density | integer | =0: solid obstacle. 1-100 The higher, the more dense. 10 is approx. like the Ice biome. |
Example:
$MissionContext->AddObstacles('myRegion', 2, 16, 10); //Ice blocks with density like normal ice biome
$MissionContext->AddObstacles($someRegion, 1, 2, 0); //Solid carbon wall of height 5.
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:
$MissionContext->AddOutsideRegionTrigger($triggerId, $regionId, $shipId)
AddShipByDefinition() / SpawnShipByDefinition()
These commands add a new ship to the map, based on a ship definition from shipdefinitions.xml. AddShipByDefinition() adds the ship via map coordinates, SpawnShipByDefinition() adds the ship at a given spawn location. The function calls look like this:
$shipId = $MissionContext->AddShipByDefinition($definitionId, $coordinates, $rotation, $owner, $playJumpAnimation)
$shipId = $MissionContext->SpawnShipByDefinition($definitionId, $spawnLocationId, $rotation, $owner, $playJumpAnimation)
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. |
$spawnLocationId | string | The Id of the spawn location present in the map created with the editor. |
$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. |
$playJumpAnimation | bool | Determines if a jump portal animation should be played when the ship appears. |
Type | Description |
---|---|
int | The Id of the ship on the map for use in MoveShip command or OnShipKilled trigger for example. null, if the ship could not be added. |
Examples:
$shipId = $MissionContext->AddShipByDefinition('PirateProbe', array(10, 12), 0, General::$NeutralPlayerId, false);
$shipId2 = $MissionContext->SpawnShipByDefinition('PirateProbe', SpawnLocations::$JumpPortalAtBase, 0, General::$NeutralPlayerId, false);
$shipId3 = $MissionContext->AddShipByDefinition(ShipDefinitions::$Rosinante, array(6, -7), 45, $this->PlayerOne, false);
$shipId4 = $MissionContext->SpawnShipByDefinition(ShipDefinitions::$Rosinante, SpawnLocations::$JumpPortalAtBase, 45, $this->PlayerOne, false);
AddShipByPlayerShipId() / SpawnShipByPlayerShipId()
These commands add a new ship to the map, based on an Id of a ship players brought into the mission (e.g. to copy or reconstruct ships). AddShipByPlayerShipId() adds the ship via map coordinates, SpawnShipByPlayerShipId() adds the ship at a given spawn location. The function calls look like this:
$shipId = $MissionContext->AddShipByPlayerShipId($shipId, $coordinates, $rotation, $owner, $playJumpAnimation)
$shipId = $MissionContext->SpawnShipByPlayerShipId($shipId, $spawnLocationId, $rotation, $owner, $playJumpAnimation)
Parameter | Type | Description |
---|---|---|
$shipId | integer | The Id of the player ship, taken from $MissionContext->PlayersShipList. |
$coordinates | array | The x and z coordinates where to spawn the ship. |
$spawnLocationId | string | The Id of the spawn location present in the map created with the editor. |
$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. |
$playJumpAnimation | bool | Determines if a jump portal animation should be played when the ship appears. |
Type | Description |
---|---|
int | The Id of the ship on the map for use in MoveShip command or OnShipKilled trigger for example. null, if the ship could not be added. |
Examples:
$existingShipId = $MissionContext->PlayersShipList[0]->ID;
$shipId = $MissionContext->AddShipByPlayerShipId(existingShipId , array(10, 12), 0, General::$NeutralPlayerId, false);
$shipId2 = $MissionContext->SpawnShipByPlayerShipId(existingShipId , SpawnLocations::$JumpPortalAtBase, 0, General::$NeutralPlayerId, false);
AddShipStatusIcon()
Adds an icon to the ship to display a mission status (e.g. has a quest item loaded, etc.)
$MissionContext->AddShipStatusIcon($shipId, $iconType)
Parameter | Type | Description |
---|---|---|
$shipId | integer | The Id of the ship, received as return value from the $MissionContext->AddShip command or from $MissionContext->PlayersShipList. |
$iconType | string | Defines the icon type. Possible values are: ship, arrowleft, arrowright, refresh, build, delete, jump, money, edit, sticky, arena, statistics, follow, hold, energy, chat, level, cargo |
Example:
$MissionContext->AddShipStatusIcon (17, 'refresh');
$MissionContext->AddShipStatusIcon ($MissionContext-PlayersShipList[0]->ID, Icons::Cargo);
ClearShipStatusIcons()
Removes all icons from a ship which have been added with $MissionContext->AddShipStatusIcon.
$MissionContext->ClearShipStatusIcons($shipId)
Parameter | Type | Description |
---|---|---|
$shipId | integer | The Id of the ship, received as return value from the $MissionContext->AddShip command or from $MissionContext->PlayersShipList. |
Example:
$MissionContext->ClearShipStatusIcons(17);
EnableButtonForPlayer() / DisableButtonForPlayer()
These commands enable/disable a button, which has been defined with $MissionContext->AddButton, for a specific player
$MissionContext->EnableButtonForPlayer($buttonId, $playerId)
$MissionContext->DisableButtonForPlayer($buttonId, $playerId)
Parameter | Type | Description |
---|---|---|
$buttonId | string | The Id of the button, which has been used when the button was created with $MissionContext->AddButton |
$owner | string | The PlayerId for who the button should be enabled/disabled. |
Examples:
$MissionContext->EnableButtonForPlayer('myButtonId', $PlayerOne);
$MissionContext->DisableButtonForPlayer($someButtonId, $MissionContext->PlayersList[0]);
EnableDetectors() / DisableDetectors()
These commands enable/disable the detector capabilities of a ship in the mission, e.g. for a quest ship to avoid unfair advantages.
$MissionContext->EnableDetectors($shipId)
$MissionContext->DisableDetectors($shipId)
Parameter | Type | Description |
---|---|---|
$ship | integer | The Id of the ship, either received as return value from $MissionContext->AddShip, or from the PlayersShipList. |
Examples:
$MissionContext->EnableDetectors('myShipId');
$MissionContext->DisableDetectors($someShipId);
FocusCamera()
This command focuses the camera on a certain map location (for story-telling purposes) for a given time.
$MissionContext->FocusCamera($cameraCoordinates, $lookAtCoordinates, $duration, $playerId)
Parameter | Type | Description |
---|---|---|
$cameraCoordinates | array | The x,y,z coordinates of the camera location (look from) |
$lookAtCoordinates | array | The x,y,z coordinates of the target location (look at) |
$duration | integer | The duration of the camera focus in seconds |
$playerId | string | The Id of the player for who the camera should get focused |
Examples:
$MissionContext->FocusCamera(array(5, 10, 20), array(-2, 1, 13), 5, $MissionContext->PlayersList[0]);
MoveShip() / MoveShipToSpawnLocation()
This command moves an existing ship to the target coordinates or the target spawn location.
$MissionContext->MoveShip($shipId, $coordinates)
$MissionContext->MoveShipToSpawnLocation($shipId, $spawnLocationId)
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. |
$spawnLocationId | string | The id of a spawn location created in the editor. |
Example:
$rosinante = $MissionContext->AddShip('Rosinante', array(6, -7), 45, '4711');
$MissionContext->MoveShip($rosinante, array(12, 22));
$MissionContext->MoveShipToSpawnLocation($rosinante, 'MySpawnLocation');
RemoveBlock()
This command removes a single block from the mission map.
$MissionContext->RemoveBlock($coordinates, $explode)
Parameter | Type | Description |
---|---|---|
$coordinates | array | An array with the x, y, z coordinates of the location where to remove the block. |
$explode | boolean | Determines if the block should explode (true) or just disappear (false) |
Example:
$MissionContext->RemoveBlock(array(10, 3, 12), true);
RemoveBuilding()
This command removes a building from the mission map.
$MissionContext->RemoveBuilding($coordinates, $explode)
Parameter | Type | Description |
---|---|---|
$coordinates | array | An array with the x, y, z coordinates of the building location. |
$explode | boolean | Determines if the building should explode (true) or just disappear (false) |
Example:
$MissionContext->RemoveBuilding(array(10, 3, 12));
RemoveButton()
This command removes a previously defined button from the mission.
$MissionContext->RemoveButton($buttonId)
Parameter | Type | Description |
---|---|---|
$buttonId | string | The Id of the button which has been used during creation with $MissionContext->AddButton |
Example:
$MissionContext->RemoveButton('myButtonId');
RemoveCounter()
Removes an existing counter from the UI of the players.
$MissionContext->RemoveCounter($counterId)
Parameter | Type | Description |
---|---|---|
$counterId | string | The Id of the counter used when creating the counter with the SetCounter command. |
Example:
$MissionContext->SetCounter('myCounter', 12, array('EN' => 'This counter has the value 12.));
$MissionContext->RemoveCounter('myCounter');
RemoveItem()
Removes an item from the map.
$MissionContext->RemoveItem($coordinates, $explode)
Parameter | Type | Description |
---|---|---|
$coordinates | array | The x, y, z coordinates where the item is located. |
$explode | boolean | Sets if the item should explode. |
Example:
$MissionContext->RemoveItem(array(10, 3, 12), true);
RemoveMarker()
Removes an existing target marker from the world and/or minimap.
$MissionContext->RemoveMarker($markerId)
Parameter | Type | Description |
---|---|---|
$markerId | string | The Id of the marker used when creating the marker with the SetMarker command. |
Example:
$MissionContext->SetMarker('myMarker', array(12,0,10), true, false);
$MissionContext->RemoveMarker('myMarker');
RemoveMissionObjective()
Removes an existing mission objective from the UI of the players.
$MissionContext->RemoveMissionObjective($objectiveId)
Parameter | Type | Description |
---|---|---|
$objectiveId | string | The Id of the objective used when creating the objective with the SetMissionObjective command. |
Example:
$MissionContext->SetMissionObjective('myObjective', array('EN' => 'This is an objective'));
$MissionContext->RemoveMissionObjective('myObjective');
RemoveObstacles()
This command removes a all blocks from a region
$MissionContext->RemoveObstacles($regionId, $explode)
Parameter | Type | Description |
---|---|---|
$regionId | array | The Id of a region defined with the AddRegion command or in the editor. |
$explode | boolean | Determines if the blocks should explode (true) or just disappear(false) |
Example:
$MissionContext->RemoveObstacles('myRegion', true);
RemoveShip()
Removes a ship from the mission.
$MissionContext->RemoveShip($shipId, $explode)
Parameter | Type | Description |
---|---|---|
$shipId | integer | The Id of the ship to remove from the mission. Taken from the PlayersShipList or from the return value of AddShip. |
$explode | boolean | Set if the ship should be destroyed/explode (true), or just disappear (false) |
Example:
$MissionContext->RemoveShip(17, true));
RemoveShipStatusIcon()
Removes an icon from the ship which has been added with $MissionContext->AddShipStatusIcon.
$MissionContext->RemoveShipStatusIcon($shipId, $iconType)
Parameter | Type | Description |
---|---|---|
$shipId | integer | The Id of the ship, received as return value from the $MissionContext->AddShip command or from $MissionContext->PlayersShipList. |
$iconType | string | The icon type to be removed. |
Example:
$MissionContext->RemoveShipStatusIcon(17, 'refresh');
$MissionContext->RemoveShipStatusIcon($MissionContext-PlayersShipList[0]->ID, Icons::Cargo);
RemoveTimer()
Removes an existing timer, and prevents its expiration.
$MissionContext->RemoveTimer($timerId)
Parameter | Type | Description |
---|---|---|
$timerId | string | The Id of the timer used when creating the timer with the SetTimer command. |
Example:
$MissionContext->SetTimer('myTimer', 12, true, array('EN' => 'This is a visible timer.'));
$MissionContext->RemoveTimer('myTimer');
RemoveTrigger()
Removes an existing trigger and prevents it from being triggered.
$MissionContext->RemoveTrigger($triggerId)
Parameter | Type | Description |
---|---|---|
$trigger | string | The Id of the trigger used when creating the trigger with the AddInRegionTrigger or AddOutsideRegionTrigger command. |
Example:
$MissionContext->AddInRegionTrigger('myTrigger', 'myCircle', 18);
$MissionContext->RemoveTrigger('myTrigger');
RepairShip()
Repairs a ship to its original ship definition
$MissionContext->RepairShip($shipId)
Parameter | Type | Description |
---|---|---|
$shipId | integer | The Id of the ship |
Example:
$MissionContext->RepairShip($myShipId);
$MissionContext->RepairShip($MissionContext->PlayersShipList[0]->ID);
SendSystemMessage()
Sends an orange system chat message to all players.
$MissionContext->SendSystemMessage($messages)
Parameter | Type | Description |
---|---|---|
$messages | array | The array of translated messages. |
Example:
$MissionContext->SendSystemMessage(array('EN' => 'This is a message', 'DE' => 'Dies ist eine Nachricht'));
SendTagMessage()
Sends a message, which is attached to an object as a tag for a certain timespan.
$MissionContext->SendTagMessage($coordinates, $messages, $duration, $playerId)
Parameter | Type | Description |
---|---|---|
$coordinates | array | The x,y,z coordinates of the location where the tag should appear. |
$messages | array | The array of translated messages. |
$duration | integer | The duration to display the tag in seconds. |
$playerId | string | The Id of the player who should see the tag. |
Example:
$MissionContext->SendTagMessage(array(15, 3, -13), array('EN' => 'This is a message', 'DE' => 'Dies ist eine Nachricht'), 5, $this->PlayerOne);
SetBuildingHitpoints()
This command modifies the hitpoints of a building.
$MissionContext->SetBuildingHitpoints($coordinates, $explode)
Parameter | Type | Description |
---|---|---|
$coordinates | array | An array with the x, y, z coordinates of the building location. |
$hitpoints | integer | Sets the remaining hitpoints of the building. If <= 0, RemoveBuilding with explode=true will be called. |
Example:
$MissionContext->SetBuildingHitpoints(array(10, 3, 12), 1500);
SetBuildingOwner()
This command changes the owner of a building.
$MissionContext->SetBuildingOwner($coordinates, $ownerId)
Parameter | Type | Description |
---|---|---|
$coordinates | array | An array with the x, y, z coordinates of the building location. |
$ownerId | string | X for enemies, Y for allies. |
Example:
$MissionContext->SetBuildingOwner(array(10, 3, 12), 'X');
SetCounter()
Adds or updates a counter visible to all players.
$MissionContext->SetCounter($counterId, $value, $counterTexts)
Parameter | Type | Description |
---|---|---|
$counterId | string | The Id which can be used to call RemoveCounter or SetCounter (in order to update it again) later. |
$value | integer | The (new) value of the counter. |
$counterTexts | array | The array of translated counter descriptions |
Example:
$MissionContext->SetCounter('enemyCounter', 20, array('EN' => 'Remaining enemies', 'DE' => 'Verbleibende Feinde.')); //Create
$MissionContext->SetCounter('enemyCounter', $MissionContext->EnemiesShipList->Count, array('EN' => 'Remaining enemies', 'DE' => 'Verbleibende Feinde.')); //Update
SetMarker()
Adds or updates a target marker visible to the player.
$MissionContext->SetMarker($markerId, $coordinates, $inWorld, $onMiniMap)
Parameter | Type | Description |
---|---|---|
$markerId | string | The Id which can be used to call RemoveMarker or SetMarker (in order to update it again) later. |
$coordinates | array | The x, y, z values of the coordinates where the marker should be placed. |
$inWorld | boolean | Defines if the marker should be displayed in the 3D world. |
$onMiniMap | boolean | Defines if the marker should be displayed on the minimap. |
Example:
$MissionContext->SetMarker('myWorldTarget', array(10, 0, 30), true, false); //Create
$MissionContext->SetMarker('myWorldTarget', array(10, 0, 30), true, true); //Update to display on minimap too
$MissionContext->SetMarker('myMiniMapTarget', array(30, 0, 22), false, true); //Create
SetMissionObjective()
Adds or updates a mission objective visible to all players.
$MissionContext->SetCounter($objectiveId, $objectiveTexts)
Parameter | Type | Description |
---|---|---|
$objectiveId | string | The Id which can be used to call RemoveMissionObjective or SetMissionObjective (in order to update it again) later. |
$objectiveTexts | array | The array of translated objective texts. |
Example:
$MissionContext->SetMissionObjective('killEnemies', array('EN' => 'Kill the first three enemies', 'DE' => 'Zerstöre die ersten drei Feinde.')); //Create
$MissionContext->SetMissionObjective('killEnemies', array('EN' => 'Kill all remaining enemies', 'DE' => 'Zerstöre alle verbleibenden Feinde.')); //Update
SetMissionFailed()
Ends the mission with a fail.
$MissionContext->SetMissionFailed($loseTexts)
Parameter | Type | Description |
---|---|---|
$loseTexts | array | The array of translated texts why the mission was lost. |
Example:
$MissionContext->SetMissionFailed(array('EN' => 'The timer has expired.', 'DE' => 'Die Zeit ist abgelaufen.'));
SetMissionSuccessful()
Ends the mission with a win. Will trigger the loot distribution.
$MissionContext->SetMissionSuccessful($winTexts)
Parameter | Type | Description |
---|---|---|
$winTexts | array | The array of translated texts why the mission was won. |
Example:
$MissionContext->SetMissionSuccessful(array('EN' => 'All enemies have been defeated.', 'DE' => 'Alle Feinde wurden zerstört.'));
SetRegion()
Defines a region on the map. A region can be used for a in-region trigger or outside-region trigger, or to add/remove obstacles. This function has an overload for two region types:
$MissionContext->SetRegion($regionId, $topLeftCoordinates, $size); //Rectangle
$MissionContext->SetRegion($regionId, $centerCoordinates, $radius); //Circle
Parameter | Type | Description |
---|---|---|
$regionId | string | The Id of the region which can be used for the AddRegionTrigger or AddOutsideRegionTrigger commands. |
$topLeftCoordinates | array | The x and z coordinates of the top left corner of the rectangle. |
$size | array | The width and height of the rectangle. |
$centerCoordinates | array | The x and z coordinates of the center of the circle. |
$radius | integer | The radius of the circle. |
Examples:
$MissionContext->SetRegion('myRectangle, array(10, 12), array(5, 5));
$MissionContext->SetRegion('myCircle', array(10, 12), 4);
SetShipBehaviour()
Changes the current AI behaviour for the ship. Works for non-player ships only.
$MissionContext->SetShipBehaviour($shipId, $behaviour);
Parameter | Type | Description |
---|---|---|
$shipId | integer | The Id of the ship which has been retreived from the PlayersShipList or via the AddShip command. |
$behaviour | string | The new ship behaviour. Valid values are: hold, follow. |
Examples:
$MissionContext->SetShipBehaviour(1, 'hold');
$MissionContext->SetShipBehaviour($myShipId, 'follow');
SetShipOwner()
Changes the owner of a ship.
$MissionContext->SetShipOwner($shipId, $ownerId);
Parameter | Type | Description |
---|---|---|
$shipId | integer | The Id of the ship which has been retreived from the PlayersShipList or via the AddShip command. |
$ownerId | string | The player Id of the new owner of the ship. X for enemy, Y for neutral, or from the PlayersList |
Examples:
$MissionContext->SetShipOwner(1,'X');
$MissionContext->SetShipOwner($myShipId, General::PlayerOne);
SetShipPosition() / SetShipPositionSpawn()
Changes the current location of a ship to either fixed coordinates or a spawn location.
$MissionContext->SetShipPosition($shipId, $coordinates, $playJumpAnimation);
$MissionContext->SetShipPosition($shipId, $spawnLocationId, $playJumpAnimation);
Parameter | Type | Description |
---|---|---|
$shipId | integer | The Id of the ship which has been retreived from the PlayersShipList or via the AddShip command. |
$coordinates | array | The x and z coordinates where the ship should be located |
$spawnLocationId | array | The Id of the spawn location placed in the editor. |
$playJumpAnimation | boolean | Play the jump portal animation at previous and new location, or not. |
Examples:
$MissionContext->SetShipPosition(1, array(1, 10), true);
$MissionContext->SetShipPosition($myShipId, $someCoordinates, false);
$MissionContext->SetShipPositionSpawn(1, 'jumpPortalSpawnLocation', true);
$MissionContext->SetShipPositionSpawn($myShipId, $someSpawnLocation, false);
SetTimer()
Adds or updates a timer. It can count down secretly or be displayed (with a title) to the players.
$MissionContext->SetTimer($timerId, $seconds, $display, $timerTexts);
Parameter | Type | Description |
---|---|---|
$timerId | string | The Id of the timer which can be used for the RemoveTimer or SetTimer (to update it later) commands, and which is passed to the OnTimerExpired event handler. |
$seconds | integer | The remaining seconds on the timer until expiration. |
$display | boolean | Defines if the timer is visible to the players. |
$timerTexts | array | The translated titles of the timer. Mandatory, if $display = true. |
Example:
$MissionContext->SetTimer('myTimer', 60, false);
$MissionContext->SetTimer('myTimer', 30, true, array('EN' => 'Remaining time until attack wave', 'DE' => 'Verbleibende Zeit bis Angriffswelle'));