[posila] [0.17.59] Fog of war does not work
Posted: Sun Jul 28, 2019 6:43 pm
Only extracting raw materials from smelting furnaces of another force should be invisible.
www.factorio.com
https://forums.factorio.com/
Code: Select all
-- /silent-command circle_add( game.players[ 1 ] )
-- /silent-command circle_change( game.players[ 1 ] )
-- /silent-command circle_remove( game.players[ 1 ] )
function initialize_forces()
game.create_force( 'force_player_one' )
game.create_force( 'force_player_two' )
end
local table_of_colors = { squad = { r = 75, g = 155, b = 45 }, team = { r = 65, g = 120, b = 200 }, enemy = { r = 190, g = 55, b = 50 }, neutral = { r = 77, g = 77, b = 77 }, damage = { r = 255, g = 0, b = 255 }, white = { r = 255, g = 255, b = 255 } }
function circle_add( player )
player.force = game.forces.force_player_one
if global.table_of_circles == nil then global.table_of_circles = {} end
if global.table_of_circles[ player.index ] == nil then
-- local one = rendering.draw_circle( { target = player.character, target_offset = { x = 0, y = - 2.5 }, force = game.forces.force_player_one, surface = player.surface, color = table_of_colors.team, radius = 0.2, filled = true, only_in_alt_mode = false } )
-- local two = rendering.draw_circle( { target = player.character, target_offset = { x = 1, y = - 2.5 }, force = game.forces.force_player_two, surface = player.surface, color = table_of_colors.enemy, radius = 0.2, filled = true, only_in_alt_mode = false } )
local one = rendering.draw_circle( { target = player.position, force = game.forces.force_player_one, surface = player.surface, color = table_of_colors.team, radius = 3, filled = true, only_in_alt_mode = false } )
local two = rendering.draw_circle( { target = { x = player.position.x + 80, y = player.position.y }, force = game.forces.force_player_two, surface = player.surface, color = table_of_colors.enemy, radius = 3, filled = true, only_in_alt_mode = false } )
global.table_of_circles[ player.index ] = { one = one, two = two }
end
end
function circle_change( player )
if global.table_of_circles[ player.index ] ~= nil then
local one = global.table_of_circles[ player.index ].one
local two = global.table_of_circles[ player.index ].two
end
end
function circle_remove( player )
if global.table_of_circles[ player.index ] ~= nil then
rendering.destroy( global.table_of_circles[ player.index ].one )
rendering.destroy( global.table_of_circles[ player.index ].two )
global.table_of_circles[ player.index ] = nil
end
end