Error while running event Rampant::on_build_base_arrived (ID 140)
LuaEntity doesn't contain key group_number.
stack traceback:
[C]: in function '__index'
__Rampant__/control.lua:884: in function <__Rampant__/control.lua:868>
This is caused by event.group
being invalid when on_build_base_arrived is ran (how), and Rampant does have piece of code to workaround this but it is not finished, causing builder
local variable to be set to event.unit
, which is a LuaEntity
without any further action, which end up builder
having LuaEntity
utilized as LuaGroup
local function onBuilderArrived(event)
local builder = event.group
if not (builder and builder.valid) then
builder = event.unit
if not (builder and builder.valid and builder.force.name == "enemy") then
return
end
elseif (builder.force.name ~= "enemy") then
...
end
...
local squad = universe.groupNumberToSquad[builder.group_number]
This can be caused only by having an enemy with base setup order without being tied to a group (which is documented on Lua API docs).