Allow construction-bots to fast-replace

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 513
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

Allow construction-bots to fast-replace

Post by Mylon »

I have written a mod that looks for yellow belts and places red belt ghosts under them. Unfortunately construction bots go the ghost and stay there forever rather than place the red belts!

I would like for construction bots to be able to fast-replace these belts, much in the same way they already can swap bricks and concrete where they lay down the new one and pick up the old one.

In a related note, I would like the ability to call surface.can_place_entity{name="entity-ghost" ...} and have it return true if inner_name matches one of the occupying's entity's fast-replace, this would simplify it by allowing usage of can_place_entity instead of keeping track of where ghosts have been placed.

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

Re: Allow construction-bots to fast-replace

Post by ssilk »

Hm. Moved from Suggestions to Modding interface requests.

PS: You know this mods:
https://mods.factorio.com/mods/Klonan/upgrade-planner
and
https://mods.factorio.com/mods/NearlyDu ... on-planner
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 513
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

Re: Allow construction-bots to fast-replace

Post by Mylon »

I was able to take the code in my concreep mod and changing just a couple lines turn it into a belt replacer. At the moment I have to deconstruct then place a ghost which is very disruptive.

I'm not quite sure how Klonan's mod works, but it let me know to replace both sides of the underground belt!

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1190
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Allow construction-bots to fast-replace

Post by Mooncat »

Mylon wrote:I was able to take the code in my concreep mod and changing just a couple lines turn it into a belt replacer. At the moment I have to deconstruct then place a ghost which is very disruptive.

I'm not quite sure how Klonan's mod works, but it let me know to replace both sides of the underground belt!
It does the same thing. Just check its code and you will see something interesting. 8-)

Code: Select all

  for k, *beep*_tree in pairs (player.surface.find_entities_filtered({area = area, type = "tree"})) do
    *beep*_tree.order_deconstruction(player.force)
  end
:lol: :lol: :lol: :lol: :lol: :lol:

Post Reply

Return to “Modding interface requests”