i like to write a little tiny mod. Nothing special but I want to reach that a nearby RailSignal or Chain Rail Signal will be set to stopped closed...
Why ? Walking over a rail is sth dangerous the train could kill yo... So i want sth like a Level Crossing. I hope it means in english the same, the dictory told me that is the right word.
My Question: I want to get information on which the player are, like if he is on a rail and get nearby items ...
I checked out some other mods how they write code and the page https://wiki.factorio.com/index.php?title=Lua/Surface
I try this code
Code: Select all
game.player.selected.surface.find_entity('smart-inserter',{0,0})
But i get error from the game it is allways nil ... and than i try some some other stuff like check first this and that. But I cannot really get acces to nearby items
and simply print them.
Maybe my idea is bad, my programming skills too. Can you help me?