Make Simutrans speak your language.

[DONE] Using climate editing tool.

Started by Yona-TYT, September 11, 2016, 04:24:02 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


I would like to use the editing tool weather to mark the Regione automatically using the script, it takes a long time to manually mark the borders.  :-[ 

If someone has another idea to mark borders it is welcome.  ;)


Please try this with r7873:

local ws = world.get_size()
local tool = command_x(tool_set_climate)
local err =, square_x( ws.x/2, 1 ).get_ground_tile(), square_x( ws.x/2, ws.y-1 ).get_ground_tile(), ""+cl_desert)

This code snippet tries to turn one line of the map into desert. It does not work on deep water and on non-empty tiles, but is a start.
Parsley, sage, rosemary, and maggikraut.


I realize that this is a slightly older topic, but posting here as it seems closely connected to what I'm trying to do.

I have built a large "continental style" map and I would like to write a script to set climate formulaically as a function of both elevation and "latitude" (meaning, in this context, the distance from the top of the map).  The game engine itself is only able to base climate on elevation, but I would like to simulate the effect of having colder climates in the northern parts of the map and warmer climates in the south.  Currently I'm doing this using a complicated system of lakes that are disguised as oceans to give the impression of the sea level being in successively warmer climates as you go southwards on the's not entirely satisfactory.   

I think I may be able to adapt the snippet of code provided in this thread to create the formula I want, but it would be really helpful if I could see how the snippet should be used in practice (i.e. how it appears in the context of a working scenario).  Wondering if either Yona or Dwachs could provide an example of this.