meta data for this page
Console / Ingame Lua Editor
The ingame Lua editor is a fully functional scripting tool that allows you to test small pieces of code, or to debug your mods by printing some variables.
In update 8, we have added some
Console commands that are aimed at normal players e.g. for adding money or changing daytime.
Starting the in-game editor
First, press the
Backspace key on your keyboard (
Rück-Taste for German users), and select the wrench tool in the menu.
Afterwards, select the
Scripting tab and enter any command you want into the in-game lua editor. Afterwards, press
Run at the bottom of the window.
In the following, you will find a list of commands that can be executed from the Ingame Lua Editor.
Use this command to set the daytime to
8.5 in this example, which will be 8:30 clock. You can of course also use this command with different daytimes.
You can change the latitude to any value between -90 and +90 degrees. It will affect the maximum altitude of the sun in-game.
Returns the currently active weather.
Get all possible weather situations
Returns a list of all possible weather situations.
Sets the weather to the weather situation
snowy1. Please use
Console.getWeatherSituations() to find out which weather situations are available in your savegame.
Important: The weather will only come into effect once you leave the ingame editor, i.e. hit
Set weather with given duration
This will activate
snowy1 for a duration of exactly 4 hours in-game. For any value for
duration larger than 120, the game will think you specified it in seconds.
Set weather with given duration that starts later
Console.setWeather("snowy1", 4, true)
This will activate
snowy1 after the currently active weather situation ends. Please check out the two sections if you need more information on
Snow System Overrides
A great advantage of the ingame lua editor is that you can trigger events like extreme snowfall. Check out the following functions to modify the current snow situation.
Adds up to
0.5 metres in snow height. The value will be scaled according to snowing info layer.
Important: Snow height is effectively limited by the snowing info layer, i.e. putting in large values here will not make any difference.
0.5 metres in snow height. You can also use this together with high values to remove all snow on your map.
Use this command to speed up the hardening of slopes, i.e. slopes will immediately become freezed and do not wear out as fast as otherwise.
Eco-system related functions
The in-game lua editor is also very convenient for cheating or tuning the eco-system. Check out following functions:
Pretty straightforward: Adds € 5,000 (or any other specified value) to your account balance.
Sets your account balance to exactly € 150,000 (or any other specified value).
Adds a revenue of € 5,000 (in contrast to
Console.addMoney, which will behave more like an investor).
Set credit limit
Sets the credit limit to € 500,000 (or any other specified value). The player can then take loans until this limit is reached.
WRS employs a double-entry bookkeeping system for the eco systems (roughly the same as in real-life companies, but a bit simplified of course). Sometimes it can happen that the double-entries don't fit together, i.e. that the left hand side of the balance sheet is not the same as the right-hand side.
Console.fixAccounting() fixes any issues like this.
Clear eco system
Use this if you want to release your savegame as map. You will keep all vehicles, ropeways, slopes, etc. but the eco system will be prepared for a new player:
- Any debts/loans will be paid back.
- Credit limit will be set back to € 200,000
- Accounting system will be fixed
- The player's account balance (cash) will be set to € 150,000
We highly recommend to call this command before sharing your map. If you want your players to have more money, you can use