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

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 451
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

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

Post 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 448 times
Don't forget, you're here forever.

Post Reply

Return to “Modding interface requests”