Found a solution for treefarm-ac with muliple forces
Posted: Wed Sep 09, 2015 5:01 pm
I'm playing a multiplayer game where every player have a different faction/force. We don't share the same technology-tree and we all have our own bases. We use lots of mods, most of them work (believe it or not). All of the entities from treefarm-ac works except the important cokery. It's placed as the force "player" and not as my force "blue".
After some questioning and digging I found the following fix:
Path:Factorio/mods/Treefarm-AC 0.2.1.zip/control.luaChanges:
Added: "local force = game.players[event.player_index].force"
Changed to this: "force = force"
Now the cokery is placed as my current force
Why does this matter? Because force.player is an enemy of force.blue
so I can't interact with force.players entities
After some questioning and digging I found the following fix:
Path:Factorio/mods/Treefarm-AC 0.2.1.zip/control.lua
Code: Select all
require "defines"
game.on_event(defines.events.on_built_entity, function(event)
if event.created_entity.name == "tf-cokery-dummy" then
local force = game.players[event.player_index].force
game.get_surface("nauvis").create_entity{name = "tf-cokery", position = event.created_entity.position, force = force}
event.created_entity.destroy()
end
end)
Added: "local force = game.players[event.player_index].force"
Changed to this: "force = force"
Now the cokery is placed as my current force
Why does this matter? Because force.player is an enemy of force.blue
