Page 1 of 2

[MOD 0.12.11+] Initial Map Scan

Posted: Tue Sep 01, 2015 12:31 pm
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

Re: [MOD 0.12.x] Initial Map Scan

Posted: Tue Sep 01, 2015 12:57 pm
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.

Re: [MOD 0.12.x] Initial Map Scan

Posted: Tue Sep 01, 2015 2:46 pm
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!

Re: [MOD 0.12.x] Initial Map Scan

Posted: Tue Sep 01, 2015 3:26 pm
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

Re: [MOD 0.12.x] Initial Map Scan

Posted: Tue Sep 01, 2015 3:33 pm
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?

Re: [MOD 0.12.x] Initial Map Scan

Posted: Wed Sep 02, 2015 1:30 am
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)

Re: [MOD 0.12.x] Initial Map Scan

Posted: Wed Sep 02, 2015 2:31 am
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

Re: [MOD 0.12.x] Initial Map Scan

Posted: Wed Sep 02, 2015 9:09 am
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.

Re: [MOD 0.12.x] Initial Map Scan

Posted: Wed Sep 02, 2015 12:25 pm
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

Re: [MOD 0.12.5+] Initial Map Scan

Posted: Wed Sep 02, 2015 1:25 pm
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.

Re: [MOD 0.12.5+] Initial Map Scan

Posted: Wed Sep 02, 2015 2:16 pm
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

Re: [MOD 0.12.5+] Initial Map Scan

Posted: Thu Sep 03, 2015 2:06 am
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

Re: [MOD 0.12.5+] Initial Map Scan

Posted: Thu Sep 03, 2015 9:42 pm
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.

Re: [MOD 0.12.5+] Initial Map Scan

Posted: Sun Oct 18, 2015 2:04 am
by waduk
Mod broken in 0.12.11

Re: [MOD 0.12.5+] Initial Map Scan

Posted: Mon Oct 19, 2015 4:31 am
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.

Re: [MOD 0.12.11+] Initial Map Scan

Posted: Thu Oct 22, 2015 5:56 am
by Klonan
mod has been updated

Re: [MOD 0.12.11+] Initial Map Scan

Posted: Fri Mar 04, 2016 7:23 pm
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?

Re: [MOD 0.12.11+] Initial Map Scan

Posted: Fri Mar 04, 2016 7:29 pm
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

Re: [MOD 0.12.11+] Initial Map Scan

Posted: Sat Mar 05, 2016 9:10 am
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 ?

Re: [MOD 0.12.11+] Initial Map Scan

Posted: Sat Mar 05, 2016 9:36 am
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.