Simutrans-Squirrel-API
|
Public Member Functions | |
command_x (tool_ids id) | |
integer | get_flags () |
void | set_flags (integer flags) |
string | work (player_x pl, coord3d pos) |
string | work (player_x pl, coord3d pos, string param) |
string | work (player_x pl, coord3d start, coord3d end, string param) |
Static Public Member Functions | |
static string | build_bridge (player_x pl, coord3d start, coord3d end, bridge_desc_x bridge) |
static string | build_bridge_at (player_x pl, coord3d start, bridge_desc_x bridge) |
static string | build_depot (player_x pl, coord3d pos, building_desc_x depot) |
static string | build_road (player_x pl, coord3d start, coord3d end, way_desc_x way, bool straight, bool keep_city_roads) |
static string | build_sign_at (player_x pl, coord3d pos, sign_desc_x sign) |
static string | build_station (player_x pl, coord3d pos, building_desc_x station, dir rotaton) |
static string | build_way (player_x pl, coord3d start, coord3d end, way_desc_x way, bool straight) |
static string | build_wayobj (player_x pl, coord3d start, coord3d end, wayobj_desc_x wayobj) |
static string | can_set_slope (player_x pl, coord3d pos, slope slope) |
static string | change_climate_at (player_x pl, coord3d pos, integer climate) |
static string | restore_slope (player_x pl, coord3d pos) |
static string | set_slope (player_x pl, coord3d pos, slope slope) |
static integer | slope_get_price (slope) |
Proof-of-concept to make tools available to scripts.
The default_param is not checked. Use at own risk.
Definition at line 8 of file api_command.cc.
command_x::command_x | ( | tool_ids | id | ) |
Constructor to obtain a tool.
id | id of the tool |
|
static |
Build a bridge. Similar to drag-and-build of bridges in-game.
pl | player to pay for the work |
start | coordinate, where bridge begins |
end | coordinate, where bridge ends |
bridge | type of bridge to be built |
|
static |
Build a bridge. Similar to one click with mouse on suitable start tile: program will figure out bridge span itself.
pl | player to pay for the work |
start | coordinate, where bridge begins, the end point will be automatically determined |
bridge | type of bridge to be built |
|
static |
Build a depot.
pl | player to pay for the work |
pos | position to place the depot |
depot | type of depot to be built |
|
static |
Build a road.
pl | player to pay for the work |
start | coordinate, where work begins |
end | coordinate, where work ends |
way | type of way to be built |
straight | force building of straight ways, similar as building way with control key pressed |
keep_city_roads | if true city roads will not be replaced |
|
static |
Build signal / road-sign. If such a sign already exists then change its direction.
pl | player to pay for the work |
pos | position of tile |
sign | type of road-sign or signal to be built |
|
static |
Build a station or station extension building.
pl | player to pay for the work |
pos | position to place the depot |
station | type of station to be built |
rotaton | (optional parameter) rotation of building (only used for flat docks, put direction from land to water here) |
|
static |
Build a way.
pl | player to pay for the work |
start | coordinate, where work begins |
end | coordinate, where work ends |
way | type of way to be built |
straight | force building of straight ways, similar as building way with control key pressed |
|
static |
Build way-object.
pl | player to pay for the work |
start | coordinate, where work begins |
end | coordinate, where work ends |
wayobj | type of wayobj to be built |
Checks whether player pl
can do this terraforming.
pl | player |
pos | position |
slope | new slope, can also be one of slope::all_up_slope or slope::all_down_slope |
Change climate of tile
pl | player to pay for the work |
pos | coordinate of tile |
climate | new climate, possible values see climates |
integer command_x::get_flags | ( | ) |
Restore natural slope of one tile.
pl | player to pay for the work |
pos | position of tile |
void command_x::set_flags | ( | integer | flags | ) |
Sets flags for this tool. Simulates pressing shift or ctrl while clicking with mouse.
flags | bitmap, 1 = shift pressed, 2 = ctrl pressed |
Modify the slope of one tile.
pl | player to pay for the work |
pos | position of tile |
slope | new slope, can also be one of slope::all_up_slope or slope::all_down_slope. |
Does the dirty work.
pl | player to pay for the work |
pos | coordinate, where something should happen |
Does the dirty work.
pl | player to pay for the work |
pos | coordinate, where something should happen |
param | magic parameter string |
Does the dirty work. Needs two positions for start and end of the work, for e.g., road building.
pl | player to pay for the work |
start | coordinate, where work begins |
end | coordinate, where work ends |
param | magic parameter string |