Difference between revisions of "Modding:PVEMissions:mission.php:MissionContextProperties"
From Galactineers
Jump to navigationJump to searchLInsoDeTeh (talk | contribs) (Created page with "{{DISPLAYTITLE:$MissionContext Properties}} Category:Modding:PVEMissions:mission.php") |
LInsoDeTeh (talk | contribs) |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:$MissionContext Properties}} | {{DISPLAYTITLE:$MissionContext Properties}} | ||
+ | ==PlayersList== | ||
+ | Contains the player Ids of all players in the mission. Player Ids can for example be used in the ''AddShip'' command to define a ship owner. The collection supports LINQ. | ||
+ | '''Example:''' | ||
+ | <source lang="php"> | ||
+ | $firstPlayerId = $MissionContext->PlayersList[0]; | ||
+ | </source> | ||
+ | |||
+ | ==PlayersShipList== | ||
+ | Contains all ships controlled by the players. The collection supports LINQ. The ship objects in this collection have the following properties: | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+ Properties | ||
+ | |- | ||
+ | ! Propterty | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | ID || integer || The Id of the ship generated while using ''AddShip''. | ||
+ | |- | ||
+ | | Name || string || The name of the ship. | ||
+ | |- | ||
+ | | Location.X, Location.Y || Vector2D || The current coordinates of the ship. | ||
+ | |- | ||
+ | | Owner || string || The owner of the ship. | ||
+ | |- | ||
+ | | Level || integer || The level of the ship. | ||
+ | |} | ||
+ | |||
+ | <source lang="php"> | ||
+ | $firstShip = $MissionContext->PlayersShipList[0]; | ||
+ | $shipOwner = $firstShip.Owner; | ||
+ | $shipId = $firstShip.ID; | ||
+ | |||
+ | $numberOfShips = $MissionContext->PlayersShipList->Count; | ||
+ | |||
+ | $playerOneShips = from $MissionContext->PlayersShipList as $s where $s.Owner == $shipOwner select $s; | ||
+ | </source> | ||
[[Category:Modding:PVEMissions:mission.php]] | [[Category:Modding:PVEMissions:mission.php]] |
Revision as of 19:54, 15 March 2016
PlayersList
Contains the player Ids of all players in the mission. Player Ids can for example be used in the AddShip command to define a ship owner. The collection supports LINQ.
Example:
$firstPlayerId = $MissionContext->PlayersList[0];
PlayersShipList
Contains all ships controlled by the players. The collection supports LINQ. The ship objects in this collection have the following properties:
Propterty | Type | Description |
---|---|---|
ID | integer | The Id of the ship generated while using AddShip. |
Name | string | The name of the ship. |
Location.X, Location.Y | Vector2D | The current coordinates of the ship. |
Owner | string | The owner of the ship. |
Level | integer | The level of the ship. |
$firstShip = $MissionContext->PlayersShipList[0];
$shipOwner = $firstShip.Owner;
$shipId = $firstShip.ID;
$numberOfShips = $MissionContext->PlayersShipList->Count;
$playerOneShips = from $MissionContext->PlayersShipList as $s where $s.Owner == $shipOwner select $s;