Add chunk.area to the chunk

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Add chunk.area to the chunk

Post by darkfrei »

Hi devs!

Link: https://lua-api.factorio.com/latest/Lua ... rator.html

Can you please add chunk.area for chunks? The direct area call is really helpful:

Code: Select all

for chunk in some_surface.get_chunks() do
  game.print("area: " .. serpent.line (chunk.area))
end
Where the area is a BoundingBox https://lua-api.factorio.com/latest/Con ... oundingBox
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Add chunk.area to the chunk

Post by eradicator »

+1

There's no official documentation on how to convert ChunkPosition to BoundingBox, so providing an official implmenetation means new modders don't have to "guess" how to convert between the two formats.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Add chunk.area to the chunk

Post by Bilka »

Okay, added for the next version.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Add chunk.area to the chunk

Post by eradicator »

Bilka wrote: Mon Aug 26, 2019 3:12 pm Okay, added for the next version.
Thanks for this and the area in on_chunk_generated!
(The forum is still missing a simley to show appropriate gratitude.)
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Post Reply

Return to “Implemented mod requests”