[kovarex] [0.15.33] Self-replacable entity revive in on_put_item

Bugs that are actually features.
Post Reply
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

[kovarex] [0.15.33] Self-replacable entity revive in on_put_item

Post by eradicator »

Symptom:
If an entity that is fast-replacable by itself (i.e. inserters, belts, mining drills) is .revive()'d in defines.events.on_put_item in a different rotation, then during the following fast replace the entity loses it's circuit network cables.

Background:
I was trying to write a small script that properly preserves entity settings (circuit conditions/connections, recipe, rotation, etcpp) when the player "manually revives" a ghost by building the same structure on top of a ghost.
Code
Reproduction:
1) Build e.g two inserters/belts and connect them with a circuit cable
2) Make a blueprint of them and place those two ghosts somewhere
3) Build an inserter on top of one of the ghosts but revive the ghost in on_put_item (e.g. using above code). Take care to hold the inserter on the cursor in a different rotation than the ghost.
4) The ghost is revived and immediately fast-replaced by itself, losing it's circuit connection but keeping circuit settings

Addendum
Everything works fine btw if you build the inserter in the same direction as the ghost, as then it can not fast-replace itself. Things that are not self-replacable are not affected either because the actual build event just fails.

Expected Behavior
Ideally the fast-replacing would be canceld so that rotation can be preserved as well :roll:... fine, i just want it to keep the cables. Unless this whole functionality has already been secretly integrated into 0.16 :geek: .
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Bilka
Factorio Staff
Factorio Staff
Posts: 3170
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [0.15.33] Self-replacable entity revive in on_put_item

Post by Bilka »

eradicator wrote: Expected Behavior
Ideally the fast-replacing would be canceld so that rotation can be preserved as well
Please no, fast rotating by fast replacing inserters/belts is one of the core functions that make placing belts not incredibly tedious. Without that you would either have to mine every single entity and place it again (not preserving circuit network settings) or press r/shift + r on each entity up to 2 times. Please preserve the circuit wires instead.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [kovarex] [0.15.33] Self-replacable entity revive in on_put_item

Post by eradicator »

@Bilka:
Err, that was obviously meant to only cancel when there was reviving going on, and - as marked by the smiley - was half-jokingly because i didn't actually expect that to happen.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [kovarex] [0.15.33] Self-replacable entity revive in on_put_item

Post by kovarex »

The decision was made to not allow fast replace from ghost with different direction.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [kovarex] [0.15.33] Self-replacable entity revive in on_put_item

Post by eradicator »

kovarex wrote:The decision was made to not allow fast replace from ghost with different direction.
Maybe i'm understanding that wrong, but this bug report wasn't concerning fast-replacing ghosts. It's concerning ghosts that were revived before being fast-replaced and should thus be normal entities. If you need me to describe this in more details please give me a hint?
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [kovarex] [0.15.33] Self-replacable entity revive in on_put_item

Post by kovarex »

rebuilding doesn't cancel circuit connection.

Post Reply

Return to “Not a bug”