⚠️ 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
5 days ago
1.1 - 2.1
17.6K
Combat

b Crash unexcluding turrets mid game

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

Error while running event SearchlightAssault::on_tick (ID 0)
Index out of inventory bounds.
stack traceback:
    [C]: in function '__index'
    __SearchlightAssault__/sl-util.lua:382: in function 'CopyItems'
    __SearchlightAssault__/sl-util.lua:411: in function 'CopyTurret'
    __SearchlightAssault__/control-tunion.lua:216: in function 'AmplifyRange'
    __SearchlightAssault__/control-tunion.lua:299: in function 'CheckAmmoElectricNeeds'
    __SearchlightAssault__/control.lua:257: in function <__SearchlightAssault__/control.lua:251>

STR:

Add turrets to the exclusion list
Start a game
Place searchlight and excluded turrets
Open settings - clear exclusion list

Since the option is in the map settings, I assume it should be save to edit mid-game.

a month ago

Thanks for reporting this, I'll try to get a fix out after work tomorrow

a month ago

I wasn't able to reproduce this with the vanilla entities, would you happen to be able to send me your save file?

Otherwise, I can try to add some defensive coding and just hope it solves the issue.

Either way, I found another bug I can fix where turrets which were boosted, then added to an exclusion list stay disabled by script after being unboosted by the exclusion. If I don't hear from you by the end of the weekend I'll go with the defensive coding and push the other fix with it.

a month ago
(updated a month ago)

I've have some issues with the internet, so my answers may be slow.

Retested again
Found a missing step:
Searchlight should target an enemy (so be in boosting state)

If searchlight is just idle - no crash
If boosting - constant crash (3/3 so far)

May provide a save file, but I have like 200+ other mods enabled, so it may complicate things...

My current repro:
1. Install universal sandbox mod & editor extensions
2. Set exclusion list for searchlight:
Full:
- gun-turret;flamethrower-turret;melta-turret;minigun-turret-hd;crossbow-120mm-mortar;artillery-turret;tesla-turret
Enough to do a crash:
- gun-turret
3. Start game as Editor extensions testing scenario (auto enables cheat mod and a few other preapplied QoL)
4. Give you a searchlight and a gun turret (I'm just picking it from craft menu, but maybe it is craft to cursor mods work)
5. place, so turret in range
6. Press editor extensions toolbar button
7. Navigate to entites (assembler icon above) -> enemies (biter nest icon below)
8. Place biter nest (far enough to not agro, but within searchlight range)
9. Wait till searchlight will spot enemy (or edit its angle&ranges to force it faster)
10. Once spoted - go to mod setting and clear exclusion string
11. Observe crash on pressing resume button

a month ago

Thanks for the steps, I really appreciate how thorough this is.
Unfortunately, it's about the same as the process I used when I posted Tuesday, so I still wasn't able to reproduce the crash.

I went ahead and tried implementing the defensive coding option and the other bugfix I mentioned.
You can find version 2.3.27 which has these fixes here if they're not already showing up in the mod portal: https://mods.factorio.com/mod/SearchlightAssault/downloads

If you're still seeing issues, please upload your save file. 200+ mods isn't an issue, I've dealt with bigger before, trust me 👍

Thanks again for your bug report!

15 days ago
(updated 15 days ago)

Luckily, I haven't updated any mods for some time now.
Luckily x2, I was in a debug session when reproducing it.

Soooo
Looks like it is the other-other mod's changes that lead to the observed crash.
Ammo Auto Loader Configurator
My turrets have 2 ammo slots, but in AmplifyRange function there is no references to prototype (that I suspect was changed by that mod).
So as far as I see, boosted entity was created with a single slot in output inventory (assuming as per default behaviour of create_entity), and since CopyItems reads inventory by index - there is out of bounds that was observed.

Here is my save to verify, in case I've missed something else.
https://drive.google.com/file/d/1cWW_PPJVm1hs2vL0G_-ECc0O0mLATZNy/view?usp=drive_link

15 days ago

Ahhh I see, yeah. If that's happening, it's possible one of those mods is being naughty and doing things in a data stage it possibly should have been doing sooner
https://lua-api.factorio.com/latest/auxiliary/data-lifecycle.html#prototype-stage

Nonetheless, I might be able to fix this on my end. I'll try to take a look as I have time after work.

15 days ago

Seems like my version 2.3.27 has stopped the initial crash you reported, at least on my computer, but I noticed that the Turret Blacklist mod is crashing when turrets are boosted...

Error while running event Turret-Blacklist::on_gui_opened (ID 104)
Gui element with name turret-blacklist-frame already present in the parent element.
stack traceback:
[C]: in function 'add'
Turret-Blacklist/control.lua:30: in function <Turret-Blacklist/control.lua:27>

I'll try to look into this more over the week, too, and talk to the other mod author if it's something that can only be fixed on their end.

11 days ago

Thanks, my appreciations

5 days ago

Okay, I finally got a day to breathe and could take a better look at everything.
I've just uploaded version 2.3.28 which should have compatibility fixes for everything.

If you notice any further issues, please let me know, and thanks again for your save file, it was very helpful!

New response