![]() In case of error, an error window pops up showing the call stack and the values of local variables. In particular, everything that is print-ed by the script, goes into this file. If simutrans is started in addition with '-log', all the output is written to the file script.log. If simutrans is started with '-debug 2', all errors and warnings are logged to standard output (i.e. This implies for instance that all scenario texts are translated to the server's language. These are due to the fact, that the scripts are solely run on the server, the client does not need to have the script available at all. This affects the classes coord and coord3d as well as any functions that expect coordinates as input, as for instance factory_x::factory_x or rules::forbid_way_tool_rect.Ī lot of stuff is possible for network play. If a player rotates a map, then all coordinates are translated to the original rotation. See factory_x::input for an example.Īll coordinates in the script are with respect to the initial rotation of the map. If tables or arrays carry template parameters, this indicates the expected type of elements of the array or table. These are widely used throughout this documentation in the function declarations. Squirrel has some built-in data types: among them integer, string, tables, and arrays. Icon=Name of cursor object (loaded from some pak-file), used images: 0 = cursor, 1 = icon, 2 = marker imageĬheck out the sections on the Modules page. Menu=Parameter that can be used to load tools with menuconf.tab ![]() Restart=Set to 1 if the virtual machine has to be restarted after each call to the work functions. Tooltip=Tooltip for the icon in the toolbar Title=Name of tool to be shown in tool selection dialog This is a plain text file with the following entries: The script file (tool.nut) as well as the configuration file (description.tab) go into See also Tool interface and Tool only functions. Scenarios can also be put into the addons folder:Īddons/pak-something/scenario/myscenario/ Pak-something/scenario/myscenario/de/ <- German files go here. Pak-something/scenario/myscenario/en/ <- English files go here. If you need more complex texts, these go into sub-directories named after the language, in which they are written. Translation files go into the scenario sub-directory with the same name as your file (just without extension) Pak-something/scenario/myscenario/scenario.nut The pak-set is found in a directory named pak-something, which is in the same directory, where the program itself is located. Hence, the scenario files have to go into a sub-folder of the pak-set. This savegame is tied to the pak-set you are using (e.g. You are the ruler of this toy universe, you are in charge of the rules, which go into the script. That is, create the world in which your scenario will live. Then you have to cast this idea into a savegame. You first need an idea - a vision what a scenario may look like. See also Scenario interface and Scenario only functions. As squirrels like to crack nuts, understandably the script files get the extension '.nut'. The manual can be found at Squirrel main page. ![]() The scripts have to be written in squirrel. ![]()
0 Comments
Leave a Reply. |