Currently (v1.1.35) there is no way to read/write the "Grid position" setting of blueprints from lua (on LuaItemStack). Could we get this feature?
There is an older forum post on this topic viewtopic.php?f=28&t=96815 marked "solved", but it only describes only a workaround.
Set "Grid position" of blueprints
-
- Inserter
- Posts: 38
- Joined: Fri Jun 11, 2021 5:20 pm
- Contact:
Re: Set "Grid position" of blueprints
Grid position doesn't really exist. It gets calculated from the entity positions. And when you change it in the blueprint GUI, entities are shifted.
-
- Inserter
- Posts: 38
- Joined: Fri Jun 11, 2021 5:20 pm
- Contact:
Re: Set "Grid position" of blueprints
Oh, so to change the "grid position" I would edit the positions of all the blueprint entities.
A get/set_grid_position still could be useful, though.
But even if not implemented, at least the grid position behavior should be documented somewhere.
A get/set_grid_position still could be useful, though.
But even if not implemented, at least the grid position behavior should be documented somewhere.
Re: Set "Grid position" of blueprints
Please tell us if you can get it to work that way or not, I'm curious and would like to know in case I have to do the same in a possible future mod!
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Set "Grid position" of blueprints
I don't really understand what exactly "grid position" is supposed to be. Is it just a way of saying "not centered on the red flag"? In Eradicator's Belt Planner I successfully managed to put a blueprint of the current preview into the players hands without it visually changing position. So it's definetly possible.
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.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
- NotRexButCaesar
- Smart Inserter
- Posts: 1133
- Joined: Sun Feb 16, 2020 12:47 am
- Contact:
Re: Set "Grid position" of blueprints
Grid position is just an offset from the cursor when placing the blueprint. The change is completely visual.eradicator wrote: ↑Thu Jul 22, 2021 6:53 pm I don't really understand what exactly "grid position" is supposed to be. Is it just a way of saying "not centered on the red flag"?
Ⅲ—Crevez, chiens, si vous n'étes pas contents!
Re: Set "Grid position" of blueprints
If both are possible then I would like to know both. 1. Moving entities without moving flag. This was possible before flag. I guess this is what your mod does.eradicator wrote: ↑Thu Jul 22, 2021 6:53 pmI don't really understand what exactly "grid position" is supposed to be. Is it just a way of saying "not centered on the red flag"?
2. Moving flag, changing the flag offset numbers. Players can do it in gui. Can a mod read and write these numbers?
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
Re: Set "Grid position" of blueprints
As I said, grid position doesn't physically exist. "The flag" does not physically exist. You can trivially offset grid position by offsetting every entity. The flag position is calculated, AFAICT, in some way from blueprint dimensions. It shouldn't be hard to reverse engineer it if you so desire.Qon wrote: ↑Thu Jul 22, 2021 7:51 pm If both are possible then I would like to know both. 1. Moving entities without moving flag. This was possible before flag. I guess this is what your mod does.
2. Moving flag, changing the flag offset numbers. Players can do it in gui. Can a mod read and write these numbers?
I have already put a request into the docs thread to document it, and linked to this thread. I'm sure this thread will be moved to one of the three processed forums when that is done.