Page 1 of 1

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

Posted: Thu Aug 31, 2017 4:46 pm
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: .

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

Posted: Thu Aug 31, 2017 5:49 pm
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.

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

Posted: Fri Sep 01, 2017 5:49 am
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.

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

Posted: Fri Sep 08, 2017 1:55 pm
by kovarex
The decision was made to not allow fast replace from ghost with different direction.

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

Posted: Sun Sep 10, 2017 9:31 pm
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?

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

Posted: Mon Sep 11, 2017 6:08 pm
by kovarex
rebuilding doesn't cancel circuit connection.