Project Zomboid

Project Zomboid

Lantern
Slooth  [開發人員] 2022 年 12 月 28 日 上午 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
< >
目前顯示第 1-2 則留言,共 2
Slooth  [開發人員] 2022 年 12 月 28 日 上午 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 2024 年 5 月 6 日 下午 7:17 
Hi, after such long period.. still no mod options for changing light color yet ?
< >
目前顯示第 1-2 則留言,共 2
每頁顯示: 1530 50