[MOD 0.12.11+] Initial Map Scan

Topics and discussion about specific mods
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5301
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

[MOD 0.12.11+] Initial Map Scan

Post by Klonan »

Updated to 0.13: https://mods.factorio.com/mods/Klonan/InitialScan

This mod is simple dimple, people requested it.

This scans the map when you start a game.

set Chunks_To_Scan to any value you'd like, i have it set to 6, which is just bigger than a medium starting area i think... anyway let me know what you all think, suggestions, comments feedback etc.

Update: I have changed it so scan sized is based on starting area size, you can set a custom size if you'd like.

Mod spotlight by Xterminator
Attachments
InitialScan_0.1.3.zip
--Updated for 0.12.11
--Added forces and surfaces support
(1.01 KiB) Downloaded 4404 times
InitialScan_0.1.2.zip
Fixed crash if starting area size was 'none'
(1008 Bytes) Downloaded 680 times
InitialScan_0.1.1.zip
-- Matched scan size to starting area size
(1007 Bytes) Downloaded 278 times
InitialScan_0.1.0.zip
(910 Bytes) Downloaded 277 times
Last edited by Klonan on Thu Oct 22, 2015 5:56 am, edited 4 times in total.
Vin
Fast Inserter
Fast Inserter
Posts: 106
Joined: Sat Jun 21, 2014 2:46 pm
Contact:

Re: [MOD 0.12.x] Initial Map Scan

Post by Vin »

First, thanks for the mod!

Second - would it be possible to read mapgen settings and set the default initial reveal to equal the starting area? It doesn't sound like something that would be that simple, but I figured I'd ask. Then if people want to reveal more or less they can change the code themselves.
Last edited by Vin on Tue Sep 01, 2015 2:50 pm, edited 1 time in total.
Peter34
Smart Inserter
Smart Inserter
Posts: 1100
Joined: Mon Nov 10, 2014 12:44 pm
Contact:

Re: [MOD 0.12.x] Initial Map Scan

Post by Peter34 »

I'm curious about exactly how big the various starting area size types are. Any way one of you guys can find out, by diving into the game's data files?

And thanks to Klonan for making this mod so quickly! He's a really cool guy!
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5301
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [MOD 0.12.x] Initial Map Scan

Post by Klonan »

Vin wrote:First, thanks for the mod!

Second - would it be possible to read mapgen settings and set the default initial reveal to equal the starting area? It doesn't sound like something that would be that simple, but I figured I'd ask. Then if people want to reveal more or less they can change the code themselves.

No problem! it was easy enough to write up and i learnt some stuff about remote.interfaces ;)

Second, i've been reading up on the lua documentation and other stuff, but i cant find any easy simple way to read the value in the game, so im afraid for now you will have to manually set the size :[
Peter34 wrote:I'm curious about exactly how big the various starting area size types are. Any way one of you guys can find out, by diving into the game's data files?

And thanks to Klonan for making this mod so quickly! He's a really cool guy!
I read the starting sizes from This post on reddit and used that to determine the scan area

And thanks :D
Vin
Fast Inserter
Fast Inserter
Posts: 106
Joined: Sat Jun 21, 2014 2:46 pm
Contact:

Re: [MOD 0.12.x] Initial Map Scan

Post by Vin »

The only idea I have regarding reading mapgen settings is if you could somehow read the map exchange key from inside the game or on the initial game load. That contains the map gen settings which would give you the very small, small, medium, etc. and then you could change the scan reveal based on that information.

If you can't read the exchange key from inside the game, maybe someone could make a post in modding interface requests about it?
User avatar
DaCyclops
Long Handed Inserter
Long Handed Inserter
Posts: 85
Joined: Mon Aug 25, 2014 12:37 am
Contact:

Re: [MOD 0.12.x] Initial Map Scan

Post by DaCyclops »

FYI, you can read the map settings in LUA.

Code: Select all

game.surfaces["nauvis"].map_gen_settings
Check it out. For the starting area value, you can use

Code: Select all

game.surfaces["nauvis"].map_gen_settings.starting_area
It will return "none", "very-small", "small", "medium", "big", or "very-big" and you can use that to dynamically choose the scan distance.
(I dont actually know what sizes those match to, but its a start)
User avatar
lilstrip
Fast Inserter
Fast Inserter
Posts: 194
Joined: Fri Aug 07, 2015 5:01 pm
Contact:

Re: [MOD 0.12.x] Initial Map Scan

Post by lilstrip »

Error while running the event handler: __InitialScan__/control.lua:12: The specified surface doesn't have chart.

I get this error when loading the map
Peter34
Smart Inserter
Smart Inserter
Posts: 1100
Joined: Mon Nov 10, 2014 12:44 pm
Contact:

Re: [MOD 0.12.x] Initial Map Scan

Post by Peter34 »

lilstrip wrote:Error while running the event handler: __InitialScan__/control.lua:12: The specified surface doesn't have chart.

