Page 1 of 1

Please give us some Lua hooks for the radars

Posted: Thu Jul 31, 2025 12:24 pm
by Maoman
I would like the ability to read_scan_progress (and ideally set_scan_progress as well), read_target_sector, set_target_sector, and read_max_range for a mod idea that I have that I believe players would appreciate: manually setting the radar's next sector to scan to a point that you click on the map, so long as it is within range of at least one radar. This would allow you to scan a specific fogged chunk of the map early, or to re-scan an already explored chunk to update it and check on the progress of biters or your outpost or stuff like that. It would read progress to next sector in order to choose the radar that is closest to finishing its next scan, to minimize wait time.

I think I could make the mod work with as little as just set_target_sector if I had to, but having all the above hooks will make it work smoother and much easier to implement.

Re: Please give us some Lua hooks for the radars

Posted: Thu Jul 31, 2025 12:35 pm
by Maoman
Okay I'm done editing the post now lol. Sorry for all the rapid-fire tiny changes.

Re: Please give us some Lua hooks for the radars

Posted: Sun Aug 03, 2025 7:38 pm
by Rseding91
The target chunk is computed at the time the radar finishes consuming enough energy to be ready to scan a chunk.

It goes over the chunks in range nearest-first and finds the first chunk not scanned, or the oldest scanned chunk and then scans that one. So there is no "target chunk" except at the tick it goes to scan one.

I could expose that logic - so you can ask it the chunk it would scan if it happened to scan that exact moment - but even that won't be perfect since between asking and it updating another radar, or anything else - might have already scanned the chunk found last time it ran the logic.