Blueprint Shotgun


Adds a gun that shoots items to build ghosts, upgrade entities, and more! Also features a vacuum mode to mine entities, tiles, and ground items. An alternative to nanobots or other early bot start mods.

Utilities
28 days ago
1.1 - 2.0
5.32K
Blueprints

b BP Shotgun places multiple entities in the same location

a month ago

I've run into a few instances where using the BP shotgun alongside bots can lead to multiple instances of the same entity being placed in the same square.

I'm guessing that this occurs when the shotgun is fired, then a bot places the entity, then the fired entity is placed.

I've seen this happen with insterters as well as with furnaces and assemblers.

a month ago

Unfortunately there's not much I can really do about that, you're correct that it's happening when you shoot to build but a bot gets there first.

I still want people to be able to construct things that have a bot on the way, because the bot could be far away or the player wants to get rid of some of the stuff in their inventory, etc.

There's no way to tell what bot is on the way without doing some heavy entity polling, and I don't think it's worth dragging the performance of the whole mod down by trying to fix something this small.

Luckily the shotgun can pick up ground items in the vacuum mode, or I'm pretty sure any items dropped by the mod's failsafes are marked for deconstruction so bots can come clean up afterward.

a month ago

To clarify, I'm seeing multiple entities in the same location, ie: 9 insterters on top of each other. I can send you a save file if you'd like.

I think there are a few ways to address this which won't kill performance:
- Remove the delay between firing and placing the entity. An "instant" build mode wouldn't be as fun to watch but would probably solve the issue.
- Limit which entities or tiles can be placed, eg: only landfill and belts
- Check the ghost's state with is_registered_for_construction() and don't try to build them.

I don't have a good development environment set up at the moment, but I'll see if I can send you a PR.

a month ago

That's odd, because this mod doesn't ever create entities, it only revives an entity ghost that already exists. If a bot gets there first, the ghost becomes invalid in Lua, and the mod spills the item when it gets there. If you can show me a reliable way to reproduce it I'll fix it myself, as I don't want the mod to do any of those things you listed as a potential solution.

New response