use_fuel_glow_color doesn't seem to work

Place to get help with not working mods / modding interface.
Post Reply
Adamo
Filter Inserter
Filter Inserter
Posts: 479
Joined: Sat May 24, 2014 7:00 am
Contact:

use_fuel_glow_color doesn't seem to work

Post by Adamo »

A couple notes:

use_fuel_glow_color = false is commented out on the vanilla reactor -- is that intended? Does it default to true, or do I need to turn it on in data-updates to use it? It's not listed on the prototype/reactor page.

Also, the only item prototype I see that has a -- albeit commented-out -- fuel_glow_color is the nuclear-fuel item, which would never be used in a reactor. Is that a mistake or am I confused?

Issue:
I add "fuel_glow_color = {r=0,f=0,b=0.8a=0}" to the uranium-fuel-cell as well as my own fuel cell. I've tried several different colors, but just wanted to show the syntax. I set "use_fuel_glow_color = true" on nuclear-reactor in data-final-fixes, since I'm not sure this is default. This results in the reactor not making a working glow at all, and it does give the ambient glow at night, but not by the fuel value, just by the original light value of the reactor. I've tried removing the fuel value from the fuel cell and setting the default_fuel_glow_color, which gives the same non-glow result.

Am I doing something wrong or does this appear to be a bug?

Edit: I tried to disable the fuel glow stuff and make my own light mask from your grayscale, but now that I've done that, *the fuel glow mechanic appears to be working*. With use_fuel_glow_color = false.

posila
Factorio Staff
Factorio Staff
Posts: 5202
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: use_fuel_glow_color doesn't seem to work

Post by posila »

