Due to pure curiosity I want to know how I can get the force from an entity.
For example:
Code: Select all
entities = Surface.find_all_entities({
type = entityType,
force = force
})
for _, entity in pairs(entities) do
table.insert(global[mappedName][force.name], entity)
log("[RT] added " .. entity.name .. " force " .. force.name)
end
Code: Select all
entities = Surface.find_all_entities({
type = entityType
-- no force !!!
})
for _, entity in pairs(entities) do
force = entity.???????.name
table.insert(global[mappedName][force.name], entity)
log("[RT] added " .. entity.name .. " force " .. force.name)
end
There is LuaControl as the "control" between entity, player (and so the force), but I don't understand, how I can get an instance of LuaControl from the entity.