"skip x" and "skip y" attributes for rect action/condition

Share your ideas about possible future content here.

Good?

YESSS!
3
33%
Yes
2
22%
Not sure
2
22%
No
2
22%
NOOOoOO!
0
No votes
 
Total votes: 9

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

"skip x" and "skip y" attributes for rect action/condition

#1

Post by FranchuFranchu »

The code:

Code: Select all

"actions":[{
"type":"rect",
"w":9,
"h":9,
"skip x":3,
"skip y":3,
"inner":[{
"type":"build",
"id":"$whatever"
}]
}]
Should have this result:
Attachments
Aneva_18-09-01_19.00.16.png

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

Platform

Re: "skip x" and "skip y" attributes for rect action/condition

#2

Post by ElephantEthan »

I don't think this is needed, it's easy enough to do with "build".

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

Plugin Creator

Platform

Re: "skip x" and "skip y" attributes for rect action/condition

#3

Post by CommanderABab »


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: "skip x" and "skip y" attributes for rect action/condition

#4

Post by Mg3094066 »

wut?

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

Platform

Re: "skip x" and "skip y" attributes for rect action/condition

#5

Post by Lobby »

I agree, this could have been a useful feature, but there are a lot of potential features like this one and it's hard to add each one of them manually.

Therefore I would recommend to use :lua: nowadays. This might look like

Code: Select all

local function buildRect(draft, x, y, width, height, stepx, stepy)
  stepx = stepx or 1
  stepy = stepy or 1
  for oy=0,height-1,stepy do
    for ox=0,width-1,stepx do
      if Builder.isBuildingBuildable(draft, x + ox, y + oy) then
        Builder.buildBuilding(draft, x + ox, y + oy)
      end
    end
  end
end

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

Plugin Creator

Platform

Re: "skip x" and "skip y" attributes for rect action/condition

#6

Post by CommanderABab »

You could also use a 3x3 building that when built removes itself and builds the 9 tiles in the pattern shown.

Post Reply Previous topicNext topic

Return to “Suggestions”