UnSocketed PowerNode Lighting Mod
as it came up several times in the past years i thought i took a look into it.
All rooms at round start are fully lit. even if there isnt a powernode. as many people do, i also think the rooms without a powernode should be dark, maybe not pitch black, but not fully lit either.
so i startet looking into lua. with only basic knowledge of C++ it took me a few hours to find the right spots in the code but i managed to change the LightMode that gets assigned to all the nodes at roundstart that are not marine-start.
LightMode.NoPower was bad, the whole map in red light is just not pretty at all. but LightMode.LowPower was good, a normal white light just getting darker and brighter again.
the LowPower setting was just not dark enough for a "unpowered" room and i didnt want to make it darker, because it also kicks in if a powernode is damaged.
so i came up with this:
if not self.handler.powerPoint:GetIsPowering() then
minIntensity = 0.1
halfIntensity = 0.65
scalar = math.cos((timePassed / kLowPowerCycleTime) * math.pi / 2)
end
and embedded it into the LightMode.LowPower. it makes the light pulse slower and darker in general, but only if the PowerNode is unable to power Buildings(as in "unsocketed").
now to my question: its a small simple code-change, should i realy publish it as a mod? and how could i seperate it into a own file, as of now it changes PowerPoint.lua and PowerPointLightHandler.lua?
as a note: it only affects powernodes in the beginning of the round. in a running game there are no unsocketed or unbuilt powernodes that run LightMode.LowPower.
All rooms at round start are fully lit. even if there isnt a powernode. as many people do, i also think the rooms without a powernode should be dark, maybe not pitch black, but not fully lit either.
so i startet looking into lua. with only basic knowledge of C++ it took me a few hours to find the right spots in the code but i managed to change the LightMode that gets assigned to all the nodes at roundstart that are not marine-start.
LightMode.NoPower was bad, the whole map in red light is just not pretty at all. but LightMode.LowPower was good, a normal white light just getting darker and brighter again.
the LowPower setting was just not dark enough for a "unpowered" room and i didnt want to make it darker, because it also kicks in if a powernode is damaged.
so i came up with this:
if not self.handler.powerPoint:GetIsPowering() then
minIntensity = 0.1
halfIntensity = 0.65
scalar = math.cos((timePassed / kLowPowerCycleTime) * math.pi / 2)
end
and embedded it into the LightMode.LowPower. it makes the light pulse slower and darker in general, but only if the PowerNode is unable to power Buildings(as in "unsocketed").
now to my question: its a small simple code-change, should i realy publish it as a mod? and how could i seperate it into a own file, as of now it changes PowerPoint.lua and PowerPointLightHandler.lua?
as a note: it only affects powernodes in the beginning of the round. in a running game there are no unsocketed or unbuilt powernodes that run LightMode.LowPower.
Comments