Filtering position data from tile array

Place to get help with not working mods / modding interface.
Post Reply
Atraps003
Long Handed Inserter
Long Handed Inserter
Posts: 68
Joined: Thu Jan 04, 2018 6:34 am
Contact:

Filtering position data from tile array

Post by Atraps003 »

How to filter the x position out of the array?

Code: Select all

local on_player_built_tile = function(event)
	if (event.tile.name == "landfill") then
	local a = event.tiles
	local b = event.tiles.position
	game.print("A")
	game.print(serpent.block({a}))
	game.print("B")
	game.print(serpent.block({b}))
	end
end
factorio-tile-position.png
factorio-tile-position.png (458.68 KiB) Viewed 245 times

Edit:
Modders on discord helped out with this but I figured I would add it here.

event.tiles[1].position.x
1 is the nth tile

Post Reply

Return to “Modding help”