Adamo wrote:
Wed May 22, 2019 1:35 am
use_fuel_glow_color = false is commented out on the vanilla reactor -- is that intended? Does it default to true, or do I need to turn it on in data-updates to use it? It's not listed on the prototype/reactor page.
It defaults to false and is not used in vanilla, the commented line is there to "document" this property exists.
Adamo wrote:
Wed May 22, 2019 1:35 am
I add "fuel_glow_color = {r=0,f=0,b=0.8, a=0}" to the uranium-fuel-cell as well as my own fuel cell. I've tried several different colors, but just wanted to show the syntax. I set "use_fuel_glow_color = true" on nuclear-reactor in data-final-fixes, since I'm not sure this is default. This results in the reactor not making a working glow at all, and it does give the ambient glow at night, but not by the fuel value, just by the original light value of the reactor. I've tried removing the fuel value from the fuel cell and setting the default_fuel_glow_color, which gives the same non-glow result.
You don't see it working because vanilla sprites don't play nicely with tint (as it doesn't use use_fuel_glow_color). working_light_picture is completely green so it ever can be only less green. You need to change the sprite to be white in order for it be able to tint nicely.

The property was added by bobingabout so take a look at his Bob's mods to see how is he using it.

Bilka
Factorio Staff
Factorio Staff
Posts: 3135
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: use_fuel_glow_color doesn't seem to work

Post by Bilka »

Adamo wrote:
Wed May 22, 2019 1:35 am
Does it default to true, or do I need to turn it on in data-updates to use it? It's not listed on the prototype/reactor page.
It's listed now, it defaults to false. I'm not a wizard so I can't instantly update the wiki :p
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Adamo
Filter Inserter
Filter Inserter
Posts: 479
Joined: Sat May 24, 2014 7:00 am
Contact:

Re: use_fuel_glow_color doesn't seem to work

Post by Adamo »

I made my own sprite and got this to work, but it works when use_fuel_glow_color is set to false, not to true, so I suspect that this is flipped in the implemented code and may need to be corrected.

Bilka
Factorio Staff
Factorio Staff
Posts: 3135
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: use_fuel_glow_color doesn't seem to work

Post by Bilka »

Adamo wrote:
Wed May 22, 2019 12:34 pm
I made my own sprite and got this to work, but it works when use_fuel_glow_color is set to false, not to true, so I suspect that this is flipped in the implemented code and may need to be corrected.
It is not flipped in the code.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Adamo
Filter Inserter
Filter Inserter
Posts: 479
Joined: Sat May 24, 2014 7:00 am
Contact:

Re: use_fuel_glow_color doesn't seem to work

Post by Adamo »

Bilka wrote:
Thu May 23, 2019 2:39 pm
Adamo wrote:
Wed May 22, 2019 12:34 pm
I made my own sprite and got this to work, but it works when use_fuel_glow_color is set to false, not to true, so I suspect that this is flipped in the implemented code and may need to be corrected.
It is not flipped in the code.
Thanks for responding. I'll check back in my code to be sure I didn't make a mistake, but I'm pretty confident I have it set to use_fuel_glow_color = false and the fuel glow color is still being applied.

Adamo
Filter Inserter
Filter Inserter
Posts: 479
Joined: Sat May 24, 2014 7:00 am
Contact:

Re: use_fuel_glow_color doesn't seem to work

Post by Adamo »

Bilka wrote:
Thu May 23, 2019 2:39 pm
Adamo wrote:
Wed May 22, 2019 12:34 pm
I made my own sprite and got this to work, but it works when use_fuel_glow_color is set to false, not to true, so I suspect that this is flipped in the implemented code and may need to be corrected.
It is not flipped in the code.
Here is the relevant code in data-final-fixes.lua:

Code: Select all

data.raw.item["uranium-fuel-cell"].fuel_value = "1200GJ"
data.raw.item["uranium-fuel-cell"].icon_size = 32
data.raw.item["uranium-fuel-cell"].icon = 
	"__adamo-nuclear__/graphics/icons/urania-fuel-cell.png"
data.raw.item["uranium-fuel-cell"].group = "nuclear-group"
data.raw.item["uranium-fuel-cell"].subgroup = "adamo-nuclear-products-group"
data.raw.item["uranium-fuel-cell"].order = "a"
data.raw.item["uranium-fuel-cell"].fuel_glow_color = {r = 0,g = 0.2,b = 0.8,a = 0.4}

data.raw.item["used-up-uranium-fuel-cell"].icon_size = 32
data.raw.item["used-up-uranium-fuel-cell"].icon = 
	"__adamo-nuclear__/graphics/icons/used-up-urania-fuel-cell.png"
data.raw.item["used-up-uranium-fuel-cell"].group = "nuclear-group"
data.raw.item["used-up-uranium-fuel-cell"].subgroup = 
	"adamo-nuclear-reprocessing-group"
data.raw.item["used-up-uranium-fuel-cell"].order = "a"



local reactor_item = data.raw.item["nuclear-reactor"]
local reactor = data.raw.reactor["nuclear-reactor"]

reactor_item.icon = "__adamo-nuclear__/graphics/icons/nuclear-reactor.png"
reactor.light.intensity = 1
reactor.light.color = {r = 0,g = 0.3,b = 1,a = 1}
reactor.working_light_picture = {
	filename = "__adamo-nuclear__/graphics/entity/nuclear-reactor/reactor-lights-color.png",
	width = 160,
	height = 160,
	shift = { -0.03125, -0.1875 },
	blend_mode = "additive",
	hr_version =
	{
		filename = "__adamo-nuclear__/graphics/entity/nuclear-reactor/hr-reactor-lights-color.png",
		width = 320,
		height = 320,
		scale = 0.5,
		shift = { -0.03125, -0.1875 },
		blend_mode = "additive"
	}
}

reactor.use_fuel_glow_color = false
And in data.lua:

Code: Select all

local mox_item = {
	type = "item",
	name = "adamo-nuclear-MOX-fuel-cell",
	group = "adamo-nuclear-group",
	subgroup = "adamo-nuclear-products-group",
	order = "c",
	--subgroup = "intermediate-product",
	--order = "r[uranium-processing]-n[adamo-nuclear-MOX-fuel-cell]",
	stack_size = 50,
	icon = "__adamo-nuclear__/graphics/icons/MOX-fuel-cell.png",
	--icon_size = 64,
	--icon = "__base__/graphics/icons/uranium-fuel-cell.png",
	icon_size = 32,
	fuel_category = "nuclear",
	fuel_value = "4800GJ",
	burnt_result = "adamo-nuclear-used-up-MOX-fuel-cell",
	fuel_glow_color = {r = 0,g = 0.3,b = 0.8,a = 0.4}
		--color = {r = 0,g = 0.2,b = 0.8,a = 0.4}
}
I know my fuel values seem insane, but they're based on 1 unit of water being 50ml (based on the heat capacity value). Don't judge me for that. :) They actually come out to be about the same amount of energy per ore used as the base game.

Here is a picture of the reactors side-by-side:
reactor_color_glow.png
reactor_color_glow.png (641.25 KiB) Viewed 1532 times
The right two reactors are using MOX fuel cells. The difference is slight (by design), but they have slightly more green. When I pick the same point with gimp's color picker on two of the reactors using different fuel types I get 1d55af for one, and 1e59a2 for the other. Although, since they don't pulsate at the same time, I guess that isn't helpful. It was more obvious when the difference in color was more pronounced, but it's there.

Post Reply

Return to “Modding help”