Simutrans-Squirrel-API
|
Functions | |
string | get_about_text (integer pl) |
string | get_debug_text (integer pl) |
string | get_goal_text (integer pl) |
string | get_info_text (integer pl) |
string | get_result_text (integer pl) |
string | get_rule_text (integer pl) |
integer | is_scenario_completed (integer pl) |
void | start () |
The following methods are vital for the functioning of a scripted scenario. They will be called from simutrans to interact with the script. You should consider implementing them.
string get_about_text | ( | integer | pl | ) |
Text shown in the 'About' tab in the scenario info window.
There is a default implementation, which returns concatenation of scenario author, version, short_description. Html-like tags can be used, see get_rule_text.
pl | player number of active player |
string get_debug_text | ( | integer | pl | ) |
Text shown in the 'Debug' tab in the scenario info window. If the method returns null then the 'Debug'-tab will not be shown.
Html-like tags can be used, see get_rule_text.
pl | player number of active player |
string get_goal_text | ( | integer | pl | ) |
Text shown in the 'Goal' tab in the scenario info window.
Html-like tags can be used, see get_rule_text.
pl | player number of active player |
string get_info_text | ( | integer | pl | ) |
Text shown in the 'Info' tab in the scenario info window.
Html-like tags can be used, see get_rule_text.
pl | player number of active player |
string get_result_text | ( | integer | pl | ) |
Text shown in the 'Result' tab in the scenario info window.
Html-like tags can be used, see get_rule_text.
pl | player number of active player |
string get_rule_text | ( | integer | pl | ) |
Text shown in the 'Rules' tab in the scenario info window.
Text can contain several html-like tags:
pl | player number of active player |
integer is_scenario_completed | ( | integer | pl | ) |
Core function of a scenario: It returns the completion percentage for the specified player.
If it returns a negative value the respective player has lost. This state will not be changed even if the function later returns positive values again.
If it returns a value >= 100 then the respective player has won. This state will not be changed even if the function later returns lower values again.
pl | player number of active player |
void start | ( | ) |
This function is called when the scenario starts. Do all the initializations here, as you cannot initialize global variables with non-built-in squirrel types.