Please give us some Lua hooks for the radars

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
Maoman
Inserter
Inserter
Posts: 37
Joined: Sat Nov 12, 2016 10:55 am
Contact:

Please give us some Lua hooks for the radars

Post 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.
Last edited by Maoman on Thu Jul 31, 2025 12:41 pm, edited 1 time in total.
User avatar
Maoman
Inserter
Inserter
Posts: 37
Joined: Sat Nov 12, 2016 10:55 am
Contact:

Re: Please give us some Lua hooks for the radars

Post by Maoman »

Okay I'm done editing the post now lol. Sorry for all the rapid-fire tiny changes.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15922
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Please give us some Lua hooks for the radars

Post 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.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Modding interface requests”