Jump to content

[LE] Can this be scripted somehow ?


Recommended Posts

I couldn't find anything online related to this... so i thought maybe a more experienced scripter here may know something.


I'm trying to make the lights to change its intensity "fade" on game time (shadow casting lights), like when you do with turning them on in the evening and turning them off in the morning (something that i know how to do).

I'm not very happy with the "set external emiter" option, if this could be done then it would be a very realistic lighting approach combining them both, external emiter + fade.


I have a second question.

If in one of my cells i add a vanilla "lighting template" and then i change some values, would this be registed as a dirty edit ?.

All my cells have custom made lighting templates except 3 (small ones), and i read somewhere that those are registed as dirty edits even if Tes5Edit dosen't detects them, is that true ?.



Many thanks in advance !.

Edited by maxarturo
Link to comment
Share on other sites

On your first question, yes this can be done with script - would require lots of latent functions though to update your fading lights, say 3 or 4 times a day. I supposed it would be ok in a custom interior cell, but trying to do that in the world might be too much.

 

Second question: not dirty edits per se, just custom modifications. As long as you create your own custom lighting templates, you're okay, just avoid editing Vanilla assets to ensure better compatibility with the thousands of other mods out here... ;)

Link to comment
Share on other sites

Thanks Hoamaii for replying.

I do mean to use those shadow casting lights only in interior cells. Would it be easy for you to point me to the right direction ?.

* Does the scripting way you mention also envolves a way to script the light's "Depth Bias" ?.

Edited by maxarturo
Link to comment
Share on other sites

Hmm... Not sure you can modify radius, intensity, warmth or depth bias with script, I've never done it (nor tried to). And the CK wiki lists only one skse function in "Light Script".

 

I'd guess you'd have to create a whole series of LightRefs placed in your interior cell, varying from high intensity and radius (noon for instance) to very dim (dawn and dusk), and disable/enable them in turn according to the time of day - say every game hour or so for instance. But you'd never achieve a very smooth fading of lights if that's what you have in mind, scripted enable(fade) or disable(fade) take about 1.5" to fade and it looks pretty abrupt in game. i'm not even sure Lights can fade when enabled or disabled. And that'd take a lot of testing to make sure you don't get bad flicker in game.

 

Dig in the CK wiki, there are plenty of scripts examples for manipulating lights and time - try a couple of these in your cell, that'll give you some idea of what can be done.

 

I'm not home right now, don't have all my files, but I did something like that in my Clearsky Hideout mod if you want to check it out. Nothing fancy, just dimming interior windows lights at nightfall and brightening them at sunrise, and did the same with the exterior windows to emit warm light when there was a fire lit inside the house (also disabling and enabling the outside chimney smoke with the interior fire). To get it slightly better looking, I also had to change the window glass textures according to the lights. A lot of work for... well, personal satisfaction :wink: ?.. It's okay if you don't pay too much attention to the moment it fades and I suppose it adds abit of realism to it all, but it's nothing near what it could be in real life.

 

I'll get you my scripts if you want.

Link to comment
Share on other sites

No to the last question, since it is an intended edit and does not actually edit the vanilla template itself.

Thanks Rasikko for replying.
I did some testing and checking and the values you change in the "edited cell" lighting template are save and used only by the cell itself.
So what i read turned out to be a wrong and false post.
Edited by maxarturo
Link to comment
Share on other sites

Hmm... Not sure you can modify radius, intensity, warmth or depth bias with script, I've never done it (nor tried to). And the CK wiki lists only one skse function in "Light Script".

 

I'd guess you'd have to create a whole series of LightRefs placed in your interior cell, varying from high intensity and radius (noon for instance) to very dim (dawn and dusk), and disable/enable them in turn according to the time of day - say every game hour or so for instance. But you'd never achieve a very smooth fading of lights if that's what you have in mind, scripted enable(fade) or disable(fade) take about 1.5" to fade and it looks pretty abrupt in game. i'm not even sure Lights can fade when enabled or disabled. And that'd take a lot of testing to make sure you don't get bad flicker in game.

 

Dig in the CK wiki, there are plenty of scripts examples for manipulating lights and time - try a couple of these in your cell, that'll give you some idea of what can be done.

 

I'm not home right now, don't have all my files, but I did something like that in my Clearsky Hideout mod if you want to check it out. Nothing fancy, just dimming interior windows lights at nightfall and brightening them at sunrise, and did the same with the exterior windows to emit warm light when there was a fire lit inside the house (also disabling and enabling the outside chimney smoke with the interior fire). To get it slightly better looking, I also had to change the window glass textures according to the lights. A lot of work for... well, personal satisfaction :wink: ?.. It's okay if you don't pay too much attention to the moment it fades and I suppose it adds abit of realism to it all, but it's nothing near what it could be in real life.

 

I'll get you my scripts if you want.

I've already checked the CK wiki and all the lights scripts are for "Non Shadow" casting lights, well they can be use with shadow casting but there is nowhere a scripting option to modify - set the "depth bias" which is the most important thing in what i'm trying to do, because when you change the "fade" so does the "depth bias" changes by itself giving you shadow straips or shadow displacements, if you don't set it correctly.
The only way i have come up with is to enable/disable lights, but here there is the issue of not having a smooth fade transition, plus when the enable/disable occours it's very noticable, especialy if the lights are casting in bright surfaces like glaciers or snow (in which those lights are meant to be placed, cave holes, cracks and openings of the interior cells from which you can see the sky).
I'm putting a lot of attention in the mod's environment (always taking in account the limitation that this particular game engine has) and i have created a global script that handles all aspects of it, like environmental sounds (OnLoop), environmental sounds FX (OnDelay), Generic ShaderParticleGeometry, ImageSpaceModifiers (using custom made modifiers to achieve a nice transitions from dark parts of the cell to brighter onces, something that can't be done in CK using just lighting templates & ImageSpace), ImageSpaceModifiers (fade in - fade out), VisualEffects, EffectShaders... just to give that detail to the environment that most players won't consciously perceive but will give a nice overall gaming experience to the player.
I'll check your "Clearsky Hideout " mod just to see if i can be inspired more from it.
* One part of my line of work involves creating photorealistic renderings of buildings and environments for construction companies, so that's the reason i'm so obsessed with those small details that at the end makes all the difference...
Thank you very much for your interest !.
Edited by maxarturo
Link to comment
Share on other sites

  • 1 year later...

Thread necro.

 

I am currently very interested in getting my interior cell lights to fade in and out more smoothly when enabled/disabled. No matter what timer I put on, MyLight.Enable(5.0) for example, the game seems to do nothing for 4.5 secs and then âpopsâ the light on in the last 0.5 secs (probably not what is actually going on, but that is what it looks like)

 

Is there a better solution to getting lights to enable / disable more fluidly?

 

Thanks.

Link to comment
Share on other sites

Some time after this conversation, a modder made an SKSE add on, "Papyrus Extension" i think it's called, that adds papyrus functions to change both 'light intensity' and 'depth bias'.


Unfortunately i can't post a link to that SKSE add-on because i lost all my bookmarks and i'm not even sure if that's the correct name of the add-on.

Link to comment
Share on other sites

@ TyburnKetch


Here is 1 link that has the papyrus function to manipulate the 'Depth Bias':

Get/SetLightDepthBias




This extension has also "Get/SetLightFOV", but it does not sets the intensity of the light, it just manipulates the 'Range', to get/set the light intensity you need another SKSE extension, which once again i don't remember the name or link.
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...