Author Topic: [DONE] Using climate editing tool.  (Read 903 times)

0 Members and 1 Guest are viewing this topic.

Offline Yona-TYT

[DONE] Using climate editing tool.
« on: September 11, 2016, 04:24:02 PM »

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.  ;)




« Last Edit: September 17, 2016, 10:46:43 AM by Dwachs »

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4235
  • Total likes: 169
  • Helpful: 149
  • Languages: EN, DE, AT
Re: [Script] Using climate editing tool.
« Reply #1 on: September 11, 2016, 07:09:41 PM »
Please try this with r7873:

Code: [Select]
local ws = world.get_size()
local tool = command_x(tool_set_climate)
local err = tool.work(player_x(1), 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.

Offline Yona-TYT

Re: [Script] Using climate editing tool.
« Reply #2 on: September 11, 2016, 08:25:17 PM »
Thank you again !  :thumbsup: :thumbsup: :thumbsup:

Offline Yona-TYT

Re: [Script] Using climate editing tool.
« Reply #3 on: September 12, 2016, 10:30:51 AM »
Very nice.  ;D

Offline Andyh

Re: [DONE] Using climate editing tool.
« Reply #4 on: January 04, 2017, 08:53:12 AM »
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 map...it'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.