DocGnuss Posted July 23, 2021 Share Posted July 23, 2021 Hi, I have a problem with adding night vision in caves My character, in theory, should see well in caves (that is, cave night vision) But at the moment there is something wrong with my code and instead of night vision it BLOCK THE CAVES! I mean the character literally can't be in the caves anymore... Please help fix this 1627029793385_wuffy.lua Link to comment https://forums.kleientertainment.com/forums/topic/132093-need-help-with-night-vision-in-caves/ Share on other sites More sharing options...
Monti18 Posted July 26, 2021 Share Posted July 26, 2021 The caves crash, that's why you're not able to go in them. You need to have a look at the server log of the caves to see why it crashed. There you would find this error: 120: variable 'NIGHTVISION_PHASEFN' is not declared If you have a look at your prefab, you can see that you added NIGHTVISION_PHASEFN, but you don't declare it anywhere. 1 Link to comment https://forums.kleientertainment.com/forums/topic/132093-need-help-with-night-vision-in-caves/#findComment-1481731 Share on other sites More sharing options...
Maxsar Posted August 16, 2021 Share Posted August 16, 2021 maybe try that local NIGHTVISION_COLOURCUBES = { day = "images/colour_cubes/day05_cc.tex", dusk = "images/colour_cubes/dusk03_cc.tex", night = "images/colour_cubes/ruins_light_cc.tex", full_moon = "images/colour_cubes/purple_moon_cc.tex", } local function NightVision(inst, enable) if TheWorld.state.isnight or TheWorld:HasTag("cave") then inst.components.playervision:ForceNightVision(true) inst.components.playervision:SetCustomCCTable(NIGHTVISION_COLOURCUBES) else inst.components.playervision:ForceNightVision(false) inst.components.playervision:SetCustomCCTable(nil) end if TUNING.NIGHT_VISION == false then inst.components.playervision:ForceNightVision(false) inst.components.playervision:SetCustomCCTable(nil) end end it works for me Link to comment https://forums.kleientertainment.com/forums/topic/132093-need-help-with-night-vision-in-caves/#findComment-1486540 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now