Page 1 of 1

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

Posted: Tue Dec 24, 2019 12:02 pm
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 :)

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

Posted: Tue Dec 24, 2019 12:32 pm
by Klonan
Something like this:

Code: Select all

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

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

Posted: Tue Dec 24, 2019 12:45 pm
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