Lua. Connect rail-signal to rail
Posted: Thu Oct 20, 2022 12:29 am
Hi all, i'm trying to add rail-signals and rail-chain-signal to created rails, but i do not understand how to join them between each other..
all works, i have a rail, and both signals, but signals are not connected to rail. How do join them?
Code: Select all
railEntity = surface.create_entity{ force=game.player.force, name = "straight-rail", position = fPos, direction = defines.direction.west}
sPos = shallowcopy(fPos)
sPos.x = sPos.x+1
sPos.y = sPos.y-2
railSignalEntity = surface.create_entity{ force=game.player.force, name = "rail-signal", position = sPos, direction = defines.direction.west}
sPos.y = sPos.y+3
surface.create_entity{ force=game.player.force, name = "rail-chain-signal", position = sPos, direction = defines.direction.east}