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
7 months ago
0.13 - 1.1
113K
Enemies

b Overlooked piece of code causing crash

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

2 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?

2 years ago

Yes

New response