Rect condition and action: working with rectangles

Any information about the fun attribute is given here.

Moderator: Plugin Moderators

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

Platform

Plugin Creator

Rect condition and action: working with rectangles

#1

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
746!746Currently using beta 746. 746 What's new? :)
lit trfc lights!!
:)

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

User avatar
FranchuFranchu
Inhabitant of a Country
Reactions:
Posts: 787
Joined: Sun May 28, 2017 0:07
Location: In the blogosphere
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Rect condition and action: working with rectangles

#2

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

That was really necessary for interchange generators
</failedxss>

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

Platform

Re: Rect condition and action: working with rectangles

#3

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 Supercluster
Reactions:
Posts: 3100
Joined: Sun May 28, 2017 1:50
Location: United Mexican States
Plugins: Show
Version: Beta
Phone model: LG H320mb 5.0.1

Plugin Creator

Platform

Re: Rect condition and action: working with rectangles

#4

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...?
I want my diamonds you get the plugins free or not :bd

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

Platform

Re: Rect condition and action: working with rectangles

#5

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

Shouldnt this be in the "fun attribute" section?

User avatar
Lobby
Developer
Reactions:
Posts: 3331
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone model: S7 edge

Platform

Re: Rect condition and action: working with rectangles

#6

Post by Lobby » Tue Feb 05, 2019 19:11

True :)
...Have a nice stay

User avatar
Imran M
Inhabitant of a Conurbation
Reactions:
Posts: 489
Joined: Wed Oct 24, 2018 13:41
Plugins: Show
Phone model: Huawei p8 lite

Platform

Plugin Creator

Re: Rect condition and action: working with rectangles

#7

Post by Imran M » Sat Feb 09, 2019 15:13

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?

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

Platform

Plugin Creator

Re: Rect condition and action: working with rectangles

#8

Post by CommanderABab » Sat Feb 09, 2019 16:47

Yes.
746!746Currently using beta 746. 746 What's new? :)
lit trfc lights!!
:)

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

Post Reply Previous topicNext topic

Return to “Fun attribute”

Who is online

Users browsing this forum: No registered users and 1 guest