Robot Army


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

2 years ago
0.13 - 1.1
32.7K

b Crash

5 years ago
4750.804 Error MainLoop.cpp:1143: Exception at tick 7676959: The mod Robot Army caused a non-recoverable error.
Please report this error to the mod author.

Error while running event robotarmy::on_player_selected_area (ID 49)
LuaUnitGroup API call when LuaUnitGroup was invalid.
stack traceback:
        __robotarmy__/robolib/eventhandlers.lua:111: in function 'reportSelectedUnits'
        __robotarmy__/control.lua:71: in function <__robotarmy__/control.lua:70>
stack traceback:
        [C]: in function '__index'
        __robotarmy__/robolib/eventhandlers.lua:111: in function 'reportSelectedUnits'
        __robotarmy__/control.lua:71: in function <__robotarmy__/control.lua:70
4750.813 Error ServerMultiplayerManager.cpp:92: MultiplayerManager failed: "The mod Robot Army caused a non-recoverable error.
Please report this error to the mod author.

Error while running event robotarmy::on_player_selected_area (ID 49)
LuaUnitGroup API call when LuaUnitGroup was invalid.
stack traceback:
        __robotarmy__/robolib/eventhandlers.lua:111: in function 'reportSelectedUnits'
        __robotarmy__/control.lua:71: in function <__robotarmy__/control.lua:70>
stack traceback:
        [C]: in function '__index'
        __robotarmy__/robolib/eventhandlers.lua:111: in function 'reportSelectedUnits'
        __robotarmy__/control.lua:71: in function <__robotarmy__/control.lua:70>
5 years ago

Can you describe to me what happened before it crashed? Looks like you (or someone in a multiplayer server?) Was using the selection tool to select a squad but the squad unit group was invalid at the time so it crashed

5 years ago

Multiplayer server, one of the other players stated that they had just clicked to select a squad (that was not dead but was amidst an area that was a prior battle) when it crashed. I'm not able to glean much more information from them, I prefer it when I can replicate it myself... ^.^;

5 years ago

Okay. I think it was a freak accident/very rare case, I will investigate the GitHub issue and fix the code so it at least won't crash like that. The fix will come as part of the next version release, which could be weeks or months away... There is a lot I'd like to fix/change.

5 years ago

Thank you for the report, and for using my mod :)

5 years ago
(updated 5 years ago)

It's great to keep biters away early game. ^.^

For note, this bug has crashed the server twice more since this report, have to keep reloading it manually. ^.^;
So it's not really that rare of a case?

More information, the other players are pretty sure it happens when the tool is 'deselecting', I don't know if they meant deselecting the droids or they are deselecting the tool itself.

5 years ago

Hmm. Strange. Tell your players to select a squad, give a command and deselect it as soon as possible. I wonder if they are trying to deselect after a squad is destroyed?

5 years ago
(updated 5 years ago)

He says this:

  1. Step 1 select droid.
  2. Step 2 give move command to droid.
  3. Step 3 put the controller tool back into inventory.
  4. Step 4 realize the droid is still selected, this might be many minutes later, but he says the droid is absolutely still alive at the time as none have died yet (they are all still inside the base).
  5. Step 6 click away from them to deselect them. <-- This step
  6. Step 7 put controller back in inventory.

It crashes on Step 6 sometimes, he's not sure if the droid is dead at the time or not.

5 years ago

okay, so the squad has been selected for a while, some time later he takes out the selection tool and then tries to de-select but it crashes. Okay. I'll investigate this when I have some time (not much time... a fix could take a long time to release... like weeks/months)

5 years ago

Heh, as it keeps crashing the server I might need to remove it for now then... Thanks for looking in to it though!

Question though, shouldn't it be simple enough to check validity of the group before accessing their data? Factorio's API is generally quite good about giving something like a .valid == true/false or so just for such reasons? If not I'd wager it is a bug in the API.

5 years ago

Why yes! In fact it seems LuaUnitGroup does have such a valid key:
https://lua-api.factorio.com/latest/LuaUnitGroup.html

And indeed, __robotarmy__/robolib/eventhandlers.lua does not seem to be checking validity on any LuaUnit Group access at all in any location. It is checking validity of the unit's themselves on occasion (though seems to be missing some checks there as well), but it's not checking it on any LuaUnitGroup at all, so it seems that is the bug. :-)

5 years ago

Yes, that is all correct, and I've already fixed it on my end last night. It's pushed to the unstable branch if you want to try it out for me

5 years ago

I'd have to convince the other people that join the server to acquire a mod that is not on the mod portal, though considering the crashiness of it that might be possible, I'll see if they are up to doing that tomorrow. :-)

5 years ago

It's unreasonable to ask they do that, it's a lot of work, ... you could prepare it for them into a zip and tell them where to put it I suppose.

I don't want to fully release the current version because I'm still in the middle of testing some of the bug fixes and the Unit Control mod interaction

5 years ago

It's unreasonable to ask they do that, it's a lot of work, ... you could prepare it for them into a zip and tell them where to put it I suppose.

Oh I'd pack it up for them, it's on me to convince them to try it. ^.^;

I don't want to fully release the current version because I'm still in the middle of testing some of the bug fixes and the Unit Control mod interaction

Ooo, we have unit control but don't really use it as it doesn't really work with robot army's things (we use it on other things though the few times we have them), looking forward to this!!

New response