Page 1 of 1

[Solved] Is the "Grid position" setting of blueprints available?

Posted: Thu Mar 11, 2021 4:14 am
by emlun
Hi! I just released the first version of a mod to help set blueprint grid offsets: https://mods.factorio.com/mod/blueprint-align . As noted in the description, I wasn't able to find the blueprint's "Grid position" setting in the Lua API, only "Grid size" (blueprint_snap_to_grid), "Absolute/Relative" (blueprint_absolute_snapping) and "Absolute X/Y" (blueprint_position_relative_to_grid). So right now I can only align the blueprint correctly if it has "Grid position" set to (0, 0), as I don't know what that is set to and therefore cannot compensate for it.

Is there some way I can read the "Grid position" setting of a blueprint (even better if I can also write to it)? Or can anyone confirm that this setting is not exposed in the mod API?

Re: Is the "Grid position" setting of blueprints available?

Posted: Thu Mar 11, 2021 11:35 am
by ascii
I didn't find the grid position too. So I move all entities to start at 0,0 and modify blueprint with set_blueprint_entities. This way, the grid position is always 0, 0.

Re: Is the "Grid position" setting of blueprints available?

Posted: Sat Mar 13, 2021 12:52 am
by emlun
Oooooh I see, the "Grid position" is an implicit "setting" that translates all the entities! So the "Grid position" is simply the negative of the x-y coordinates of the top-left entity or tile. Awesome, thanks!