Initial Map Scan

This is the place to request new mods or give ideas about what could be done.
Post Reply
Vin
Fast Inserter
Fast Inserter
Posts: 106
Joined: Sat Jun 21, 2014 2:46 pm
Contact:

Initial Map Scan

Post 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.

ratchetfreak
Filter Inserter
Filter Inserter
Posts: 952
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: Initial Map Scan

Post by ratchetfreak »

register a event handler to on_init

That will then scan the map accordingly

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Initial Map Scan

Post 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...
InitialScanfreeplay.zip
(18.21 KiB) Downloaded 190 times
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 :)

Peter34
Smart Inserter
Smart Inserter
Posts: 1100
Joined: Mon Nov 10, 2014 12:44 pm
Contact:

Re: Initial Map Scan

Post 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?

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

Re: Initial Map Scan

Post 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!

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Initial Map Scan

Post 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 :)

Peter34
Smart Inserter
Smart Inserter
Posts: 1100
Joined: Mon Nov 10, 2014 12:44 pm
Contact:

Re: Initial Map Scan

Post 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?

LordFedora
Filter Inserter
Filter Inserter
Posts: 310
Joined: Fri Nov 07, 2014 3:46 am
Contact:

Re: Initial Map Scan

Post by LordFedora »

You can launch the scenario, then save, then load the save in a multiplayer game

Peter34
Smart Inserter
Smart Inserter
Posts: 1100
Joined: Mon Nov 10, 2014 12:44 pm
Contact:

Re: Initial Map Scan

Post 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.

Peter34
Smart Inserter
Smart Inserter
Posts: 1100
Joined: Mon Nov 10, 2014 12:44 pm
Contact:

Re: Initial Map Scan

Post 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?

Peter34
Smart Inserter
Smart Inserter
Posts: 1100
Joined: Mon Nov 10, 2014 12:44 pm
Contact:

Re: Initial Map Scan

Post by Peter34 »

Peter34 wrote:What exactly is the console command?
Okay, it's what Klonan wrote, just with a /c in front of it.

User avatar
Phillip_Lynx
Filter Inserter
Filter Inserter
Posts: 541
Joined: Mon Jul 21, 2014 6:00 pm
Contact:

Re: Initial Map Scan

Post 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]

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Initial Map Scan

Post 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

Post Reply

Return to “Ideas and Requests For Mods”