These classes and methods are only available for scripted scenarios.
◆ add_message()
static string gui::add_message |
( |
player_x |
text, |
|
|
string |
|
|
) |
| |
|
static |
Adds message to the players mailboxes. Will be shown in ticker or as pop-up window depending on players preferences.
- Parameters
-
text | Text to be shown. Has to be a translated string or a translatable string. |
- Note
- Only available in scenario mode.
◆ add_message_at()
static string gui::add_message_at |
( |
string |
text, |
|
|
coord3d |
position |
|
) |
| |
|
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.
- Parameters
-
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. |
- Note
- Only available in scenario mode.
◆ book_cash()
void player_x::book_cash |
( |
integer |
delta | ) |
|
Change bank account of player by given amount delta
.
- Parameters
-
◆ generate_goods()
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.
- Parameters
-
from | start position for good |
to | destination position for good |
desc | Good descriptor |
count | Number of goods to generate |
- Return values
-
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) |
◆ load_language_file()
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:
- scenario-name/iso/filename
- scenario-name/en/filename
- scenario-name/filename
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.
- Parameters
-
- Returns
- content of loaded file
- Note
- Only available in scenario mode.
◆ remove_player()
static bool world::remove_player |
( |
player_x |
pl | ) |
|
|
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.
- Parameters
-
- Returns
- whether operation was successful