Rect condition and action: working with rectangles

Any information about the fun attribute is given here.
Previous topicNext topic
User avatar
CommanderABab
AB
Reactions:
Posts: 11311
Joined: 07 Jun 2016, 19:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Rect condition and action: working with rectangles

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
my avatar:
User avatar
FranchuFranchu
Inhabitant of a Country
Reactions:
Posts: 799
Joined: 27 May 2017, 22:07
Location: Freezing in Argentina
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Rect condition and action: working with rectangles

Post by FranchuFranchu »

That was really necessary for interchange generators
Did you know you can't blink while smiling :) ?
User avatar
ElephantEthan
Inhabitant of a Megacity
Reactions:
Posts: 294
Joined: 26 Aug 2018, 12:07
Plugins: Showcase Store

Platform

Re: Rect condition and action: working with rectangles

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: 3222
Joined: 27 May 2017, 23:50
Location: Venezuelan Republic of Mexico
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Rect condition and action: working with rectangles

Post by Mg3094066 »

Umm... This may be related with reaction...
Can I program a building to react with a disaster?
Idk a sound...?
I threw my dignity to trash and downloaded Free Fire... But someway i liked it ":'D

But i think it was too early to celebrate... my internet runs at 8kb...

Just wait another month... :bb
User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 2228
Joined: 07 Jul 2016, 20:50
Location: 'Merica
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Rect condition and action: working with rectangles

Post by KINGTUT10101 »

Shouldnt this be in the "fun attribute" section?
User avatar
Lobby
Inhabitant of a Supercluster
Reactions:
Posts: 3771
Joined: 26 Oct 2008, 10:34
Plugins: Showcase Store

Re: Rect condition and action: working with rectangles

Post by Lobby »

True :)
User avatar
Imran M
Inhabitant of a Country
Reactions:
Posts: 843
Joined: 24 Oct 2018, 11:41
Plugins: Showcase Store

Plugin Creator

Platform

Re: Rect condition and action: working with rectangles

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?
I just love the DOPE-amine you get after completing a plugin!
User avatar
CommanderABab
AB
Reactions:
Posts: 11311
Joined: 07 Jun 2016, 19:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Rect condition and action: working with rectangles

Post by CommanderABab »

Yes.
my avatar:
User avatar
CERRERA
Townsman
Reactions:
Posts: 48
Joined: 25 Jan 2020, 04:19
Location: Philippines
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Rect condition and action: working with rectangles

Post by CERRERA »

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

Hello
Reac
Can make Fun conditions can triggered 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?
Everything you can imagine is real
Previous topicNext topic