mirror of
https://github.com/Oarcinae/FactorioScenarioMultiplayerSpawn.git
synced 2025-03-05 14:45:19 +02:00
Minor changes to spacing of shared items. Adding more combinators for signal monitoring.
This commit is contained in:
parent
fc5b6b2a50
commit
788a2fc304
@ -703,11 +703,11 @@ function SendPlayerToNewSpawnAndCreateIt(delayedSpawn)
|
|||||||
|
|
||||||
-- Shared electricity IO pair of scripted electric-energy-interfaces
|
-- Shared electricity IO pair of scripted electric-energy-interfaces
|
||||||
SharedEnergySpawnIOPair(player,
|
SharedEnergySpawnIOPair(player,
|
||||||
{x=delayedSpawn.pos.x+x_dist, y=delayedSpawn.pos.y-15},
|
{x=delayedSpawn.pos.x+x_dist, y=delayedSpawn.pos.y-28},
|
||||||
{x=delayedSpawn.pos.x+x_dist, y=delayedSpawn.pos.y+15})
|
{x=delayedSpawn.pos.x+x_dist, y=delayedSpawn.pos.y+29})
|
||||||
rendering.draw_text{text="Attach to power generation to share.",
|
rendering.draw_text{text="Attach to power generation to share.",
|
||||||
surface=game.surfaces[GAME_SURFACE_NAME],
|
surface=game.surfaces[GAME_SURFACE_NAME],
|
||||||
target={x=delayedSpawn.pos.x+x_dist-4, y=delayedSpawn.pos.y-18},
|
target={x=delayedSpawn.pos.x+x_dist-4, y=delayedSpawn.pos.y-31},
|
||||||
color={0.6,0.6,0.6,0.8},
|
color={0.6,0.6,0.6,0.8},
|
||||||
scale=1,
|
scale=1,
|
||||||
font="scenario-message-dialog",
|
font="scenario-message-dialog",
|
||||||
@ -718,7 +718,7 @@ function SendPlayerToNewSpawnAndCreateIt(delayedSpawn)
|
|||||||
only_in_alt_mode=false}
|
only_in_alt_mode=false}
|
||||||
rendering.draw_text{text="Attach to electric grid to draw power.",
|
rendering.draw_text{text="Attach to electric grid to draw power.",
|
||||||
surface=game.surfaces[GAME_SURFACE_NAME],
|
surface=game.surfaces[GAME_SURFACE_NAME],
|
||||||
target={x=delayedSpawn.pos.x+x_dist-4, y=delayedSpawn.pos.y+16},
|
target={x=delayedSpawn.pos.x+x_dist-4, y=delayedSpawn.pos.y+30},
|
||||||
color={0.6,0.6,0.6,0.8},
|
color={0.6,0.6,0.6,0.8},
|
||||||
scale=1,
|
scale=1,
|
||||||
font="scenario-message-dialog",
|
font="scenario-message-dialog",
|
||||||
@ -729,16 +729,16 @@ function SendPlayerToNewSpawnAndCreateIt(delayedSpawn)
|
|||||||
only_in_alt_mode=false}
|
only_in_alt_mode=false}
|
||||||
|
|
||||||
-- Input Chests
|
-- Input Chests
|
||||||
for i=-11,-6 do
|
for i=-22,-17 do
|
||||||
SharedChestsSpawnInput(player, {x=delayedSpawn.pos.x+x_dist, y=delayedSpawn.pos.y+i})
|
SharedChestsSpawnInput(player, {x=delayedSpawn.pos.x+x_dist, y=delayedSpawn.pos.y+i})
|
||||||
end
|
end
|
||||||
-- Tile arrows to help indicate
|
-- Tile arrows to help indicate
|
||||||
CreateTileArrow(game.surfaces[GAME_SURFACE_NAME], {x=delayedSpawn.pos.x+x_dist-4, y=delayedSpawn.pos.y-9}, "RIGHT")
|
CreateTileArrow(game.surfaces[GAME_SURFACE_NAME], {x=delayedSpawn.pos.x+x_dist-4, y=delayedSpawn.pos.y-20}, "RIGHT")
|
||||||
CreateTileArrow(game.surfaces[GAME_SURFACE_NAME], {x=delayedSpawn.pos.x+x_dist+1, y=delayedSpawn.pos.y-9}, "LEFT")
|
CreateTileArrow(game.surfaces[GAME_SURFACE_NAME], {x=delayedSpawn.pos.x+x_dist+1, y=delayedSpawn.pos.y-20}, "LEFT")
|
||||||
--Helpful ground text
|
--Helpful ground text
|
||||||
rendering.draw_text{text="Place items in to share.",
|
rendering.draw_text{text="Place items in to share.",
|
||||||
surface=game.surfaces[GAME_SURFACE_NAME],
|
surface=game.surfaces[GAME_SURFACE_NAME],
|
||||||
target={x=delayedSpawn.pos.x+x_dist-4, y=delayedSpawn.pos.y-12},
|
target={x=delayedSpawn.pos.x+x_dist-4, y=delayedSpawn.pos.y-23},
|
||||||
color={0.7,0.7,0.1,0.7},
|
color={0.7,0.7,0.1,0.7},
|
||||||
scale=1,
|
scale=1,
|
||||||
font="scenario-message-dialog",
|
font="scenario-message-dialog",
|
||||||
@ -750,10 +750,20 @@ function SendPlayerToNewSpawnAndCreateIt(delayedSpawn)
|
|||||||
|
|
||||||
|
|
||||||
-- Combinators for monitoring items in the network.
|
-- Combinators for monitoring items in the network.
|
||||||
|
SharedChestsSpawnCombinators(player,
|
||||||
|
{x=delayedSpawn.pos.x+x_dist-1, y=delayedSpawn.pos.y-2}, -- Ctrl
|
||||||
|
{x=delayedSpawn.pos.x+x_dist-1, y=delayedSpawn.pos.y}, -- Status
|
||||||
|
{x=delayedSpawn.pos.x+x_dist-1-1, y=delayedSpawn.pos.y}) -- Pole
|
||||||
SharedChestsSpawnCombinators(player,
|
SharedChestsSpawnCombinators(player,
|
||||||
{x=delayedSpawn.pos.x+x_dist, y=delayedSpawn.pos.y-2}, -- Ctrl
|
{x=delayedSpawn.pos.x+x_dist, y=delayedSpawn.pos.y-2}, -- Ctrl
|
||||||
{x=delayedSpawn.pos.x+x_dist, y=delayedSpawn.pos.y}, -- Status
|
{x=delayedSpawn.pos.x+x_dist, y=delayedSpawn.pos.y}, -- Status
|
||||||
{x=delayedSpawn.pos.x+x_dist-1, y=delayedSpawn.pos.y}) -- Pole
|
{x=delayedSpawn.pos.x+x_dist-1, y=delayedSpawn.pos.y}) -- Pole
|
||||||
|
SharedChestsSpawnCombinators(player,
|
||||||
|
{x=delayedSpawn.pos.x+x_dist+1, y=delayedSpawn.pos.y-2}, -- Ctrl
|
||||||
|
{x=delayedSpawn.pos.x+x_dist+1, y=delayedSpawn.pos.y}, -- Status
|
||||||
|
{x=delayedSpawn.pos.x+x_dist-1+1, y=delayedSpawn.pos.y}) -- Pole
|
||||||
|
|
||||||
|
|
||||||
-- Helpful ground text
|
-- Helpful ground text
|
||||||
rendering.draw_text{text="Set signals here to monitor item counts.",
|
rendering.draw_text{text="Set signals here to monitor item counts.",
|
||||||
surface=game.surfaces[GAME_SURFACE_NAME],
|
surface=game.surfaces[GAME_SURFACE_NAME],
|
||||||
@ -779,17 +789,18 @@ function SendPlayerToNewSpawnAndCreateIt(delayedSpawn)
|
|||||||
only_in_alt_mode=false}
|
only_in_alt_mode=false}
|
||||||
|
|
||||||
-- Output Chests
|
-- Output Chests
|
||||||
for i=4,9 do
|
for i=16,21 do
|
||||||
SharedChestsSpawnOutput(player, {x=delayedSpawn.pos.x+x_dist, y=delayedSpawn.pos.y+i})
|
SharedChestsSpawnOutput(player, {x=delayedSpawn.pos.x+x_dist, y=delayedSpawn.pos.y+i}, (i == 16))
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Tile arrows to help indicate
|
-- Tile arrows to help indicate
|
||||||
CreateTileArrow(game.surfaces[GAME_SURFACE_NAME], {x=delayedSpawn.pos.x+x_dist-4, y=delayedSpawn.pos.y+6}, "LEFT")
|
CreateTileArrow(game.surfaces[GAME_SURFACE_NAME], {x=delayedSpawn.pos.x+x_dist-4, y=delayedSpawn.pos.y+18}, "LEFT")
|
||||||
CreateTileArrow(game.surfaces[GAME_SURFACE_NAME], {x=delayedSpawn.pos.x+x_dist+1, y=delayedSpawn.pos.y+6}, "RIGHT")
|
CreateTileArrow(game.surfaces[GAME_SURFACE_NAME], {x=delayedSpawn.pos.x+x_dist+1, y=delayedSpawn.pos.y+18}, "RIGHT")
|
||||||
|
|
||||||
--Helpful ground text
|
--Helpful ground text
|
||||||
rendering.draw_text{text="Set filters to request items.",
|
rendering.draw_text{text="Set filters to request items.",
|
||||||
surface=game.surfaces[GAME_SURFACE_NAME],
|
surface=game.surfaces[GAME_SURFACE_NAME],
|
||||||
target={x=delayedSpawn.pos.x+x_dist-4, y=delayedSpawn.pos.y+10},
|
target={x=delayedSpawn.pos.x+x_dist-4, y=delayedSpawn.pos.y+22},
|
||||||
color={0.5,0.5,0.8,0.8},
|
color={0.5,0.5,0.8,0.8},
|
||||||
scale=1,
|
scale=1,
|
||||||
font="scenario-message-dialog",
|
font="scenario-message-dialog",
|
||||||
@ -800,7 +811,7 @@ function SendPlayerToNewSpawnAndCreateIt(delayedSpawn)
|
|||||||
only_in_alt_mode=false}
|
only_in_alt_mode=false}
|
||||||
|
|
||||||
-- Cutscene to force the player to witness my brilliance
|
-- Cutscene to force the player to witness my brilliance
|
||||||
player.set_controller{type=defines.controllers.cutscene,waypoints={{position={x=delayedSpawn.pos.x+x_dist, y=delayedSpawn.pos.y},transition_time=200,time_to_wait=300,zoom=1.2},{target=player.character,transition_time=60,time_to_wait=30,zoom=0.8}}, final_transition_time=45}
|
player.set_controller{type=defines.controllers.cutscene,waypoints={{position={x=delayedSpawn.pos.x+x_dist, y=delayedSpawn.pos.y},transition_time=200,time_to_wait=300,zoom=0.8},{target=player.character,transition_time=60,time_to_wait=30,zoom=0.8}}, final_transition_time=45}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -173,13 +173,15 @@ function SharedChestsSpawnInput(player, pos)
|
|||||||
table.insert(global.shared_chests, chestInfoIn)
|
table.insert(global.shared_chests, chestInfoIn)
|
||||||
end
|
end
|
||||||
|
|
||||||
function SharedChestsSpawnOutput(player, pos)
|
function SharedChestsSpawnOutput(player, pos, enable_example)
|
||||||
|
|
||||||
local outputChest = game.surfaces[GAME_SURFACE_NAME].create_entity{name="logistic-chest-requester", position={pos.x, pos.y}, force="neutral"}
|
local outputChest = game.surfaces[GAME_SURFACE_NAME].create_entity{name="logistic-chest-requester", position={pos.x, pos.y}, force="neutral"}
|
||||||
outputChest.destructible = false
|
outputChest.destructible = false
|
||||||
outputChest.minable = false
|
outputChest.minable = false
|
||||||
|
|
||||||
outputChest.set_request_slot({name="raw-fish", count=1}, 1)
|
if (enable_example) then
|
||||||
|
outputChest.set_request_slot({name="raw-fish", count=1}, 1)
|
||||||
|
end
|
||||||
|
|
||||||
if global.shared_chests == nil then
|
if global.shared_chests == nil then
|
||||||
global.shared_chests = {}
|
global.shared_chests = {}
|
||||||
@ -204,13 +206,13 @@ function SharedChestsSpawnCombinators(player, posCtrl, posStatus, posPole)
|
|||||||
combiStat.minable = false
|
combiStat.minable = false
|
||||||
combiStat.operable = false
|
combiStat.operable = false
|
||||||
|
|
||||||
local pole = game.surfaces[GAME_SURFACE_NAME].create_entity{name="small-electric-pole", position=posPole, force="neutral"}
|
-- local pole = game.surfaces[GAME_SURFACE_NAME].create_entity{name="small-electric-pole", position=posPole, force="neutral"}
|
||||||
pole.destructible = false
|
-- pole.destructible = false
|
||||||
pole.minable = false
|
-- pole.minable = false
|
||||||
|
|
||||||
-- Wire up dat pole
|
-- Wire up dat pole
|
||||||
pole.connect_neighbour({wire=defines.wire_type.red,
|
-- pole.connect_neighbour({wire=defines.wire_type.red,
|
||||||
target_entity=combiStat})
|
-- target_entity=combiStat})
|
||||||
|
|
||||||
if global.shared_chests_combinators == nil then
|
if global.shared_chests_combinators == nil then
|
||||||
global.shared_chests_combinators = {}
|
global.shared_chests_combinators = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user