how do i put the fog of war back on a custom map?

This is the place to share custom user maps, scenarios, and campaigns.
Post Reply
Bobisme
Manual Inserter
Manual Inserter
Posts: 3
Joined: Tue Dec 24, 2019 11:04 am
Contact:

how do i put the fog of war back on a custom map?

Post by Bobisme »

I've created a custom map, all done and ready to share, but when i go to play it it always starts fully revealed, how do i put the fog of war back in?

Thanks :)

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

Re: how do i put the fog of war back on a custom map?

Post by Klonan »

Something like this:

Code: Select all

for k, force in pairs (game.forces) do force.clear_chart() end

Bobisme
Manual Inserter
Manual Inserter
Posts: 3
Joined: Tue Dec 24, 2019 11:04 am
Contact:

Re: how do i put the fog of war back on a custom map?

Post by Bobisme »

Thanks Klonan, i found out how, heh, cheers :)

i went with

/c local surface = game.player.surface
local force = game.player.force
for chunk in surface.get_chunks() do
force.unchart_chunk({x = chunk.x, y = chunk.y}, surface)
end


yours sounds much cleaner :P
hope i used the right one :D

Post Reply

Return to “Maps and Scenarios”