Arch666Angel / mods

Angelsmods Repository
https://forums.factorio.com/viewforum.php?f=185
82 stars 61 forks source link

Log shows warning about missing machine tints for petrochem #648

Open adoa opened 3 years ago

adoa commented 3 years ago

The log shows ~150 warnings of the type

8.922 Script @__angelspetrochem__/prototypes/petrochem-global-override.lua:13: Recipe 'rocket-fuel' does not have a crafting_machine_tint set!
8.922 Script @__angelspetrochem__/prototypes/petrochem-global-override.lua:13: Recipe 'angelsore8-sludge' does not have a crafting_machine_tint set!
[…snip…]
8.924 Script @__angelspetrochem__/prototypes/petrochem-global-override.lua:13: Recipe 'gas-puffer-atmosphere' does not have a crafting_machine_tint set!
8.924 Script @__angelspetrochem__/prototypes/petrochem-global-override.lua:13: Recipe 'angels-atomic-bomb-2' does not have a crafting_machine_tint set!

I believe Angel's chemical plant does not support machine tints, but it's still annoying to have this giant block of warnings in the log every time I look for a specific thing.

LovelySanta commented 3 years ago

Yes they do, well, will... we should move this check out of data stage into the unit tests...

Pezzawinkle commented 2 years ago

this may also be getting patched with a branch im working on now.

LovelySanta commented 2 years ago

we should first create a unit test to catch this before 'resolving' it, but that branch can fix it too. The unit test should be more uniform than just the chem plant:

for any machine accepting a recipe:
    if machine graphics support recipe tinting:
        for any recipe that can be crafted in this machine:
            for every tint layer used by the machine:
                if recipe does not have this tint specified and machine has no default for this tint layer:
                    log message
                    let unit test soft fail
LovelySanta commented 2 years ago

Currently it is not possible to dynamically check if a machine supports recipe tints. I've asked for this in https://forums.factorio.com/viewtopic.php?f=28&t=100372. We can however still hardcode this step for now.

Pezzawinkle commented 2 years ago

I have cleaned this up substantially as part of 221a5d1

Not sure if you want to keep it open as a reminder for the test-unit

LovelySanta commented 2 years ago

Yes, this is mostly fixed (by #704). I would still move the following code out of petrochem and move it into the angelsdev-unit-test mod. https://github.com/Arch666Angel/mods/blob/a30ea50d6c508559da2bd6be4cef46ebb1e0c298/angelspetrochem/prototypes/petrochem-global-override.lua#L6-L20 Things to do so:

LovelySanta commented 2 years ago

Leaving this open due to the comment above. The extensive logging is resolved with the merge of #704. This is sufficient for the next milestone.

KiwiHawk commented 1 year ago

From running unit tests:

angelsdev-unit-test:     Recipe 'angels-atomic-bomb' does not have a crafting_machine_tint set!
angelsdev-unit-test:     Recipe 'atomic-bomb' does not have a crafting_machine_tint set!
angelsdev-unit-test:     Recipe 'flame-bullet-projectile' does not have a crafting_machine_tint set!
angelsdev-unit-test:     Recipe 'flame-rocket-warhead' does not have a crafting_machine_tint set!
angelsdev-unit-test:     Recipe 'lead-oxide-2' does not have a crafting_machine_tint set!
angelsdev-unit-test:     Recipe 'lead-oxide' does not have a crafting_machine_tint set!
angelsdev-unit-test:     Recipe 'petroleum-jelly' does not have a crafting_machine_tint set!
angelsdev-unit-test:     Recipe 'shotgun-flame-shell' does not have a crafting_machine_tint set!
angelsdev-unit-test:     Recipe 'silver-nitrate' does not have a crafting_machine_tint set!
angelsdev-unit-test:     Recipe 'silver-oxide' does not have a crafting_machine_tint set!