Project Zomboid

Project Zomboid

Lantern
Slooth  [developer] 28 Dec, 2022 @ 1:18am
Adjusting Attached Lighting Color
local lightByPlayer = {}

local workingGlowSticksData = {}
workingGlowSticksData["AuthenticGlowstick_Blue_On"] = { 0.0, 0.0, 1.0 }
workingGlowSticksData["AuthenticGlowstick_Red_On"] = { 1.0, 0.0, 0.0 }
workingGlowSticksData["AuthenticGlowstick_Green_On"] = { 0.0, 1.0, 0.0 }
workingGlowSticksData["AuthenticGlowstick_Purple_On"] = { 1.0, 0.0, 1.0 }
workingGlowSticksData["AuthenticGlowstick_Yellow_On"] = { 1.0, 1.0, 0.0 }
workingGlowSticksData["AuthenticGlowstick_Orange_On"] = { 1.0, 0.50, 0.0 }
workingGlowSticksData["AuthenticGlowstick_Pink_On"] = { 1.0, 0.0, 0.25 }


local function updateLight(player, item, position)
local color = workingGlowSticksData[item:getType()]

lightByPlayer[player][position] = IsoLightSource.new(player:getX(), player:getY(), player:getZ(), color[1], color[2], color[3], 4)
getCell():addLamppost(lightByPlayer[player][position])
end
< >
Showing 1-2 of 2 comments
Slooth  [developer] 28 Dec, 2022 @ 1:22am 
Looks like its actually creating a new lightsource on the cell the player is occupying. Which is probably what the vanilla game does but as is does not seem to be modifying the base lighting values for the attached flashlights, etc on the player. This would work but it would be kinda of a worse case scenario I think.
BlackWater821 6 May, 2024 @ 7:17pm 
Hi, after such long period.. still no mod options for changing light color yet ?
< >
Showing 1-2 of 2 comments
Per page: 1530 50