Enemy Color

by Silari

A mod to set the color of enemy forces on the map.

Tweaks
2 years ago
1.0 - 1.1
270
Enemies

g [DONE] Adding color causes me some error

3 years ago
(updated 3 years ago)

I fail to understand this error message :

15.409 Error PrototypeLoader.cpp:95: Error loading prototype, used default instead: Error while loading utility-constants prototype "default" (utility-constants): Key "default_enemy_force_color" not found in property tree at ROOT.utility-constants.default
Modifications: core › Enemy Color
15.409 Error PrototypeLoader.cpp:101: Modifications: core › Enemy Color
15.412 Error ModManager.cpp:1514: Error while loading utility-constants prototype "default" (utility-constants): Key "default_enemy_force_color" not found in property tree at ROOT.utility-constants.default

//error msg on startup below
15.983 Mods to disable:Failed to load mods: Error while loading utility-constants prototype "default" (utility-constants): Key "default_enemy_force_color" not found in property tree at ROOT.utility-constants.default
Modifications: core › Enemy Color

I tried to add one color, I just added

    ["Pink"]={a=128,r=255,g=192,b=203}, -- 
    ["Hot pink"]={a=128,r=255,g=105,b=180}, -- 
    ["Low alpha"]={a=24,r=255,g=0,b=0} --  <-- this option

and I included it in "allowed_values" in game settings. Is it inpossible to add new value to this table by this way - for some reason, or am I not seeing something else?

3 years ago

Seems like you deleted/changed something else when you made the modification. Adding it to settings as allowed and into the table in data.lua on a fresh copy worked fine.

Judging from the error message something you changed made the mod set default_enemy_force_color to nil, which removed it from the table, thus Factorio complained it was missing.

3 years ago
(updated 3 years ago)

I don't think I changed anything but adding that line, but maybe I'm wrong and I selected some line before pasting. The problem is when I deleted this mod - absolutely (removed it from mod folder) than started game and installed mod from game UI again - this error still persists after game tries to restart. (I'm using 1.0.0)
I guess after doing some strange error something is messed up in my mod settings file, and those persist even after deleting mod? so I would need to delete mod settings, but I will rather not use this mod for now. Deleting mod settings is big no-no for me.

That would be strange if game kept those settings, so maybe there is just some incompatibility with something other. I don't remember if it ever worked or if I messed it up immidietly after downloading, but it's possible I messed it up at once, as I often look into mod files before even looking at them in game.

If I'll ever find out something more - I will write it here, but I think I just won't use it for current playthrough. Thanks for help, and quick response.

3 years ago
(updated 3 years ago)

Ah, that makes it very likely that you named the allowed value different from what you put in the table in data.raw - they're strings so they're case sensitive, have to be 100% the same. Then if the mod tried to look up the proper color to use, it would find nothing in the table, and set nothing as the color. That'd explain the issue and would probably also keep causing issues when reinstalled since the bad value would still be saved in your mod setting file.

There should be an option to reset mod settings in the error dialogue, IIRC. It MIGHT be a 1.1 thing tho.

3 years ago
(updated 3 years ago)

Since I was updating the mod anyway to add a preview image, it's now setup so that if it can't find the selected color in the table it will default to blue. Shouldn't happen in normal usage but now if the setting gets a bad value in it the game can still startup.

New response