MinchinWeb's MetaLibrary v.11
Library functions for OpenTTD AI (and GS) writers.
|
Engine functions. More...
Classes | |
class | Info |
Private Member Functions | |
constructor () |
Static Private Member Functions | |
function | Rate2 (EngineID, Cargo, TargetCapacity, MaxSpend=0) |
Vehicle Scoring v2. Deprecated in favour of v3. | |
function | Rate3 (EngineID, Cargo, MonthlyProduction, TravelDistance, PayDistance=0, MaxSpend=0) |
Vehicle Scoring v3. |
Engine functions.
These functions related to Engines.
Definition at line 25 of file Engine.nut.
|
inlineprivate |
Definition at line 28 of file Engine.nut.
|
staticprivate |
Vehicle Scoring v2. Deprecated in favour of v3.
Given an EngineID, the function will score them; higher is better.
Cargo | Cargo you want to carry. Ensure that the ship can retrofit to the desired cargo. |
TargetCapacity | (Approximate) amount of cargo you want to carry. Often the industry's monthly production. |
MaxSpend | Hard upper limit on Engine cost. Set to zero (the default) to ignore. Does not include retrofit costs. |
Add example of validator code.
Implement vehicle capacity in given cargo.
Definition at line 103 of file Engine.nut.
|
staticprivate |
Vehicle Scoring v3.
Given an EngineID, the function will score them; higher is better.
Cargo | Cargo you want to carry. Ensure that the ship can retrofit to the desired cargo. |
MonthlyProduction | Amount of cargo produced in a month. |
TravelDistance | The distance (in map tiles) that the engine is expected to travel between pickup and drop off. Assumes that the return distance is the same. |
PayDistance | The Manhattan distance between the source and destination (which is what is used for payments). If set to 0 (the default), TravelDistance will be used instead. |
MaxSpend | Hard upper limit on Engine cost. Set to zero (the default) to ignore. Does not include retrofit costs. |
Add example of validator code.
Implement vehicle capacity in given cargo.
Definition at line 175 of file Engine.nut.