Jump to content

[question][creationkit] Changing the cell lightning based on conditions during gameplay?


worik

Recommended Posts

Posted

I can set the light conditions for my interior cell in the Cell Lightning tab.

This seems to be a static setting.

I can set fog for this cell with the cell script. But I didn't find a way in the CK wiki to set the light during gameplay

 

What I want to do is to change the light setting of my interior cell dynamically, depending on player actions and quest stages.

 

I could add more lightsources and switch between them, but there must a be a way to access the settings in the Cell Lightning tab.

Especially:

  • Ambient light colour
  • Light fade distances

 

Anybody has an idea? :classic_huh:

 

Posted

Check out PO3 Extender

 

Spoiler

    ;-------
    ;SETTERS
    ;-------
    
    ;Sets light radius (minimum light radius is 16)
    function SetLightRadius(Light akLight, float radius) global native
    
    ;Sets light fade range.
    function SetLightFade(Light akLight, float range) global native
    
    ;Sets light color.
    function SetLightColor(Light akLight, ColorForm akColorform) global native
    
    ;sets base light FOV
    function SetLightFOV(Light akLight, float FOV) global native
    
    ;sets depth bias on light reference. Creates new depth bias extradata on lights that don't have it set.
    function SetLightShadowDepthBias(ObjectReference akLightObject, float depthBias) global native
    
    ;Sets light type. Does not persist between sessions.
    function SetLightType(Light akLight, int lightType) global native

 

Posted
51 minutes ago, Yinkle said:

Check out PO3 Extender

That looks like the thing I was missing. But using it would make it a prerequisite to work for everybody, right ?

 

1 hour ago, Alter Native said:

https://forums.nexusmods.com/index.php?/topic/8170278-enable-sky-lightning-dynamically/

That's an interesting thread.... not exactly what I hoped to do, but even from first glance I got some ideas... ?

Posted
1 hour ago, Alter Native said:

I have never experimented with rooms until now.

 

Using it would require 2 things,

  1. I would need to attach a lightning template or an ambient light setting somehow to a room
  2. I would need to toggle various rooms in exactly the same position on and off or switch between them  in fact, the rooms would enclose all of the objects in the cell)

?

My story idea would need 3 different sets of light in that cell, so the fiddling with rooms in the identical position could still be manageble in the clunky CK...

 

 

Edit: I didn't understand the weather trick, yet.

:classic_unsure: call it a severe lack of :coffee: . (Will do a jogging round now and try again later to understand that)

Posted
1 hour ago, worik said:

I have never experimented with rooms until now.

 

Using it would require 2 things,

  1. I would need to attach a lightning template or an ambient light setting somehow to a room
  2. I would need to toggle various rooms in exactly the same position on and off or switch between them  in fact, the rooms would enclose all of the objects in the cell)

?

My story idea would need 3 different sets of light in that cell, so the fiddling with rooms in the identical position could still be manageble in the clunky CK...

 

 

Edit: I didn't understand the weather trick, yet.

:classic_unsure: call it a severe lack of :coffee: . (Will do a jogging round now and try again later to understand that)

Enabling and disabling rooms doesn't work.

I know I wrote it in the thread as an idea, but I have tested it since then and it crashed my game. 

 

What you always can do is enable/disable lights placed based on a events etc. with a script.

But if you want to change the ambient etc. you need to do it via weathers.

 

 

Posted
1 hour ago, worik said:

That looks like the thing I was missing. But using it would make it a prerequisite to work for everybody, right ?

Yup it would make your mod dependent on PO3 and therefore skse too. But if you want to change fade values etc via script this is the only way to do it afaik.

Posted
54 minutes ago, Yinkle said:

Yup it would make your mod dependent on PO3 and therefore skse too.

That's unfortunate :classic_unsure:. SKSE is fine with me, but I would much more prefer PO3 to be an integrated part of standard SKSE or even Ashal's PapyrusUtil.

Regardless: Many thanks for the link. ? It still looks like it would do exactly what I'm looking for.

Note to myself: Organize a petition that it will become part of PapyrusUtil NG :angel:

 

1 hour ago, Alter Native said:

What you always can do is enable/disable lights placed based on a events etc. with a script.

That was my fallback plan.

OK,  back to that weather thing of yours, which I still need to understand.

 

Let me try it with my own words:

  • I create my 3 dedicated weathers to set the light conditions for the 3 mood setting that I want to have
    • make sure the light colours are all the same for each time of the day to work around te day/night cycle (Isn't that done llike this in the Soul Cairn? ? )
    • disable clouds, no wind, no sun
    • no precipitation, classify weather as "none" to avoid stupid NPC comments/behavious
  • I create a dedicated region and add the 3 weathers to it
  • I create my interior cell, enable "Show Sky"
    • select my region from above
    • enable  "use sky lightning"
  • When the PC enters the cell I forceactive() the correct weather

? Something like this ?

That leaves me with one follow-up question. How would I stop Skyrim from accidentially switching the weather while the PC is still in that cell?

Posted
23 minutes ago, worik said:

Let me try it with my own words:

  • I create my 3 dedicated weathers to set the light conditions for the 3 mood setting that I want to have
    • make sure the light colours are all the same for each time of the day to work around te day/night cycle (Isn't that done llike this in the Soul Cairn? ? )
    • disable clouds, no wind, no sun
    • no precipitation, classify weather as "none" to avoid stupid NPC comments/behavious
  • I create a dedicated region and add the 3 weathers to it
  • I create my interior cell, enable "Show Sky"
    • select my region from above
    • enable  "use sky lightning"
  • When the PC enters the cell I forceactive() the correct weather

? Something like this ?

That leaves me with one follow-up question. How would I stop Skyrim from accidentially switching the weather while the PC is still in that cell?

Yes like this. Check my Karlov Manor mod, the Villa in the High Rock worldspace. This is where I have used that method to create a seamless transition between interior and exterior areas.

> How would I stop Skyrim from accidentially switching the weather while the PC is still in that cell?

 

forceactive() has a flag that prevents the game from switching the weather.

You need to release the weather on cell unload again if you do that.

That concept was btw. used in Blackreach (more or less).

It looks like an interior cell, with the dark green feeling area, but it is an exterior cell with the lightning being a weather.

However the weather never changes and it looks the same during day and night.

Also you can set a climate that tells which weather is allowed in the region you're in.

 

 

Posted
18 minutes ago, Alter Native said:

forceactive() has a flag that prevents the game from switching the weather.

:classic_happy: I won't get it done today, but that's what I test next weekend.

Thank you !

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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