API:CBaseShipManager
From STNE Wiki
Scripting Portal | Contents | API Reference | Index |
---|
The CBaseShipManager is required to perform actions on a ship.
For this it is first necessary to create an instance of CMyShip:
Var Ship As New CMyShip(123456);
On the ship with the NCC 123456 all methods of the CBaseShipManager now apply because the property Action of CMyShip Class is the equivalent of CBaseShipManager.
Example
Var Ship as New CMyShip(123456); Var Station as New CMyShip(654321);
Ship.Action.CollectOre(20); Ship.Action.FlyTo('150|250'); Ship.Action.EnterOrbit(); Ship.Action.DockTo(Station.ShipID); Ship.Action.TransferToShip(Station.ShipID,100,EBeamResource.IridiumOre); Ship.Action.TransferFromShip(Station.ShipID,20,EBeamResource.Antimatter); Ship.Action.TransferFromShip(Station.ShipID,20,EBeamResource.Deuterium); Ship.Action.TransferFromShip(Station.ShipID,10,EBeamResource.Dilithium); Ship.Action.RefillWarpCore(500, EWarpcoreFillType.diliAMDeut); Ship.Action.Undock(); Ship.Action.LeaveOrbit(); Ship.Action.FlyTo('152|251');
In this example the ship would carry out the specified actions, in this case, collecting ore, flying to a station in orbit, docking, transferring the ore collected to the station, transferring fuel from the station, refilling the warp core, undocking, leaving orbit then flying back.
Methods
Here is a list of the common CBaseShipManager methods:
Please Note: The actions are subject to the same restrictions as in the game, which means you can only interact with other ships if they are in the same sector or for example, only activate the main computer when crew and energy are on the ship.
Important: Before you perform any actions, first check whether this is possible, e.g. when beaming or activating SRS - otherwise unnecessary code will be executed and a combat tick may be calculated (even if there are no enemy ships. Please keep in mind that your script can carry out a maximum of 100 actions per run, so don't just pay attention to the server for love!
Method | Parameter | Explanation |
---|---|---|
ActivateLRS(Status) | Boolean | With Ship.Action.ActivateLRS(True) the LRS is activated, with False it is deactivated |
ActivateMaincomputer(Status) | Boolean | Activates/Deactivates the main computer |
ActivateOverdrive(Status) | Boolean | Activates/Deactivates overdrive |
ActivateReplicators(Status) | Boolean | Activates/Deactivates the replicator on board |
ActivateShields(Status) | Boolean | Activates the shields |
ActivateSRS(Status) | Boolean | Activates the SRS |
ActivateTractorBeam(ShipID) | Integer | Directs a tractor beam to the ship which has the NCC number ShipID |
ActivateWarpCore(Status) | Boolean | Activates the Warpcore |
ApplyGoodsToConstruction() | - | Applys goods when converting tugs/stations |
CollectDeuterium(Energy) ** | Integer | Collects Deuterium with the amount of energy specified as Energy |
CollectOre(Energy) ** | Integer | Collects Iridium Ore with the amount of energy specified as Energy |
DeactivateTractorBeam() | - | Deactivates the tractor beam in which another ship is being held |
DockHangar(inShipID) | Integer | Enters the hangar of the ship specified as inShipID |
DockHangarForce(targetShip) | Integer | Pulls the ship with NCC targetShip into the hangar, ship must be held with a tractor beam first |
DockTo(ShipID) | Integer | Docks to the Ship/Station with the NCC ShipID |
DockToForce(ShipID) | Integer | Pulls the ship with NCC targetShip into a docking port, ship must be held with a tractor beam first |
EnterOrbit | - | Enter the orbit of the colony the ship is over |
ExtractFromWreck(Quantity) | Integer | Uses the specified quantity of energy to extract duranium from a Debris Field |
Fly(NumberOfFields, Direction) | Integer, EShipDirection | Flies the Number of Fields in the predetermined Direction |
FlyTo(Position) ** | String | Flies to the specified coordinates in format 'x|y' |
Hide | Boolean | Hides the Ship (If it is in a Dense Deuterium Nebula or Large Asteroid Field) |
JettisonGoods(Quantity, GoodsType) | Integer, EGoodsType | Jettisons the quantity of the GoodsType specified |
LeaveAllFleets() | - | Leaves all fleets which the ship was part of |
LeaveOrbit() | - | Leaves orbit |
RefillWarpCore(Quantity, WarpcoreType) | Integer, EWarpcoreFillType | Charges the warp core by the quantity specified with the type of goods specified |
Repair(Status) | Boolean | Activates/Deactivates the autorepair function on the ship |
ReserveBatterieEntladen(Quantity) | Integer | |
SalvageItemsFromWreck(ShipID) | Integer | Beams any items from the Debris Field with the NCC ShipID |
SchildeAufladen(Quantity) | Integer | |
SetAlertLevel(alertLevel) | EAlertLevel | Sets the alert level to the given value of the type EAlertLevel |
SetName(Name) | String | Renames the ship |
StationsReserveBatterieAufladen(Quantity) | Integer | |
TransferFromColony(ColonyID, Quantity, ResourceType) | Integer, Integer, EBeamResource | Transports from the colony with ID ColonyID the specified Quantity of resources of type ResourceType (EBeamResource) |
TransferFromShip(ShipID, Quantity, ResourceType) | Integer, Integer, EBeamResource | Transfers goods from the ship with NCC FromShipID |
TransferToColony(ColonyID, Quantity, ResourceType) | Integer, Integer, EBeamResource | Transports goods to colony |
TransferToShip(ShipID, Anzahl, Ressource) | Integer, Integer, EBeamResource | Transports goods to ship |
Undock() | - | Undocks the ship |
UndockForce(targetShip) | Integer | Force undocks the ship with the NCC specified |
UndockHangar() | - | Causes the ship to exit the hangar |
UndockHangarForce(targetShip) | Integer | Forces the ship with the NCC specified out of the hangar |
**Only possible with Feature Pack