Page 1 of 1

Ability to specify icon for 'nothing' technology effect?

Posted: Tue Jul 14, 2020 11:03 am
by mrudat
It would be nifty if it was possible to supply an icon for the 'nothing' technology effect, be that an `icons` parameter, a reference to some thing that has an icon, or perhaps something completely different.

As an example use-case, specifying that used-up uranium fuel cells become available upon unlocking the nuclear reactor.

Re: Ability to specify icon for 'nothing' technology effect?

Posted: Wed Jul 15, 2020 2:43 pm
by Reika
mrudat wrote:
Tue Jul 14, 2020 11:03 am
It would be nifty if it was possible to supply an icon for the 'nothing' technology effect, be that an `icons` parameter, a reference to some thing that has an icon, or perhaps something completely different.

As an example use-case, specifying that used-up uranium fuel cells become available upon unlocking the nuclear reactor.
This would be very nice.

Re: Ability to specify icon for 'nothing' technology effect?

Posted: Sat Jul 18, 2020 2:46 pm
by Rseding91
Sorry, this isn't going to happen. I looked at implementing this when I added the 'nothing' effect but because effects on technologies aren't linked to any specific prototype (they are just a list of things on a technology prototype - and can have multiple identical ones with different icons) there's no way to take the runtime actual effect instant and know what lua definition it came from to draw the icon.

Re: Ability to specify icon for 'nothing' technology effect?

Posted: Sun Jul 19, 2020 2:13 am
by Reika
Rseding91 wrote:
Sat Jul 18, 2020 2:46 pm
Sorry, this isn't going to happen. I looked at implementing this when I added the 'nothing' effect but because effects on technologies aren't linked to any specific prototype (they are just a list of things on a technology prototype - and can have multiple identical ones with different icons) there's no way to take the runtime actual effect instant and know what lua definition it came from to draw the icon.
What about something on the tech itself, then? Some kind of "effect icon override icon" or something?

Re: Ability to specify icon for 'nothing' technology effect?

Posted: Sun Jul 19, 2020 4:09 pm
by Rseding91
Reika wrote:
Sun Jul 19, 2020 2:13 am
What about something on the tech itself, then? Some kind of "effect icon override icon" or something?
That might be possible. I'll look into it and see what limitations and benefits it could have.

Re: Ability to specify icon for 'nothing' technology effect?

Posted: Tue Jun 08, 2021 3:26 pm
by eradicator
Rseding91 wrote:
Sun Jul 19, 2020 4:09 pm
That might be possible. I'll look into it and see what limitations and benefits it could have.
Did that ever lead anywhere? At least for the addon maybe?

Now that the vanilla character boni have these nice (unmoddable?) icons, the red cross of the nothing modifier looks even more jarringly out of place.

effecticons.png
effecticons.png (38.32 KiB) Viewed 1887 times

Re: Ability to specify icon for 'nothing' technology effect?

Posted: Tue Jun 08, 2021 3:47 pm
by Bilka
eradicator wrote:
Tue Jun 08, 2021 3:26 pm
Rseding91 wrote:
Sun Jul 19, 2020 4:09 pm
That might be possible. I'll look into it and see what limitations and benefits it could have.
Did that ever lead anywhere? At least for the addon maybe?

Now that the vanilla character boni have these nice (unmoddable?) icons, the red cross of the nothing modifier looks even more jarringly out of place.
It should be possible to specify the icons via the modifier, see https://wiki.factorio.com/Types/ModifierPrototype which Types/NothingModifierPrototype inherits from.

As described on Types/ModifierPrototype, if infer_icon is false, the icons come from the utility sprites (so, they are moddable). They are listed at the bottom of https://wiki.factorio.com/Prototype/UtilitySprites.

So, assuming I didn't make a mistake when writing the docs... moving from "Won't implement" to "Implemented" :)

Re: Ability to specify icon for 'nothing' technology effect?

Posted: Tue Jun 08, 2021 3:57 pm
by eradicator
Bilka wrote:
Tue Jun 08, 2021 3:47 pm
So, assuming I didn't make a mistake when writing the docs... moving from "Won't implement" to "Implemented" :)
Hah! You're too fast. I was just going to report back that it's actually implemented, but you already moved it! Nice to see another "that's never gonna happen" myth-busted :twisted:!

effecticons!.png
effecticons!.png (19.82 KiB) Viewed 1844 times