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: 11086
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Rect condition and action: working with rectangles

#1

Post 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

User avatar
FranchuFranchu
Inhabitant of a Country
Reactions:
Posts: 799
Joined: 28 May 2017, 00:07
Location: Freezing in Argentina
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Rect condition and action: working with rectangles

#2

Post by FranchuFranchu »

That was really necessary for interchange generators

User avatar
ElephantEthan
Inhabitant of a Megacity
Reactions:
Posts: 294
Joined: 26 Aug 2018, 14:07
Plugins: Showcase Store

Platform

Re: Rect condition and action: working with rectangles

#3

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

User avatar
Mg3094066
Inhabitant of a Supercluster
Reactions:
Posts: 3223
Joined: 28 May 2017, 01:50
Location: Venezuelan Republic of Mexico
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Rect condition and action: working with rectangles

#4

Post by Mg3094066 »

Umm... This may be related with reaction...
Can I program a building to react with a disaster?
Idk a sound...?

User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 2220
Joined: 07 Jul 2016, 22:50
Location: 'Merica
Plugins: Showcase Store
Version: Beta
Contact:

Plugin Creator

Platform

Re: Rect condition and action: working with rectangles

#5

Post by KINGTUT10101 »

Shouldnt this be in the "fun attribute" section?

User avatar
Lobby
Developer
Reactions:
Posts: 3705
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

Re: Rect condition and action: working with rectangles

#6

Post by Lobby »

True :)

User avatar
Imran M
Inhabitant of a Country
Reactions:
Posts: 844
Joined: 24 Oct 2018, 13:41
Plugins: Showcase Store

Plugin Creator

Platform

Re: Rect condition and action: working with rectangles

#7

Post 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?

User avatar
CommanderABab
AB
Reactions:
Posts: 11086
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Rect condition and action: working with rectangles

#8

Post by CommanderABab »

Yes.

User avatar
CERRERA
Townsman
Reactions:
Posts: 48
Joined: 25 Jan 2020, 06:19
Location: Philippines
Plugins: Showcase Store
Version: Beta
Contact:

Plugin Creator

Platform

Re: Rect condition and action: working with rectangles

#9

Post by CERRERA »

Lobby wrote:
05 Feb 2019, 19:11
True :)

Hello
Reac
Can make Fun conditions can <..> separated fun attribute?

For example

Code: Select all    Reset

{Hi im fun template Action 👉} {Hi im seperate fun 1 condition if 👉✅ my result 🌝} {Hi im seperate fun 2 condition if 👉✅ my result 🌚}
JSON checker
Check
Or

Code: Select all    Reset

{Hi im fun template i remove building if ✅} {Hi im separate fun 1 if building was remove i build 🌝} {Hi im separate fun 2 if building was remove i build 🌚}
JSON checker
Check
If any of these 2 are possible how can i do that?

Post Reply Previous topicNext topic

Return to “Fun attribute”