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.

Utilities
6 months ago
1.1
1.11K

b ✅ Crash while building rails

10 months ago
(updated 10 months ago)

I noticed that the shotgun was having trouble building curved rails, it seemed to delete the single tile of track between two curved rails in a circle, but I couldn't reproduce it very well.

So I copied a 90 degree corner and pasted it a few times in a row. While building those ghosts, I got the following crash:

Error while running event blueprint-shotgun::on_tick (ID 0)
__blueprint-shotgun__/scripts/build/entity-ghosts.lua:76: attempt to index local 'entity' (a nil value)
stack traceback:
    __blueprint-shotgun__/scripts/build/entity-ghosts.lua:76: in function '?'
    __blueprint-shotgun__/scripts/flying-items.lua:23: in function 'on_tick'
    __blueprint-shotgun__/control.lua:171: in function <__blueprint-shotgun__/control.lua:169>

There was a single tree marked for deconstruction in the way of one of the curved rails, but other than that nothing obvious that would be causing an issue. The only ghosts are the curved rails and straight rails between.

10 months ago

I've started investigating this just now, and I've found out two things:
1. The API is just straight up broken when it comes to curved rails, it's not checking if they collide correctly even though I'm giving it all the relevant info. I'm guessing this is because curved rails uniquely have two collision boxes instead of one.
2. It thinks the single diagonal rail segments would be colliding with something, even though there's nothing there, and I have no idea what to do to fix it. This also might have something to do with the fact that it's connected to curved rails on both sides.

I made it not crash and spill the item(s) when it fails to build the ghost in 0.0.2, but I'm not sure if there's anything I can do to actually fix this currently.
I'll make a bug report and hopefully this gets resolved soon, because I know manual rail building gets pretty tedious. It sucks that the mod doesn't quite work with them fully yet.

9 months ago

As it turns out, there's another way to check if entities can be placed with the API, so I've swapped over to using that instead. I knew it existed, but for some reason forgot about it when making the mod initially (oops) because the methods are so similar. This should be fixed in 0.0.5, let me know if there's any other problems, and thanks for the report.

New response