Project Zomboid

Project Zomboid

Lantern
Slooth  [udvikler] 28. dec. 2022 kl. 1:18
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
< >
Viser 1-2 af 2 kommentarer
Slooth  [udvikler] 28. dec. 2022 kl. 1:22 
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. maj 2024 kl. 19:17 
Hi, after such long period.. still no mod options for changing light color yet ?
< >
Viser 1-2 af 2 kommentarer
Per side: 1530 50