Tiberium

by Zillo7

Adds Tiberium - Harvest it to convert it to other ores.

Content
6 years ago
0.15
6
Mining

g Multiplayer testing

6 years ago

This code:

for i=1, #game.players, 1 do
local playerPositionOre = global.world.find_entities_filtered{name = global.oreType, position = game.players[i].position}
if #playerPositionOre > 0 and game.players[i] and game.players[i].valid and game.players[i].character then
game.players[i].character.damage(global.contactDamage, game.forces.neutral, "acid")
end
end

I think it was written wrong.
It must be, for example:

for i , player in pairs (game.players) do

or

for i , player in pairs (game.connected_players) do

http://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.connected_players

6 years ago

Those lines you posted also work, but what I've got works too. Is there a performance difference between them?

New response