Script create_entity with fast_replace should replace belts between undergrounds

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
Theis
Inserter
Inserter
Posts: 27
Joined: Tue Sep 13, 2022 9:57 am
Contact:

Script create_entity with fast_replace should replace belts between undergrounds

Post by Theis »

It would be nice if when using LuaSurface.create_entity to place the second underground belt or pipe to ground, if the transport belts or pipes between the pair were removed.
fast-replace-belt.png
fast-replace-belt.png (408.92 KiB) Viewed 1363 times
Top manual placement, bottom is placement through script.

Why?
It matches the description better
If true, building will attempt to simulate fast-replace building.
It matches the expectation, that when adding the second underground the game cleans up the extra entities.


It is for a TAS run, so simulating player behavior is critical. However i can also see, that i will be one the few people who need it.

Xorimuth
Filter Inserter
Filter Inserter
Posts: 623
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

Re: Script create_entity with fast_replace should replace belts between undergrounds

Post by Xorimuth »

I'd have thought that for a TAS run, player.build_from_cursor would be used. Idk if it has this functionality though.
My mods
Content: Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Remote Configuration | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Script create_entity with fast_replace should replace belts between undergrounds

Post by ssilk »

I’m not sure, if those belts can be removed in any case without breaking something. :)
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

Nidan
Fast Inserter
Fast Inserter
Posts: 227
Joined: Sat Nov 21, 2015 1:40 am
Contact:

Re: Script create_entity with fast_replace should replace belts between undergrounds

Post by Nidan »

ssilk wrote:
Fri Nov 25, 2022 5:18 am
I’m not sure, if those belts can be removed in any case without breaking something. :)
That doesn't matter. When manually placing the second underground belt, factorio will remove the belts in between, if they go in the same direction as the underground belt. OP is asking for the same action but triggered by script to do the same.

But, when trying to act like a player, the removed belts and their content need to go somewhere... Being a player sounds most reasonable:
Xorimuth wrote:
Tue Nov 22, 2022 12:42 pm
I'd have thought that for a TAS run, player.build_from_cursor would be used. Idk if it has this functionality though.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Script create_entity with fast_replace should replace belts between undergrounds

Post by ssilk »

Ah, this belongs to mod requests. Totally overseen. Moved.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

Theis
Inserter
Inserter
Posts: 27
Joined: Tue Sep 13, 2022 9:57 am
Contact:

Re: Script create_entity with fast_replace should replace belts between undergrounds

Post by Theis »

Xorimuth wrote:
Tue Nov 22, 2022 12:42 pm
I'd have thought that for a TAS run, player.build_from_cursor would be used. Idk if it has this functionality though.
I suppose it is worth a try.
I managed to recreate the functionality myself, so it isn't critical to change any more.

Post Reply

Return to “Modding interface requests”