Robot Army


Manufacture and deploy automated robot soldiers to attack your foes and defend your factory!

1 year, 10 months ago
0.13 - 1.1
30.3K

b [Bug] LuaUnitGroup was invalid

3 years ago
(updated 3 years ago)

First of all, many thanks for the development of the mod.!

I have noticed a sometimes occurring error. Attached the stack trace:

Factorio: 0.18.38 (build 53953, linux64, steam)
Mods: Robot Army, Unit Control, Base Mod

--Trying to move combat robots. (using unit control)--

Error while running event robotarmy::on_tick (ID 0)
LuaUnitGroup API call when LuaUnitGroup was invalid.
stack traceback:
robotarmy/robolib/Squad.lua:144: in function 'addMemberToSquad'
robotarmy/robolib/Squad.lua:427: in function 'retreatMisbehavingLoneWolf'
robotarmy/robolib/Squad.lua:513: in function 'attemptToKickSoldierOut'
robotarmy/robolib/Squad.lua:649: in function 'validateSquadIntegrity'
robotarmy/robolib/SquadControl.lua:167: in function 'executeGuardAI'
robotarmy/robolib/SquadControl.lua:15: in function 'updateSquad'
robotarmy/robolib/eventhandlers.lua:39: in function 'processSquadUpdatesForTick'
robotarmy/robolib/eventhandlers.lua:362: in function 'tickForces'
robotarmy/robolib/eventhandlers.lua:458: in function <robotarmy/robolib/eventhandlers.lua:455>
stack traceback:
[C]: in function 'index'
__robotarmy
/robolib/Squad.lua:144: in function 'addMemberToSquad'
robotarmy/robolib/Squad.lua:427: in function 'retreatMisbehavingLoneWolf'
robotarmy/robolib/Squad.lua:513: in function 'attemptToKickSoldierOut'
robotarmy/robolib/Squad.lua:649: in function 'validateSquadIntegrity'
robotarmy/robolib/SquadControl.lua:167: in function 'executeGuardAI'
robotarmy/robolib/SquadControl.lua:15: in function 'updateSquad'
robotarmy/robolib/eventhandlers.lua:39: in function 'processSquadUpdatesForTick'
robotarmy/robolib/eventhandlers.lua:362: in function 'tickForces'
robotarmy/robolib/eventhandlers.lua:458: in function <robotarmy/robolib/eventhandlers.lua:455>

--Trying to let combat robots explore. (using unit control)--

The mod Robot Army (0.4.5) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event robotarmy::on_tick (ID 0)
LuaUnitGroup API call when LuaUnitGroup was invalid.
stack traceback:
robotarmy/robolib/Squad.lua:628: in function 'validateSquadIntegrity'
robotarmy/robolib/Squad.lua:384: in function 'squadStillExists'
robotarmy/robolib/SquadControl.lua:11: in function 'updateSquad'
robotarmy/robolib/eventhandlers.lua:39: in function 'processSquadUpdatesForTick'
robotarmy/robolib/eventhandlers.lua:362: in function 'tickForces'
robotarmy/robolib/eventhandlers.lua:458: in function <robotarmy/robolib/eventhandlers.lua:455>
stack traceback:
[C]: in function 'index'
__robotarmy
/robolib/Squad.lua:628: in function 'validateSquadIntegrity'
robotarmy/robolib/Squad.lua:384: in function 'squadStillExists'
robotarmy/robolib/SquadControl.lua:11: in function 'updateSquad'
robotarmy/robolib/eventhandlers.lua:39: in function 'processSquadUpdatesForTick'
robotarmy/robolib/eventhandlers.lua:362: in function 'tickForces'
robotarmy/robolib/eventhandlers.lua:458: in function <robotarmy/robolib/eventhandlers.lua:455>

3 years ago

Hi,

I'm not sure how to fix the first one - there is already a check for if the unitGroup is valid before that function does anything, when I add the member to the squad I then ask it to begin moving, which is the line which breaks. Perhaps I need to check if the unitGroup is valid after adding the member. would be weird if it was not valid. This could be a bug in the Factorio game, which may or may not be fixed by now. I do remember seeing some bug fixes related to unit groups recently.

The second one may be also the same bug, although I see some places where I could check it being valid before using it.

I will not fix this bug yet, but I will incorporate something which "should" fix it for the v5.0 release. Thank you for the bug report! :)

New response