Allow fuel_glow_color for non-fuels

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
danielbrauer
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Thu May 18, 2017 2:22 pm
Contact:

Allow fuel_glow_color for non-fuels

Post by danielbrauer »

I made DiscoScience, which makes labs light up with the colour of the items they are consuming. The main source of requests for the mod are to support ingredients from other mods. At the moment, this involves putting new ingredient colours in a giant compatibility table.

I would like other mod authors to be able to provide colours for DiscoScience. I saw that Prototype/Item has a fuel_glow_color, which is actually conceptually identical to what I want. The only problem is that it is not valid if the item is not a fuel, which means you can't attach this data to arbitrary items.

Would allowing fuel_glow_color without an item being a fuel be too much of a hack? Is there any more appropriate and generic way of decorating existing data types?

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 1944
Joined: Fri Nov 06, 2015 7:41 pm

Re: Allow fuel_glow_color for non-fuels

Post by Deadlock989 »

https://wiki.factorio.com/Prototype/Rec ... chine_tint , which is better than fuel_glow_color because it can specify four separate tints, but it doesn't work for labs or miners because those don't have recipes, working with items directly instead. I would rather that was extended to labs instead (I can't think of any use for it in miners unless you wanted to animate internal moving belts of ore or something, which I don't) but it would mean being able to specify crafting_machine_tint on items (or "tools" as science packs are internally) as well as recipes and that would create difficulties.

danielbrauer
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Thu May 18, 2017 2:22 pm
Contact:

Re: Allow fuel_glow_color for non-fuels

Post by danielbrauer »

That looks nice but the way Disco Science works is it composes a list of colours matching each ingredient. This can go to all seven science pack colours just in vanilla. Plus I think it would generally be a much bigger ask to have people annotate every recipe.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 1944
Joined: Fri Nov 06, 2015 7:41 pm

Re: Allow fuel_glow_color for non-fuels

Post by Deadlock989 »

Then just provide a hook to other modders. Any prototype, including items, can be given any arbitrary property - it's just that anything the base game doesn't use is discarded at the end of the data stage, so you can't access anything like that in the control stage. IR uses this for example, tagging certain item, recipe and technology prototypes so that other mods can recognise them as either originating them from IR or changing the way IR handles them. You could look in data-final-fixes for any science pack that has a property "Disco_Science_Colour" and take action based on that. The only caveat is that the other mods have to have set it up before you look for it.

If it's control stage you want, you could provide a remote interface for other mods to tell DS about their itamz.

danielbrauer
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Thu May 18, 2017 2:22 pm
Contact:

Re: Allow fuel_glow_color for non-fuels

Post by danielbrauer »

Thanks yes a remote interface sounds like the way to do it.

Post Reply

Return to “Modding interface requests”

Who is online

Users browsing this forum: No registered users