Initial Scan deprecated

by Klonan

This mod scans around the starting area when you start a new game

Utilities
8 years ago
0.13 - 0.14
12

i When should the scan say that it is finished

8 years ago

Must say that I love this mod it is really good for checking out the new terrain and working out if I really want to invest time in a specific map :)
However it did bug me a little when it would announce that it had finished, but it had not!

So I modified my copy to announce that it had finished after it had finished.
Only a slight modification to your if statement is required

[code]
Scan_size = 32 --Scan size in chunks

script.on_event(defines.events.on_player_created, function(event)
if event.player_index == 1 then
script.on_event(defines.events.on_tick, function(event)
local player = game.players[1]
local f = player.force
local s = player.surface
local z = (Scan_size/2)+1
for k = 6,z do
if event.tick ==((k^2)24) - 1060 then
if k < z then
f.chart(s, {{-32k, -32k}, {32k, 32k}})
s.daytime = 0.9
---[[
if k == (z-1) then
for k, p in pairs(game.players) do
p.print("Initial Map Scan is Almost complete")
end
end
--]]
else
script.on_event(defines.events.on_tick, nil)
script.on_event(defines.events.on_player_created, nil)
Scan_size = nil
for k, p in pairs(game.players) do
p.print("Initial Map Scan is complete")
end
end
end
end
end)
end
end)
[/code]

8 years ago

Ahh! I hope they put the functions of the main forum into the mod forum, cause that really looks yuck :P

8 years ago

Thanks, if i update the mod i will tweak it so the scan is after it finishes