Rampant

by Veden

Improves the enemies tactics by using potential fields (pheromones) allowing probing of defenses, retreats, reinforcements, counterattacking, breaching, raids, rallying death cry, and player hunting. Uses blockable biter projectiles. Adds new Enemies which can be disabled in mod settings. Difficulty setting in mod options menu.

Content
1 year, 2 months ago
0.13 - 1.1
124K
Enemies

b Overlooked piece of code causing crash

3 years ago
(updated 3 years ago)
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).

3 years ago

Should be an easy fix and will be included in the next version.

I'm assuming this has something to do with your mod compressed biter squads?

3 years ago

Yes

New response