Page 1 of 1

Prototype property to make an item not place ghosts when holding shift

Posted: Wed Nov 25, 2020 7:43 am
by raiguard
I would like to request a prototype property for items (perhaps a flag?) that will change the behavior for that item so holding shift will not trigger ghost building. My usecase is a really hacky one: I am using a selection tool with a place_result to detect the cursor position while dragging. I would like to be able to change the behavior of the drag when holding shift.

I can do this now by setting the player-creation flag on the entity that the selection tool is placing, but placing the entity as a ghost has several unsolvable and/or annoying problems:

- The ghost cursor icon shows up
- The ghost build sound plays when an entity is placed
- Smoke is generated when the entity is placed (this can probably be fixed by changing the smoke definition, but what a pain...)

The simplest solution would be for it to simply not place ghosts when holding shift. I can detect a shift-build during on_pre_build, so I don't need to rely on ghosts to know if they're holding it.

Thank you!
2020-11-25 00_42_06-Factorio 1.1.1.png
2020-11-25 00_42_06-Factorio 1.1.1.png (1.54 KiB) Viewed 459 times