Page 1 of 1

Rect condition and action: working with rectangles

Posted: Wed Aug 29, 2018 23:50
by CommanderABab
Show
Introduced in 473:
🛠Line action
🛠Rect condition and action
🛠Fix palm trees and cacti had auto build set to true
Within a function:
Show
condition

Code: Select all

{"type":"rect","w":10,"h":4,"min":1,"max":9999,"inner":[{...}]}
checks if the inner condition occurs ≥ min times and ≤ max times.
Show
action
similar, it executes the inner actions for each of the specified tiles:

Code: Select all

"actions":[{"type":"rect","w":4,"h":3,"inner":[{...},...]}]
Show
example action

Removing a 4x4 tile area and zoning it dense industrial:

Code: Select all

  "actions":
    [
      {"type":"rect","w":4,"h":4,"inner":
        [
          {"type":"remove"},
          {"type":"build","id":"$zoneindustrial_lvl2"}
        ]
      }
    ]
Does it work? Does it need more?
Try it and see.
Credits: Lobby

Re: Rect condition and action: working with rectangles

Posted: Thu Aug 30, 2018 0:11
by FranchuFranchu
That was really necessary for interchange generators

Re: Rect condition and action: working with rectangles

Posted: Thu Aug 30, 2018 6:17
by ElephantEthan
Thank you posting this here, I found a discussion about actions and conditions in a certain radiuses and I was about to ask for that to be moved here. :)

Re: Rect condition and action: working with rectangles

Posted: Thu Aug 30, 2018 6:46
by Mg3094066
Umm... This may be related with reaction...
Can I program a building to react with a disaster?
Idk a sound...?

Re: Rect condition and action: working with rectangles

Posted: Sat Dec 22, 2018 7:28
by KINGTUT10101
Shouldnt this be in the "fun attribute" section?

Re: Rect condition and action: working with rectangles

Posted: Tue Feb 05, 2019 19:11
by Lobby
True :)

Re: Rect condition and action: working with rectangles

Posted: Sat Feb 09, 2019 15:13
by Imran M
Wait, so it make 4x4 rectangle, inner means the space inside it, actions are what it will do inside it? Is this a correct way of putting it?

Re: Rect condition and action: working with rectangles

Posted: Sat Feb 09, 2019 16:47
by CommanderABab
Yes.