This mod allows players to create and remotely control Avatars. Avatars act like players, with a few minor exceptions. The mod also includes a few custom entities to control and create the Avatars.
Hi,
I keep getting this error (playing with Krastorio 2 and a bunch of other mods):
The mod Avatars (0.5.5) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event Avatars::on_player_driving_changed_state (ID 26)
LuaEntity API call when LuaEntity was invalid.
stack traceback:
Avatars/scripts/sort.lua:84: in function 'getFilteredTable'
Avatars/scripts/sort.lua:41: in function 'getSortedTable'
Avatars/scripts/gui.lua:108: in function 'draw'
Avatars/control.lua:45: in function <Avatars/control.lua:40>
stack traceback:
[C]: in function 'index'
__Avatars/scripts/sort.lua:84: in function 'getFilteredTable'
Avatars/scripts/sort.lua:41: in function 'getSortedTable'
Avatars/scripts/gui.lua:108: in function 'draw'
Avatars/control.lua:45: in function <Avatars/control.lua:40
Doesn't look like it is Krastorio at a glance. Do you have any mods that transport you to a different surface (a different place, like inside warehouses or factories or something)?
I could fix it on my end easily, but a different mod of yours seems to be deleting the avatars and recreating them. In theory they should be setting a flag so that the Avatars mod would get the event of that, but it doesn't look like it is. If the other mod isn't giving me the destroy event then they probably aren't giving me the recreate event, so the fix would just leave avatars lying around that you can't control or do anything with.
Hi,
thanks for the quick answer. The only mod I can think of that might be deleting avatars is the teleporter mod. But I have used that one before. It would be great if there was some graceful way to recover from this error. So far I have tried disabling all mods except avatar, but it still keeps crashing whenever I try to control an avatar. Any ideas?
The full list of my currently installed mods is:
(not quite sure what else I might have installed at some point in time though. sorry)
Actual_Craft_Time_0.5.2.zip
advanced-logistics-system-fork_0.6.6.zip
AtomicRobotsFixv_2.0.0.zip
Automatic_Train_Painter_0.3.12.zip
Avatars_0.5.5.zip
Better-Power-Armor-Grid_2.5.0.zip
Bottleneck_0.11.3.zip
ConstructionTower_0.1.1.zip
Construction_Drones_0.5.5.zip
EvoGUI_0.4.501.zip
Evolution Reduction_0.18.0.zip
factoryplanner_0.18.17.zip
FasterStart_0.18.2.zip
Fill4Me_0.9.2.zip
FusionRobotics_0.1.2.zip
helmod_0.10.20.zip
Hiladdar_Robots_0.18.7.zip
KingsNuclearBots_1.18.0.zip
Krastorio2_0.9.16.zip
LogisticTrainNetwork_1.13.1.zip
LtnManager_0.1.10.zip
LTN_Combinator_0.6.2.zip
LTN_Content_Reader_0.3.2.zip
MaxRateCalculator_3.2.35.zip
Mining_Drones_0.3.21.zip
Nanobots_3.2.6.zip
OpteraLib_0.2.1.zip
quarry-18_1.8.0.zip
RaiLuaLib_0.2.8.zip
RecipeBook_1.2.3.zip
ResetEvolutionPollution_0.0.4.zip
skan-fusion-robots_1.3.0.zip
SpecializedArmor_0.2.6.zip
SpecializedFuel_0.6.6.zip
SpFuMaterialPack_0.2.4.zip
stdlib_1.4.2.zip
Teleporters_0.2.2.zip
WaterWell_1.0.21.zip
what-is-it-really-used-for_1.5.13.zip
wireless-charging-lib_v18_0.18.0.zip
wireless-charging_v18_0.18.0.zip
Looks like Teleporters uses "teleport" so it is safe.
So, the problem is that at some point during your game another mod deleted and recreated an avatar without informing the Avatars mod. So, this means that even if you remove the other mods, that avatar is still invalidated and Avatars has no idea that it was destroyed or created again.
I can fix the check that is failing, and alert you that an Avatar is invalid. I will also add a command that will search for any orphaned Avatars to repair the listing. That command will most likely cause a massive lag spike, because I would have to search the entire map for all avatars and see if there are any that are unknown to the Avatars mod.
Ok, check out the 0.5.6 version and let me know if it works.
When you get into a control unit, you will likely see some warnings in the chat log, it will list the avatars that have gone missing (not needed, but if you named them specifically, that may help to find them later).
You can run the following command in the chat to repair the global listing, this may cause some lag if you have a massive map, but I didn't notice a lag on a medium sized base that I use for testing this type of thing sometimes.
/c remote.call("Avatars", "repair_avatars_listing")
If the removed/added amounts at the end of that command line up, then you're good to go. The avatars that went missing will have fresh avatar names, but they will be usable. If not, then somehow an avatar went missing or an extra was created by another mod.
I was missing a few inter-mod events, so it's possible that if a current mod of yours was causing this that fixed the issue. If you see this issue in the future though, it's likely the offending mod is still around and is doing something wrong. However, you will get the warnings again and can rerun the repair command and everything will work on my end.
Thanks for the update. So... partial succcess. It doesn't crash anymore on entering the control station. But the control station just shows an empty list and on clicking refresh it crashes at once, see below.
The mod Avatars (0.5.6) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event Avatars::on_gui_click (ID 1)
Avatars/scripts/gui.lua:252: attempt to index field 'upperSortFlow' (a nil value)
stack traceback:
Avatars/scripts/gui.lua:252: in function 'getSortValues'
Avatars/scripts/gui.lua:271: in function 'update'
Avatars/scripts/gui.lua:72: in function 'update'
Avatars/control.lua:93: in function <Avatars/control.lua:63>
Manually placing a new avatar fixes the crash though.
Then, after running the command command it says it fixed it but after clicking on refresh or leaving and re-entering the control station, it still complains about the same avatar that it could not find. Any idea? Should I send you the savegame somehow?
Hm, yes please send the save over. I can replicate the crash on Refresh, but the Avatar still missing I can't.
If you need somewhere to upload it, I made a quick folder on my drive public so you can should be able to drop it there (assuming you have a Google account): https://drive.google.com/drive/folders/1baXxh8rfoDYKg4-QYuC18El4wwl2CQOa?usp=sharing
Uploaded.
Ok, now it should be good in 0.5.7. I fixed both the repair not working properly and the refresh crashing when the list is empty.
Ok, that fixed that problem. Thank you very much!
Now though every time I save and load a game it loses the avatar I was in and I have to execute your command to get the avatar back. Any idea?
Wow, that is a strange one. If I save the game while controlling an avatar on your save then it becomes invalid. BUT, if I do the same thing on a different save, I don't get this issue. I think I have to attribute it to something wrong with your save, but I can't say what sadly.
I'll put in a bug report with Factorio to see if it is something on their end, but for now just try to save from your main player character, not from an avatar.
Pretty strange bug indeed. :)
Thanks for checking everything and putting in the command to fix things. Maybe I messed around with too many mods. Or one of the mods does something strange to the avatar on loading? Who knows...
So, Rseding replied to my bug, I guess it's something to do with your save having been a multiplayer save at some point, so I need to handle player connection. (Which I thought I had handled in past versions, but I guess that is no longer the case). I'll work on it sometime over the next few days and let you know when I have a fix.
Ok, this should be totally fix now in 0.5.8.
not quite... :D
Directly on loading:
The mod Avatars (0.5.8) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event Avatars::on_player_joined_game (ID 43)
Avatars/scripts/storage.lua:145: attempt to index field 'playerData' (a nil value)
stack traceback:
Avatars/scripts/storage.lua:145: in function 'getByPlayer'
Avatars/scripts/storage.lua:157: in function 'repairOnJoinedGame'
Avatars/control.lua:41: in function <Avatars/control.lua:39>
Blurghhghghghg. I hadn't tested on a save with multiple avatars lying around. 0.5.9 should do it.
Sorry for the late fix on this one, I had a busy weekend and forgot about the email.
Hehe. The old programmer wisdom is really true: behind every tiny bug is a bigger one just waiting to come out :D
But thank you for the prompt bug fixing and the overall awesome mod. It really improves the game play at lot by removing a large part of the boring running around.
Can I also request a few ui improvements? :D
For example it would be nice if after clicking the disconnect button the menu for selecting an avatar would appear at once instead of having to press enter two times every time. And with the 10 quickbars it would be great if the avatars would remember which quickbar was selected and went back to the same ones.
Ok sure, I've made a note to look into that. I'm not too familiar about the quickbars from modding, but I wouldn't think it would be too difficult.
Just to let you know, the changes you asked for made it into 0.5.10.