⚠️ SearchlightAssault ⚠️


Adds a game map and searchlights which sweep for foes at great range, alerting you while directing adjacent turrets to snipe spotted foes. Designed to dovetail with the early-mid game, searchlights provide: - Circuit network interfaces for search & detection I/O - Incentive to automate lamp & combinator production in the early game - New tactics to assault biter bases without leap-frogging turrets!

Content
10 days ago
1.1 - 2.0
12.8K
Combat

g Error while running event on built entity

11 months ago
(updated 11 months ago)

I placed a blueprint with 4 searchlights, then was going to add the turrets manually so they get auto filled with ammo and whenever I place the rampant shotgun turrets I get this report, was working fine for a while and then started throwing the error every time

The mod ⚠️ SearchlightAssault ⚠️ (2.2.16) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event SearchlightAssault::on_built_entity (ID 6)
SearchlightAssault/control-tunion.lua:396: attempt to index local 'g' (a nil value)
stack traceback:
SearchlightAssault/control-tunion.lua:396: in function 'IsBoostableAndInRange'
SearchlightAssault/control-tunion.lua:407: in function 'CreateRelationship'
SearchlightAssault/control-tunion.lua:305: in function 'TurretAdded'
SearchlightAssault/control.lua:447: in function <SearchlightAssault/control.lua:433>

10 months ago
(updated 10 months ago)

I've got the same problem with placing blueprints. It appears to have something to do with blueprints being automatically placed by nonplayer entities. I've managed to trigger this error with bots, and with the ghostplacer mod. I tested removing the "searchlight signal interface" object that gets created when you create a blueprint, but that didn't prevent the problem from happening. It appears to have something do with the search light being placed first, then a ghost turret being placed within range of the searchlight. But there's also some combination of searchlight settings or maybe rotation/flips that cause the bug to trigger. It's possibly also related to a separate but minor bug with how searchlight settings are lost when undoing a deletion of a searchlight, or how if you copy/paste a set of searchlights with different settings, they'll all get set to the same exact setting.

I haven't been able to narrow down the problem, but this specific blueprint consistently causes the bug. It has a set of searchlights that are angled at different angles, to prevent nests from jamming up against corners. It fairly consistently causes the bug if you build the blueprint with bots.

Blueprint string:
0eNrtmsFu2zgQhl+l0NkqRI5ISX6MvexhERS0QycEJMqgqCRG4HevZLe1HFDhDHvoYXuMY37zi5x/yBH9nu3aUR+dsT7bvmdm39sh2/73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Gwi/Oq3Lh9WX4lVGtcuF1YciFOfQ6f8t/OSOIEnjUKYKS54egl6uUCrGo4uEKUf9uhbiL8LdC/N8qxLz8fyvEH6gQD5vr75C2i19AbbJWTa3h9Nk/19vsL/9er4JeJvtde8CalVXDq5oDE/PJ5js/Uv51

10 months ago

Thanks for the comprehensive report.

It might be a while before I can get a solution, but this will make it so much easier!

10 months ago
(updated 10 months ago)

If you still can't find a fix, I've figured out a sloppy way to work around the bug, after running into the issue a bunch of times. Basically, blueprint your turret wall without the searchlights, then paste them in afterwards. It's not ideal, but at least it keeps the game from crashing.

I'm also playing with Rampant, so it's nearly impossible to completely clear biters within 100 tiles of the wall. I'm usually building my wall within searchlight range of the biters, which causes the searchlights to change state from safe->warning->firing immediately after they're placed, but while the rest of the blueprint is being built. That might be part of the issue, which would make it difficult to reproduce in the testing lab without enemies.

I've had to find a half-decent solution to this issue, because the The Ghostplacer mod is really good at triggering the bug, because it makes it easy to place down objects in a random=ish order by quickly moving your mouse over the blueprint. Bots always build the farthest away blueprints first, which means they don't usually trigger the bug if you're building your wall from the inside and the searchlights are on the interior side. Now that I have tons of fast bots and I don't need to use the ghostplacer mod to build walls while under biter attacks, I haven't run into the issue anymore.

New response