Vetoing the pipette tool
Posted: Sat May 04, 2024 9:26 pm
(long time reader, first time caller)
I am putting together a mod that uses an entity that is composed of a "base" entity and a number of "child" entities that are created and manipulated when the base entity changes. Took a bit but at this point, things work (blueprinting, shift-pasting, copy-paste etc.). Except the pipette. I can hover over one of the secondary entities and press "Q" and the pipette picks those up (and now I hold an item for this entity, something that should not be possible).
Is there a way for me to mark these entities as "can not be picked up by pipette". I still need them to be user selectable (they connect to wires). I was looking int placeable_by to just return the item of my primary entity but now a robot can construct those secondary entities out of the items for the primary which is not what I want.
I looked at some other mods that do similar things (compakt-circuits) and they have the same problem (I can pick up an IO connector with the pipette tool).
Ideally I can either add something to the entity/item that says "don't allow pickup by the pipette tool" or, when I receive the on_player_pipette event, I veto the actual execution of the pipette action.
Or is the answer just "you found a limitation of the engine, just don't do that "
Grateful for any tips/help.
I am putting together a mod that uses an entity that is composed of a "base" entity and a number of "child" entities that are created and manipulated when the base entity changes. Took a bit but at this point, things work (blueprinting, shift-pasting, copy-paste etc.). Except the pipette. I can hover over one of the secondary entities and press "Q" and the pipette picks those up (and now I hold an item for this entity, something that should not be possible).
Is there a way for me to mark these entities as "can not be picked up by pipette". I still need them to be user selectable (they connect to wires). I was looking int placeable_by to just return the item of my primary entity but now a robot can construct those secondary entities out of the items for the primary which is not what I want.
I looked at some other mods that do similar things (compakt-circuits) and they have the same problem (I can pick up an IO connector with the pipette tool).
Ideally I can either add something to the entity/item that says "don't allow pickup by the pipette tool" or, when I receive the on_player_pipette event, I veto the actual execution of the pipette action.
Or is the answer just "you found a limitation of the engine, just don't do that "
Grateful for any tips/help.