Combat Log

by chriswa

Keeps a log of combat alerts.

Utilities
1 year, 9 months ago
1.1
357
Combat

b Opened the combat log after removing some mods.

1 year, 8 months ago
(updated 1 year, 8 months ago)
Error while running event combat-log::on_gui_click (ID 1)
Unknown sprite "entity/mining-depot"
stack traceback:
    [C]: in function 'add'
    __combat-log__/control/gui-window.lua:162: in function 'update_cluster_row'
    __combat-log__/control/gui-window.lua:224: in function 'render_content'
    __combat-log__/control/gui-window.lua:285: in function 'show'
    __combat-log__/control/gui-window.lua:315: in function 'handler'
    __combat-log__/control/gui-window.lua:326: in function 'wrapper'
    __flib__/gui-lite.lua:139: in function 'handler'
    __flib__/gui-lite.lua:169: in function <__flib__/gui-lite.lua:152>

Screenshot: https://imgur.com/qZNbYOd

1 year, 7 months ago

So while I am not experienced with modding Factorio enough to make a fork to properly fix this (probably a setting box to clear the history on next load, which would turn itself off afterwards).

I DID look at the script, in Appdata/Roaming/Factorio/mods/combat-log_1.0.0.zip/control/index.lua and found this function commented out:

-- script.on_load(function()
-- log("on_load")
-- event_tracker.init_or_reinit()
-- end)

I am 90% sure that removing the -- before each line, saving and rezipping it (assuming we can't edit it without unzipping the archive first, which i'd assume so but honestly i've never tried modifying a file inside a zip archive so who knows) will result in, whenever you load a save with the mod, the history being reset to blank, after which you could reverse script edit or reload an untouched version to maintain the history between sessions again.

But honestly i'd suggest first just trying removing the mod, loading the save, saving, exiting and re-adding the mod, since that should trigger the initial setup again which should do the same thing with less work for the user and less chance of breaking things.

After 27 days its probably not gonna help you too much but maybe someone else will come across this before the modder makes a patch for it

1 year, 7 months ago
(updated 1 year, 7 months ago)

The solution to the problem is quite simple. It is worth simply checking the entire list for validity when initializing the world. That is, whether it exists or not, if not, then replace it with vanilla "?", or simply delete it. But I would prefer to just ask questions and save the text. That is, now it is a reference to objects in the world. And it could be done so that when creating a story, a variable related to the history object was created, that is, the widget stores the text, coordinates and image of the entity. And the text consists of, for example, entity-name.car. That is, if suddenly the entity car is removed from the game, we will not receive these errors and we will have data that it was a car, and not something unknown.

New response