I get this error when loading the map
When loading a save game? But the mod is supposed to trigger only once per game, when you first start the game.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5301
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [MOD 0.12.x] Initial Map Scan

Post by Klonan »

lilstrip wrote:Error while running the event handler: __InitialScan__/control.lua:12: The specified surface doesn't have chart.

I get this error when loading the map
Hi, you will need to update to at least 12.5 if you want to use the mod, sorry i thought the bug wouldn't occur, but it was fixed in 12.5+
DaCyclops wrote:FYI, you can read the map settings in LUA.

Code: Select all

game.surfaces["nauvis"].map_gen_settings
Check it out. For the starting area value, you can use

Code: Select all

game.surfaces["nauvis"].map_gen_settings.starting_area
It will return "none", "very-small", "small", "medium", "big", or "very-big" and you can use that to dynamically choose the scan distance.
(I dont actually know what sizes those match to, but its a start)
THANKS this is exactly what i needed! The mod has been updated
Peter34
Smart Inserter
Smart Inserter
Posts: 1100
Joined: Mon Nov 10, 2014 12:44 pm
Contact:

Re: [MOD 0.12.5+] Initial Map Scan

Post by Peter34 »

So you now know the size of VS, Small, Normal, Large and VL starting areas, in tiles? If you do, please share them.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5301
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [MOD 0.12.5+] Initial Map Scan

Post by Klonan »

Peter34 wrote:So you now know the size of VS, Small, Normal, Large and VL starting areas, in tiles? If you do, please share them.
I don't... i just guessed :P
LordFedora
Filter Inserter
Filter Inserter
Posts: 310
Joined: Fri Nov 07, 2014 3:46 am
Contact:

Re: [MOD 0.12.5+] Initial Map Scan

Post by LordFedora »

Peter34 wrote:So you now know the size of VS, Small, Normal, Large and VL starting areas, in tiles? If you do, please share them.
Klonan wrote:
I read the starting sizes from This post on reddit and used that to determine the scan area
Klonan wrote: I don't... i just guessed :P
LIES
Peter34
Smart Inserter
Smart Inserter
Posts: 1100
Joined: Mon Nov 10, 2014 12:44 pm
Contact:

Re: [MOD 0.12.5+] Initial Map Scan

Post by Peter34 »

If it's the same ReEddit post that I read some weeks ago, then the figures in that are just guesswork.

Nevertheless, Klonan's mod is very nice. It's tiny and does just one thing, but it does it very well, which is exactly how I like my Factorio mods to (usually) be.
waduk
Filter Inserter
Filter Inserter
Posts: 372
Joined: Tue Feb 10, 2015 5:44 pm
Contact:

Re: [MOD 0.12.5+] Initial Map Scan

Post by waduk »

Mod broken in 0.12.11
Vin
Fast Inserter
Fast Inserter
Posts: 106
Joined: Sat Jun 21, 2014 2:46 pm
Contact:

Re: [MOD 0.12.5+] Initial Map Scan

Post by Vin »

waduk wrote:Mod broken in 0.12.11
In line 4 of control.lua, change

Code: Select all

game.on_event
to

Code: Select all

script.on_event
for running 0.12.11.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5301
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [MOD 0.12.11+] Initial Map Scan

Post by Klonan »

mod has been updated
Factorio2016
Fast Inserter
Fast Inserter
Posts: 136
Joined: Wed Dec 23, 2015 1:17 pm
Contact:

Re: [MOD 0.12.11+] Initial Map Scan

Post by Factorio2016 »

You can do so after removing the fog from the map he was returning? Why?
So I don't have to run around the starting area. To ensure that the necessary resources nearby.
---
Removing the fog from the map can only be top-down? In all four directions from the center?
English is not my native language. Translator.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5301
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [MOD 0.12.11+] Initial Map Scan

Post by Klonan »

Factorio2016 wrote:You can do so after removing the fog from the map he was returning? Why?
So I don't have to run around the starting area. To ensure that the necessary resources nearby.
---
Removing the fog from the map can only be top-down? In all four directions from the center?
Image
Koub
Global Moderator
Global Moderator
Posts: 7863
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: [MOD 0.12.11+] Initial Map Scan

Post by Koub »

Factorio2016 wrote:You can do so after removing the fog from the map he was returning? Why?
So I don't have to run around the starting area. To ensure that the necessary resources nearby.
---
Removing the fog from the map can only be top-down? In all four directions from the center?
If I understand correctly, you want to be able to use the mod to see if you start in a good position, then put back fog of war to "discover" the map as you play. Right ?
Koub - Please consider English is not my native language.
Factorio2016
Fast Inserter
Fast Inserter
Posts: 136
Joined: Wed Dec 23, 2015 1:17 pm
Contact:

Re: [MOD 0.12.11+] Initial Map Scan

Post by Factorio2016 »

:D :lol:
Yes right, sorry I don't speak English. [the imperfection of machine translation systems]
I want the fog back on the map. No need to run around the starting area.
The ability to see available resources and enemy bases around.
English is not my native language. Translator.
Post Reply

Return to “Mods”