Simutrans Programm r11794
Loading...
Searching...
No Matches
Simutrans Programm

Simutrans

Simutrans Code Documentation

License

Simutrans is licensed under the Artistic License version 1.0. The Artistic License 1.0 is an OSI-approved license which allows for use, distribution, modification, and distribution of modified versions, under the terms of the Artistic License 1.0. For the complete license text see LICENSE.txt.

Simutrans paksets (which are necessary to run the game) have their own license, but no one is included alongside this code.

autotoc_md5

squirrel Scripting language

The scripts have to be written in squirrel. The manual can be found at Squirrel main page. As squirrels like to crack nuts, understandably the script files get the extension '.nut'.

Scripted scenarios

....

How to create a scenario.

You first need an idea - a vision what a scenario may look like. Then you have to cast this idea into a savegame. That is, create the world in which your scenario will live. You are the ruler of this toy universe, you are in charge of the rules, which go into the script.

Recommended directory structure

The scenario plays in a savegame. This savegame is tied to the pak-set you are using (e.g. pak64, pak128.Britain). Hence, the scenario files have to go into a sub-folder of the pak-set. The pak-set is found in a directory named pak-something, which is in the same directory, where the program itself is located or under user-directory/addons/.

Your scenario file goes into the folder

pak-something/scenario/myscenario/

Scenarios can also be put into the addons folder:

addons/pak-something/scenario/myscenario/

Scripted AI players

....

Recommended directory structure

Your script file goes into the folder

ai/myai/

The main script file must be

ai/myai/ai.nut

The ai scripts can also be put into

addons/ai/myai/

Scripted tools

....

Recommended directory structure

The script file (tool.nut) as well as the configuration file (description.tab) go into

pak-something/tool/mytool/

Related pak-files have to be placed in

pak-something/

Check out the sections on the Modules page.