Rect condition and action: working with rectangles

Learn here how to create and use plugins.

Moderator: Plugin Moderators

User avatar
CommanderABab
AB
Reactions:
Posts: 6853
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Rect condition and action: working with rectangles

Post by CommanderABab » Wed Aug 29, 2018 23:50

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
587587Currently using beta 587. 587 What's new? :)
bus routes are supposed to be fixed!!
:cry:

Telegram - t.me/
🆎️🆎️🆎️🆎️Commander🆎️🆎️

User avatar
FranchuFranchu
Inhabitant of a Country
Reactions:
Posts: 769
Joined: Sun May 28, 2017 0:07
Location: Retrophrenology
Plugins: Show
Version: Beta

Re: Rect condition and action: working with rectangles

Post by FranchuFranchu » Thu Aug 30, 2018 0:11

That was really necessary for interchange generators
Currently Conlanging

......Affirmative=Positive=True=Yeah=Yes=OK=K=Potassium=K=0°K=-237°C

ElephantEthan
Inhabitant of a Megacity
Reactions:
Posts: 299
Joined: Sun Aug 26, 2018 14:07
Plugins: Show

Re: Rect condition and action: working with rectangles

Post by ElephantEthan » Thu Aug 30, 2018 6:17

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

User avatar
Mg3094066
Inhabitant of a Galaxy Cluster
Reactions:
Posts: 2963
Joined: Sun May 28, 2017 1:50
Location: United Mexican States
Plugins: Show
Version: Beta
Phone model: LG H320mb 5.0.1

Re: Rect condition and action: working with rectangles

Post by Mg3094066 » Thu Aug 30, 2018 6:46

Umm... This may be related with reaction...
Can I program a building to react with a disaster?
Idk a sound...?
Making Ice cubes intead of pee since... yesterday :'v

User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 1835
Joined: Thu Jul 07, 2016 22:50
Location: 'Merica
Plugins: Show
Version: Beta
Phone model: Moto Z Force Droid

Re: Rect condition and action: working with rectangles

Post by KINGTUT10101 » Sat Dec 22, 2018 7:28

Shouldnt this be in the "fun attribute" section?

Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”

Who is online

Users browsing this forum: No registered users and 1 guest