get_item_count(item) → uint | Get the amount of a particular item stored in the train. |
get_contents() → dictionary string → uint | Get a summary of the train's inventory. |
remove_item(stack) → uint | Remove some items from the train. |
insert(stack) | Insert a stack into the train. |
clear_items_inside() | Clear all items in this train. |
manual_mode :: boolean [RW] | When true , the train is explicitly controlled by the player or script. |
speed :: double [RW] | Current speed. |
carriages :: array of LuaEntity [R] | Rolling stocks the train is composed of. |
locomotives :: dictionary string → array of LuaEntity [R] | Arrays of locomotives. |
cargo_wagons :: array of LuaEntity [R] | The cargo carriages the train contains. |
schedule :: TrainSchedule [RW] | |
state :: defines.train_state [R] | This train's current state. |
front_rail :: LuaEntity [R] | The rail at the front end of the train, possibly nil . |
back_rail :: LuaEntity [R] | The rail at the back end of the train, possibly nil . |
rail_direction_from_front_rail :: defines.rail_direction [R] | |
rail_direction_from_back_rail :: defines.rail_direction [R] | |
front_stock :: LuaEntity [R] | The front stock of this train or nil . |
back_stock :: LuaEntity [R] | The back stock of this train or nil . |
station :: LuaEntity [R] | The train stop this train is stopped at or nil . |
valid :: boolean [R] | Is this object valid? |
A train. Trains are a sequence of connected rolling stocks -- locomotives and wagons.
Get the amount of a particular item stored in the train.
Get a summary of the train's inventory.
Remove some items from the train.
Clear all items in this train.
When true
, the train is explicitly controlled by the player or script. When false
, the
train moves autonomously according to its schedule.
Current speed.
Rolling stocks the train is composed of.
Arrays of locomotives. The result is two arrays, indexed by "front_movers"
and "back_movers"
containing the locomotives. E.g. {front_movers={loco1, loco2}, back_movers={loco3}}
.
The cargo carriages the train contains.
This train's current state.
The rail at the front end of the train, possibly nil
.
The rail at the back end of the train, possibly nil
.
The front stock of this train or nil
.
The back stock of this train or nil
.
The train stop this train is stopped at or nil
.