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

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
emlun
Burner Inserter
Burner Inserter
Posts: 11
Joined: Fri Sep 21, 2018 9:56 pm
Contact:

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

Post 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?
Last edited by emlun on Sat Mar 13, 2021 12:52 am, edited 1 time in total.

ascii
Manual Inserter
Manual Inserter
Posts: 1
Joined: Thu Mar 11, 2021 11:29 am
Contact:

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

Post 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.

emlun
Burner Inserter
Burner Inserter
Posts: 11
Joined: Fri Sep 21, 2018 9:56 pm
Contact:

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

Post 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!

Post Reply

Return to “Modding interface requests”