Difference between revisions of "Modding:PVEMissions:mission.php:MissionContextProperties"

From Galactineers
Jump to navigationJump to search
 
Line 39: Line 39:
 
$playerOneShips = from $MissionContext->PlayersShipList as $s where $s.Owner == $shipOwner select $s;
 
$playerOneShips = from $MissionContext->PlayersShipList as $s where $s.Owner == $shipOwner select $s;
 
</source>
 
</source>
 +
 +
 +
===AlliesShipList===
 +
Contains all ships allied to but not controlled by the players. Supports LINQ. Works exactly like ''PlayersShipList''
 +
 +
===EnemiesShipList===
 +
Contains all ships hostile to the players. Supports LINQ. Works exactly like ''PlayersShipList''
 +
 
[[Category:Modding:PVEMissions:mission.php]]
 
[[Category:Modding:PVEMissions:mission.php]]

Latest revision as of 18:56, 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:

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;


AlliesShipList

Contains all ships allied to but not controlled by the players. Supports LINQ. Works exactly like PlayersShipList

EnemiesShipList

Contains all ships hostile to the players. Supports LINQ. Works exactly like PlayersShipList