|
Simutrans-Squirrel-API
r11875
|
Classes | |
| class | rules |
| class | debug |
Functions | |
| static string | gui::add_message_at (string text, coord3d position) |
| static string | gui::add_message (player_x text, string) |
| void | player_x::book_cash (integer delta) |
| string | load_language_file (string file) |
| static void | rules::forbid_tool (integer player_nr, integer tool_id) |
| static void | rules::forbid_way_tool (integer player_nr, integer tool_id, way_types wt, any_x default_paramter) |
| static void | rules::forbid_way_tool_rect (integer player_nr, integer tool_id, way_types wt, coord default_paramter, coord pos_nw, string pos_se, any_x err) |
| static void | rules::forbid_way_tool_cube (integer player_nr, integer tool_id, way_types wt, coord3d default_paramter, coord3d pos_nw, string pos_se, any_x err) |
| static void | rules::clear_forbid_tool (any_x player_nr, any_x tool_id) |
| static void | rules::clear_forbid_way_tool (any_x player_nr, any_x tool_id, any_x wt, any_x default_paramter) |
| static void | rules::clear_way_tool_rect (any_x player_nr, any_x tool_id, any_x wt, any_x default_paramter, any_x pos_nw, any_x pos_se, any_x allow) |
| static void | rules::clear_way_tool_cube (any_x player_nr, any_x tool_id, any_x wt, any_x default_paramter, any_x pos_nw, any_x pos_se, any_x allow) |
| static void | rules::clear () |
| static void | rules::clear_player () |
| static void | rules::allow_way_tool_rect (integer player_nr, integer tool_id, way_types wt, coord default_paramter, coord pos_nw, any_x pos_se) |
| static void | rules::allow_way_tool_cube (integer player_nr, integer tool_id, way_types wt, coord3d default_paramter, coord3d pos_nw, any_x pos_se) |
| static void | rules::gui_needs_update () |
| static string | debug::get_forbidden_text () |
| static bool | world::remove_player (player_x pl) |
| static integer | world::generate_goods (coord from, coord to, good_desc_x desc, integer count) |
These classes and methods are only available for scripted scenarios.
|
static |
Adds message to the players mailboxes. Will be shown in ticker or as pop-up window depending on players preferences.
| text | Text to be shown. Has to be a translated string or a translatable string. |
|
static |
Adds message to the players mailboxes. Will be shown in ticker or as pop-up window depending on players preferences. Message window has small view of world.
| text | Text to be shown. Has to be a translated string or a translatable string. |
| position | Position of the view on the map. Clicking on the message will center viewport at this position. |
|
static |
Allow tool with certain waytype within cubic region on the map.
| player_nr | number of player this rule applies to, if this is set to player_all then this acts for all players except public player |
| tool_id | id of tool |
| wt | waytype |
| default_paramter | object name or 0 (to catch all) |
| pos_nw | 3d-coordinate of north-western corner of cube |
| pos_se | 3d-coordinate of south-eastern corner of cube |
|
static |
Allow tool with certain waytype within rectangular region on the map.
| player_nr | number of player this rule applies to, if this is set to player_all then this acts for all players except public player |
| tool_id | id of tool |
| wt | waytype |
| default_paramter | object name or 0 (to catch all) |
| pos_nw | coordinate of north-western corner of rectangle |
| pos_se | coordinate of south-eastern corner of rectangle |
| void player_x::book_cash | ( | integer | delta | ) |
Change bank account of player by given amount delta.
| delta |
|
static |
Clear all forbidding rules, effectively allowing all tools again that were forbidden using functions of the table rules.
Only effects tools forbidden by rules::forbid_tool, rules::forbid_way_tool, rules::forbid_way_tool_cube, rules::forbid_way_tool_rect. The result of is_tool_allowed and is_work_allowed_here is not influenced.
|
static |
Allow again an internal tool.
| player_nr | number of player this rule applies to, if this is set to player_all then this acts for all players except public player |
| tool_id | id of tool |
|
static |
clear fule with certain waytype.
| player_nr | number of player this rule applies to, if this is set to player_all then this acts for all players except public player |
| tool_id | id of tool |
| wt | waytype |
| default_paramter | object name or 0 (to catch all) |
|
static |
Clear all forbidding rules for a selec player
Only effects tools forbidden by rules::forbid_tool, rules::forbid_way_tool, rules::forbid_way_tool_cube, rules::forbid_way_tool_rect. The result of is_tool_allowed and is_work_allowed_here is not influenced.
|
static |
clear rule with certain waytype within cubic region on the map.
| player_nr | number of player this rule applies to, if this is set to player_all then this acts for all players except public player |
| tool_id | id of tool |
| wt | waytype |
| default_paramter | object name or 0 (to catch all) |
| pos_nw | 3d-coordinate of north-western corner of cube |
| pos_se | 3d-coordinate of south-eastern corner of cube |
| allow | clear either allo (true) or forbid (false) rule |
|
static |
clear rule with certain waytype within rectangular region on the map.
| player_nr | number of player this rule applies to, if this is set to player_all then this acts for all players except public player |
| tool_id | id of tool |
| wt | waytype |
| default_paramter | object name or 0 (to catch all) |
| pos_nw | coordinate of north-western corner of rectangle |
| pos_se | coordinate of south-eastern corner of rectangle |
| allow | clear either allo (true) or forbid (false) rule |
|
static |
Forbid an internal tool.
| player_nr | number of player this rule applies to, if this is set to player_all then this acts for all players except public player |
| tool_id | id of tool |
|
static |
Forbid an internal tool with certain waytype.
| player_nr | number of player this rule applies to, if this is set to player_all then this acts for all players except public player |
| tool_id | id of tool |
| wt | waytype |
| default_paramter | object name or null (to catch all) |
|
static |
Forbid an internal tool with certain waytype within cubic region on the map.
| player_nr | number of player this rule applies to, if this is set to player_all then this acts for all players except public player |
| tool_id | id of tool |
| wt | waytype |
| default_paramter | object name or null (to catch all) |
| pos_nw | 3d-coordinate of north-western corner of cube |
| pos_se | 3d-coordinate of south-eastern corner of cube |
| err | error message presented to user when trying to apply this tool, see also is_work_allowed_here |
|
static |
Forbid an internal tool with certain waytype within rectangular region on the map.
| player_nr | number of player this rule applies to, if this is set to player_all then this acts for all players except public player |
| tool_id | id of tool |
| wt | waytype |
| default_paramter | object name or null (to catch all) |
| pos_nw | coordinate of north-western corner of rectangle |
| pos_se | coordinate of south-eastern corner of rectangle |
| err | error message presented to user when trying to apply this tool, see also is_work_allowed_here |
|
static |
Generates goods (passengers, mail or freight) that want to travel from from to to. Updates halt statistics (happy, unhappy, no route) for passengers if possible.
| from | start position for good |
| to | destination position for good |
| desc | Good descriptor |
| count | Number of goods to generate |
| 0 | No route to destination or start position not valid |
| 1 | Passengers/mail/freight successfully generated |
| 2 | Destination is within station catchment area |
| 8 | Route is overcrowded (if no_routing_over_overcrowded is enabled) |
|
static |
|
static |
Signals that toolbars and active tools need to be checked against scenario rules again.
| string load_language_file | ( | string | file | ) |
Helper method to load scenario-related translation files. Tries to load files in the following order relative to pakxx/scenario:
Here, iso refers to iso-abbreviation of currently active language.
The content of the files is cached. The cache is cleared upon reloading of savegame.
| file | name of txt-file |
|
static |
Removes player company: removes all assets. Use with care.
If pl is the first player (nr == 0) it is restarted immediately. Public player (nr == 1) cannot be removed.
In network games, there will be a delay between the call to this function and the removal of the player.
| pl | player to be removed |
1.8.13