Page 1 of 1
Initial Map Scan
Posted: Mon Aug 31, 2015 1:05 pm
by Vin
Recently I've been starting a lot of new games, messing around with different plans for the early game and such. Instead of running around checking starting areas to see if I want to keep them, I've been using the console to reveal a 128x128 tile grid (around double the starting area) around me, without moving. The idea is that before landing, the player character did a scan of the landing zone to see if it is a suitable area to build a factory. Having this functionality done automatically as an "Initial Scan Mod" or something similar would be somewhat interesting. I'm just not sure how to implement it.
Re: Initial Map Scan
Posted: Mon Aug 31, 2015 1:42 pm
by ratchetfreak
register a event handler to on_init
That will then scan the map accordingly
Re: Initial Map Scan
Posted: Mon Aug 31, 2015 2:21 pm
by Klonan
Vin wrote:Recently I've been starting a lot of new games, messing around with different plans for the early game and such. Instead of running around checking starting areas to see if I want to keep them, I've been using the console to reveal a 128x128 tile grid (around double the starting area) around me, without moving. The idea is that before landing, the player character did a scan of the landing zone to see if it is a suitable area to build a factory. Having this functionality done automatically as an "Initial Scan Mod" or something similar would be somewhat interesting. I'm just not sure how to implement it.
You can write your own custom scenario, and inpu the chart_map function into the control.lua...
In fact i just wrote up a scenario for you quickly...
Just extract into your scenario folder, and when the game starts it will chart the specified area.
The code for area scanned is in the control file, and looks like this:
Code: Select all
function chart_map()
game.forces.player.chart(game.surfaces.nauvis,{{-128, -128}, {128, 128}})
end
If you'd like to reveal more area, just increase those value

Re: Initial Map Scan
Posted: Mon Aug 31, 2015 11:23 pm
by Peter34
Klonan wrote:You can write your own custom scenario, and inpu the chart_map function into the control.lua...
In fact i just wrote up a scenario for you quickly...
InitialScanfreeplay.zip
Can this be used in coop MP games?
Re: Initial Map Scan
Posted: Mon Aug 31, 2015 11:30 pm
by Vin
ratchetfreak wrote:register a event handler to on_init
That will then scan the map accordingly
Klonan wrote:<snip> custom scenario </snip>
Thank you both!
Re: Initial Map Scan
Posted: Tue Sep 01, 2015 12:22 am
by Klonan
Peter34 wrote:Klonan wrote:You can write your own custom scenario, and inpu the chart_map function into the control.lua...
In fact i just wrote up a scenario for you quickly...
InitialScanfreeplay.zip
Can this be used in coop MP games?
Yep totally. I havent tested it, but there is absolutely no reason that it shouldn't work.
Vin wrote:
Thank you both!
No problem at all

Re: Initial Map Scan
Posted: Tue Sep 01, 2015 2:12 am
by Peter34
Klonan wrote:Peter34 wrote:an this be used in coop MP games?
Yep totally. I havent tested it, but there is absolutely no reason that it shouldn't work.
Cool, but how exactly do I set up a scenario-based MP game? I'm used to just using the "New Game" option. Is there a way to play a scenario in MP?
Re: Initial Map Scan
Posted: Tue Sep 01, 2015 2:14 am
by LordFedora
You can launch the scenario, then save, then load the save in a multiplayer game
Re: Initial Map Scan
Posted: Tue Sep 01, 2015 2:30 am
by Peter34
LordFedora wrote:You can launch the scenario, then save, then load the save in a multiplayer game
Okay.
Would be nicer to have a mod for it, though.
Re: Initial Map Scan
Posted: Tue Sep 01, 2015 6:06 am
by Peter34
Vin wrote:Recently I've been starting a lot of new games, messing around with different plans for the early game and such. Instead of running around checking starting areas to see if I want to keep them, I've been using the console to reveal a 128x128 tile grid (around double the starting area) around me, without moving. The idea is that before landing, the player character did a scan of the landing zone to see if it is a suitable area to build a factory. Having this functionality done automatically as an "Initial Scan Mod" or something similar would be somewhat interesting. I'm just not sure how to implement it.
What exactly is the console command?
Re: Initial Map Scan
Posted: Tue Sep 01, 2015 6:11 am
by Peter34
Peter34 wrote:What exactly is the console command?
Okay, it's what Klonan wrote, just with a /c in front of it.
Re: Initial Map Scan
Posted: Tue Sep 01, 2015 6:13 am
by Phillip_Lynx
Peter34 wrote:...
What exactly is the console command?
I think (slightly modifyed the quote below)
Klonan wrote:...
Code: Select all
/c game.forces.player.chart(game.surfaces.nauvis,{{-128, -128}, {128, 128}})
...
[edit]
Ninjaed by the questioner

[/edit]
Re: Initial Map Scan
Posted: Tue Sep 01, 2015 12:32 pm
by Klonan
Peter34 wrote:LordFedora wrote:You can launch the scenario, then save, then load the save in a multiplayer game
Okay.
Would be nicer to have a mod for it, though.
Ok i posted it up as a mod:
https://forums.factorio.com/forum/vie ... 92&t=15434