Teardown-Issue-Tracker-Maintainers / Teardown-Issue-Tracker

A public repo for the community to track issues/bugs/feature requests in Teardown.
12 stars 5 forks source link

[Bug] Setting Skybox Brightness & SetLightEnabled doesn't work #251

Open vulcan-dev opened 2 years ago

vulcan-dev commented 2 years ago

Describe the bug

I'm iterating through all lights and doing SetLightEnabled(light, false) but it doesn't work if I call SetEnvironmentProperty("skyboxbrightness", any_num) (either before or after).

Here's the full code for the lights

    local lights = FindLights("", true)
    DebugPrint("lights: " .. #lights)
    for i=1, #lights do
        local light = lights[i]
        if GetLightShape(light) then
            SetShapeEmissiveScale(GetLightShape(light), 0) -- testing
        end
        SetLightEnabled(light, false)
    end

    SetEnvironmentProperty("skyboxbrightness", 30)

SomeWhatSavageGaming told me to remove the tag nightlight from them all but that didn't work either so I'm not exactly sure if I'm missing something or if it's an actual issue.

Steps to reproduce the behavior

  1. Create a simple mod that contains the above code, you can make it execute on a button press.
  2. Watch the street lights/lamp posts lights stay active

Expected behavior

I would expect it to turn the lights off

Environment

Additional context

No response

Please-Pick-a-Name commented 2 years ago

have you tried SetEnvironmentProperty("nightlight", false)?

vulcan-dev commented 2 years ago

have you tried SetEnvironmentProperty("nightlight", false)?

I have not no, didn't know that was a thing. I'll try it later and let you know 👍

YuLun-bili commented 9 months ago

have you tried SetEnvironmentProperty("nightlight", false)?

Adding this does disables all lights but the bug submitted is still quite interesting.

test script:

function tick()
    if not InputDown("backspace") then return end
    local lights = FindLights("", true)
    for i=1, #lights do
        local light = lights[i]
        SetLightEnabled(light, false)
    end

    local nightLights = FindLights("night", true)
    for i=1, #nightLights do DrawShapeOutline(GetLightShape(nightLights[i]), 1, 0.45, 0, 1) end

    -- SetEnvironmentProperty("nightlight", false)
    SetEnvironmentProperty("skyboxbrightness", 0)
end