Realistic Reactor Glow

by ouk_ouk

The glow of working nuclear reactor has the proper color now!

Tweaks
3 years ago
0.16 - 1.1
8.66K

i Realistic reactors

5 years ago

Any idea whether or not this is compatible with realistic reactors as I feel these mods share a common goal.

5 years ago

It isn't at this moment. I tried to look at the code of realistic reactor once but the only result was headache. Probably because I don't know Factorio mod API all that much.
I might attempt it again in the future but don't get your hopes to high. I'm lazy as ... very lazy. Idn, maybe after release of 0.17 I will be hyped enough.

5 years ago
(updated 4 years ago)

So, I wanted to finally do this but it looks like new version of realistic reactors has proper light color even without my mod. Let's call this a success.

EDIT: This is no longer relevant because I've changed the color in my mod to pure blue.

4 years ago

RealisticReactor‘s reactor entities is deepcopy from table reactor_template (prototypes/entities.lua:line70)

All prototype included: reactor_normal{name = "realistic-reactor-normal"} reactor_power_normal{name = "realistic-reactor-power-normal"} reactor_breeder{name = "realistic-reactor-breeder"} reactor_power_breeder{name = "realistic-reactor-power-breeder"} temp_reactor{name = "realistic-reactor-"..<1-250>}

Their working_light_picture are transparent , and light base on prototypes/entities.lua:line225:reactor_normal.light = REACTOR_GLOW
REACTOR_GLOW is defined in data.lua (REACTOR_GLOW = {intensity = 0.7, size = 9.9, shift = {0.0, 0.0}, color = {r = 0.35, g = 0.8, b = 1.0}})

So.. If adapting by RRG, all the prototypes above need to be modified...:x
If adapting by RR, they just need to reference the RRG‘s nuclearReactorReactor.light.color once.

4 years ago

You are giving me a real workout here.
I think I understood over half of what you wrote. Unfortunately for you, this includes the last line so my laziness leaves me no choice but to put link to this on the Realistic Reactors discussion page and see what will happen.

If this won't work, I'll consider implementing this myself but names of some of this entities don't suggest that it is a stable API. I have a premonition that this may be an open gate for problems with mod compatibility.

4 years ago

Agree, active adaptation by RR is obviously the most appropriate. can avoid possible compatibility issues.

4 years ago

Quoting ouk_ouk: "I tried to look at the code of realistic reactor once but the only result was headache."
... I have the same problem ;)

It has been a while since I programed anything Factorio related, but if I understand muink correct, it should be relatively easy to include the RRG glow in the RR mod.
I think I can do something like...
IF RRG MOD IS PRESENT THEN
USE RGG GLOW
ELSE
USE DEFAULT GLOW
END

I'll look into it...

4 years ago

On second thought it might not be as easy as I thought...

The realistic reactor acually has no "working_light" (this is the base game reactor glow). What you see on the reactor are lamps that are supposed to show the status of the reactor (green = working, red = scram etc.). And I think we disabled the default green working light because it interfered with the glow of these lamps.

It might look different with the blue light though. But I can't reference RRG directly, because the RR reactor model is different, we changed it because of the water pipes connections (https://imgur.com/a/CK4xXBA).
Probably the easiest way to include the blue glow would be to change the picture with the blue lights, and include it and the RRG glow logic directly in the RR mod.

4 years ago

If you are willing to do that, I can add the picture of the realistic reactor light to my mod and provide some function to get the path to it. (I hope this kind of interaction is possible between mods.)

4 years ago
(updated 4 years ago)

This interaction is possible. Basically they just have to reference your mod's filename like __ realistic-reactors__/graphics/filename.png or you can make a function like

modded_picture = function () {"__realistic-reactors__/graphics/filename.png" }, but this would only work if you are sure the function gets loaded early enough in the data phase.

New response