MinchinWeb's MetaLibrary
v.9
Library functions of OpenTTD AI writers.
|
Water and Ship related functions. More...
Static Public Member Functions | |
function | DistanceShip (TileA, TileB) |
Distance, as measured by a ship. More... | |
function | GetPossibleDockTiles (IndustryID) |
Tiles where a dock can be built near an industry. More... | |
function | GetDockFrontTiles (Tile) |
The tiles a ship can access a dock from. More... | |
function | BuildBuoy (Tile) |
Builds a buoy. More... | |
function | BuildDepot (DockTile, Front, NotNextToDock=true) |
Build a (ship) depot next to a dock. More... | |
function | RateShips (EngineID, Life, Cargo) |
Ship Scoring. More... | |
function | NearestDepot (TileID) |
Nearest ship depot. More... | |
Private Attributes | |
main = null | |
Water and Ship related functions.
Definition at line 77 of file Marine.nut.
|
static |
Builds a buoy.
Attempts to build a buoy, but first checks the box within _MinchinWeb_C_.BuoyOffset() for an existing buoy, and makes sure there's nothing but water between the two. If no existing buoy is found, one is built.
Definition at line 276 of file Marine.nut.
|
static |
Build a (ship) depot next to a dock.
Attempts to build a (water) depot, but first checks the box within _MinchinWeb_C_.WaterDepotOffset() for an existing depot, and makes sure there's nothing but water between the depot and dock. If no existing depot is found, one is built.
DockTile | Must be a water tile. |
NotNextToDock | When True , will keep the dock from being built next to an existing dock. |
DockTile
given is a dock (or any tile that is not a water tile). Definition at line 328 of file Marine.nut.
|
static |
Distance, as measured by a ship.
Assuming open ocean, ship in OpenTTD will travel 45° angle where possible, and then finish up the trip by going along a cardinal direction.
Definition at line 173 of file Marine.nut.
|
static |
The tiles a ship can access a dock from.
Given a tile, returns an array of possible 'front' tiles that a ship could access the dock from.
Tile | Can be either the land tile of a dock, or the water tile. |
Definition at line 212 of file Marine.nut.
|
static |
Tiles where a dock can be built near an industry.
Given an industry (by IndustryID), searches for possible tiles to build a dock and returns the list as an array of TileIndexs.
IndustryID | The IndustryID you wanted checked. |
Definition at line 179 of file Marine.nut.
|
static |
Nearest ship depot.
Add check that depot is connected to the given TileID.
Check that there is a depot to return.
Definition at line 461 of file Marine.nut.
|
static |
Ship Scoring.
Given an EngineID, the function will score them; higher is better.
Life | Desired lifespan of route, assumed to be in years. |
Cargo | Doesn't work yet. Capacity is measured in the default cargo. |
Add example of validator code.
Implement ship capacity in given cargo.
Definition at line 436 of file Marine.nut.
|
private |
Definition at line 78 of file Marine.nut.