Alternative to build_from_cursor with same non-cursor-related features

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
sparr
Smart Inserter
Smart Inserter
Posts: 1501
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Alternative to build_from_cursor with same non-cursor-related features

Post by sparr »

I would like to be able to place an entity in the world with all the same non-cursor-related features and behaviors as build_from_cursor, such as build modes, fast replacing, placing necessary foundation and tile ghosts, adding to the undo stack, setting the last user, etc. I don't want to use build_from_cursor due to viewtopic.php?t=129192 as well as the extra complexity of having to manage the cursor and extra inventories and item stacks.

This might just involve new options for create_entity, or it could be a new method that is somewhere between create_entity and build_from_cursor.
curiosity
Filter Inserter
Filter Inserter
Posts: 657
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Alternative to build_from_cursor with same non-cursor-related features

Post by curiosity »

create_entity already has most of those, if not all. The only things it doesn't do are automagically use the player's cursor's direction (which you can get) and (IIRC) decrement item count in the stack.
sparr
Smart Inserter
Smart Inserter
Posts: 1501
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Alternative to build_from_cursor with same non-cursor-related features

Post by sparr »

curiosity wrote: Tue Jun 10, 2025 8:03 amcreate_entity already has most of those, if not all. The only things it doesn't do
How do you get create_entity to put an ice platform ghost and/or concrete ghost under a new ghost entity on Aquilo when build_from_cursor would do it?
Rseding91
Factorio Staff
Factorio Staff
Posts: 15714
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Alternative to build_from_cursor with same non-cursor-related features

Post by Rseding91 »

sparr wrote: Tue Jun 10, 2025 1:53 pm
curiosity wrote: Tue Jun 10, 2025 8:03 amcreate_entity already has most of those, if not all. The only things it doesn't do
How do you get create_entity to put an ice platform ghost and/or concrete ghost under a new ghost entity on Aquilo when build_from_cursor would do it?
You can't. That feature is exclusive to the player built-from-cursor logic and I don't see it being extracted. Maybe I'm wrong on that - but the person who might know if it's possible is currently busy with bug fixing.
If you want to get ahold of me I'm almost always on Discord.
sparr
Smart Inserter
Smart Inserter
Posts: 1501
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Alternative to build_from_cursor with same non-cursor-related features

Post by sparr »

Another approach to implementing this could be to start from build_from_cursor to make something like build_from_itemstack
sparr
Smart Inserter
Smart Inserter
Posts: 1501
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Alternative to build_from_cursor with same non-cursor-related features

Post by sparr »

PS: This is an XY post. The underlying problem/goal here is to place pipe ghosts on Aquilo with the necessary tiles under them. The broader inquiry into how to solve that sort of problem with that mod is at viewtopic.php?t=129325
protocol_1903
Fast Inserter
Fast Inserter
Posts: 242
Joined: Fri Sep 09, 2022 4:33 pm
Contact:

Re: Alternative to build_from_cursor with same non-cursor-related features

Post by protocol_1903 »

build_from_itemstack would work perfect, for this and other scenarios like it
If you need to reach me, message me on discord.

I make qol mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
If you have a mod idea, I can look into it.
sparr
Smart Inserter
Smart Inserter
Posts: 1501
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Alternative to build_from_cursor with same non-cursor-related features

Post by sparr »

protocol_1903 wrote: Wed Jun 11, 2025 6:01 amfor this and other scenarios like it
Elaborating on other uses cases would probably at least slightly increase the chances of something like this getting implemented.
protocol_1903
Fast Inserter
Fast Inserter
Posts: 242
Joined: Fri Sep 09, 2022 4:33 pm
Contact:

Re: Alternative to build_from_cursor with same non-cursor-related features

Post by protocol_1903 »

... You know I would if I remembered what scenarios I had in mind. Oops.
If you need to reach me, message me on discord.

I make qol mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
If you have a mod idea, I can look into it.
Post Reply

Return to “Modding interface requests”