mods icon indicating copy to clipboard operation
mods copied to clipboard

Log shows warning about missing machine tints for petrochem

Open adoa opened this issue 4 years ago • 8 comments

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.

adoa avatar Aug 03 '21 17:08 adoa

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

LovelySanta avatar Aug 03 '21 18:08 LovelySanta

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

Pezzawinkle avatar Oct 06 '21 07:10 Pezzawinkle

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 avatar Oct 06 '21 15:10 LovelySanta

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.

LovelySanta avatar Oct 31 '21 11:10 LovelySanta

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

Pezzawinkle avatar Nov 27 '21 01:11 Pezzawinkle

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:

  • [ ] In order to make sure this code runs at the last minute, all bobs mods must be added as hidden optional dependencies (marked (?)) in the info.json
  • [ ] The function must be extended:
    • First compile a list of all crafting machines that use recipe tints
      • [ ] Create a helper function to check if a certain sprite/animation uses recipe tints
    • Secondly compile a list of all crafting categories of set machines
    • For all recipes in these crafting categories check recipe tints
  • [ ] At last remove the aforementioned code out of petrochem
  • [ ] Issue can be closed

LovelySanta avatar Nov 27 '21 11:11 LovelySanta

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.

LovelySanta avatar Dec 04 '21 15:12 LovelySanta

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!

KiwiHawk avatar Jan 30 '23 04:01 KiwiHawk