Jump to content

Night vision that is dim enough to discern light sources


Recommended Posts

So, I am trying to implement the favorite pastime of first-time DST modders and am making a custom character. The short story is that the character is meant to be able to see in the dark and gains a minor amount of sanity in it, but consequently its sanity plummets in any light source, in addition to outright burning in sunlight (without protection). I've gotten the sanity calculation for this down on my own and will be working on the sun-burning thing in the future, but I'm having an issue with the night vision.

To be specific, night vision is working too well. Everything seems to essentially be rendered in full brightness, which is a problem as I cannot discern light sources with night vision on, which makes the sanity drops from light sources seem borderline arbitrary. I've tried messing with color cubes and while I've noticed ghost vision color cubes do in fact make light sources barely discernible, it's not enough to really work out from a gameplay standpoint. Not to mention that the light needs to be really intense to be visible.

One part of this topic is essentially me asking if making custom color cubes is the way forward for making night vision work as I intend. I don't have any idea if it will work out as-is so for all I know I could be wasting my time, which is why I thought I'd inquire first. Failing that, is there some sort of way to configure it that I've missed?

Anyway, that's one avenue to finding a solution for this. I have also tried the classic method of simply applying grue immunity via the grue component (which works) and having a light source like so attached to my character:

local function common_postinit(inst)
    -- <Insert snipped irrelevant code here>
    
    --if not TheWorld.ismastersim then
        inst.entity:AddLight()
        inst.Light:Enable(true)
        inst.Light:SetRadius(32)
        inst.Light:SetFalloff(0.9)
        inst.Light:SetIntensity(0.4)
        inst.Light:SetColour(255/255,0/255,0/255)
    --end
end

But the problem here is that the light is server-side, which of course makes everyone able to see it and gain protection from Charlie - not to mention the fact that it also lowers my character's sanity, being a light source. As you can see by the comments, I've tried making the light client side... but it doesn't seem to do anything with the check enabled. The light doesn't show up. Am I doing something wrong?

And finally, if both of these options don't work out, I've simply considered drawing a ring around the effective radius of a light source, which would be ugly but would at least allow me to tell where they begin and end. That is assuming that I can do this. I'd look into that on my own if need be. I'm hoping that one of the solutions above could work before I resort to that, though.

In closing, is it possible to 'fix' night vision with color cubes, or to make a client-side light so I can at least fake it and still see (brighter) lights?

Link to comment
Share on other sites

I'd recommend looking in Woodie's file and use the beaver night vision. Or if you like the look of it the moggles. Both as you mentioned use color cubes instead of emitting light around the character so only the user can see it. Only thing I personally don't like about it is you can't really change the look of it.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...