DaCyclops / GDIW

Factorio Mod : GDIW - Gah!DarnItWater! A Factorio mod for those people who keep getting annoyed at water....
MIT License
3 stars 5 forks source link

.16 GDIW error. possible issue with mods #13

Closed kingarthur91 closed 6 years ago

kingarthur91 commented 6 years ago

just updated gdiw and every time i start factorio with it enable it throws an error for gdiw-plastic-bar-IR missing key "icon-size"

ST-DDT commented 6 years ago

I use the version without errors. Does it report any other relevant mods or do you have a mod that changes the plastic recipe?

Probably relevant lines:

https://github.com/DaCyclops/GDIW/blob/master/data-final-fixes.lua#L108 https://github.com/DaCyclops/GDIW/blob/master/data-final-fixes.lua#L129 https://github.com/DaCyclops/GDIW/blob/master/data-final-fixes.lua#L138

kingarthur91 commented 6 years ago

it doesn't list any other mods in the error page. i do have the full angels mods and i think its petrochem that adds liquid plastic recipes and changes plastic bar to be made from it

i had add a line under line 129 to add icon_size=32. at that point it started throwing errors about flamethrower-recipe not having key "icon"

SebFierce commented 6 years ago

I could localize the problem on my install:

Further tests reveal that other bobs mods that add fluids create the error message as well, just with different recipes then.

DaCyclops commented 6 years ago

This is screaming at me of the same problem I initially had with sulfur and flamethrower fuel, that the recipe didnt actually have an icon. https://github.com/DaCyclops/GDIW/blob/bb064292355d97b474f5b759eadf25470426ff4f/data.lua#L5

I will check it out once im back at home tonight. Also, looking at this, im gonna need to add specific icon_size detecting like the icon/icons detecting.

Thank you @SebFierce for the isolation test there, that will help me check quicker.

ST-DDT commented 6 years ago

There is a quick fix for this and a clean fix for this:

Quick-Fix: Add this to https://github.com/DaCyclops/GDIW/blob/master/data-final-fixes.lua#L151

if not vrn.icon_size then
    vrn.icon_size = 32
end

Clean-Fix: Actually calculate the icon_size based on the input. However I don't know any recipe/item that uses a different icon_size than 32. However this would probably require different overlay sizes as well.


On a side story:

if you add ammo to the searched result groups here (currently fluid and item only), you can throw away the fixes in data.lua.

DaCyclops commented 6 years ago

@ST-DDT Its funny you say all that, because I literally just committed changes like that before noticing your response :D (well, I use a fixed icon_size, but if something has a different icon_size, its going to screw up my overlays anyway....)

Yep, 0.16.2 about to be released, appears to work fine with bobsplates