Simutrans-Squirrel-API
Modules | Classes | Functions
Functions to alter the state of the game and map

Modules

 Functions to rename something in the game
 

Classes

class  command_x
 

Functions

string city_x::change_size (integer delta)
 
string city_x::set_citygrowth_enabled (bool)
 
string convoy_x::set_line (player_x player, line_x line)
 
string convoy_x::toggle_withdraw (player_x)
 
string convoy_x::destroy (player_x)
 
string line_x::change_schedule (player_x, schedule_x)
 
string line_x::destroy (player_x)
 
string depot_x::append_vehicle (player_x pl, convoy_x cnv, vehicle_desc_x desc)
 
string depot_x::start_convoy (player_x, convoy_x)
 
string depot_x::start_all_convoys (player_x)
 
static string label_x::create (coord pos, player_x pl, string text)
 
string player_x::create_line (way_types wt)
 
string tile_x::remove_object (player_x pl, map_objects type)
 

Detailed Description

The player parameter in these functions represents the player that executes the command and pays for it. If the call is from an AI player then the parameter is set to player_x::self, and it will be checked whether the player is permitted to execute the command. Calls from scenario always pass this check.

In network games, the script is suspended until the command is executed, which is transparent to the script. Hence such commands cannot be called from within functions that should return immediately, see Functions that should return quickly..

Function Documentation

string depot_x::append_vehicle ( player_x  pl,
convoy_x  cnv,
vehicle_desc_x  desc 
)

Append a car to the convoy in this depot. If the convoy does not exist, a new one is created first.

Parameters
plplayer owns the convoy
cnvthe convoy
descdecriptor of the vehicle
string line_x::change_schedule ( player_x  ,
schedule_x   
)

Change schedule of line

string city_x::change_size ( integer  delta)

Change city size. City will immediately grow.

Parameters
deltaCity size will change by this number.
static string label_x::create ( coord  pos,
player_x  pl,
string  text 
)
static

Creates a new marker.

Parameters
posposition
plowner
texttext
string player_x::create_line ( way_types  wt)

Creates a new line for the player of the given way type.

Parameters
wtway type
string line_x::destroy ( player_x  )

Delete line

string convoy_x::destroy ( player_x  )

Destroy the convoy.

string tile_x::remove_object ( player_x  pl,
map_objects  type 
)

Remove object of given type from the tile.

Parameters
plplayer that pays for removal
typeobject type
Returns
null upon success, an error message otherwise
Warning
Does not work with all object types.
string city_x::set_citygrowth_enabled ( bool  )

Enable or disable city growth.

string convoy_x::set_line ( player_x  player,
line_x  line 
)

Assigns the convoy to the given line.

Parameters
player
line
string depot_x::start_all_convoys ( player_x  )

Start all convoys in this depot.

string depot_x::start_convoy ( player_x  ,
convoy_x   
)

Start the convoy in this depot.

string convoy_x::toggle_withdraw ( player_x  )

Toggle the flag 'withdraw convoy'