Jump to content

Set Interior Cell Lighting (e.g. Show Sky) via script?


Recommended Posts

If I want to make an interior cell with a retractable roof, is there a way to change, via script, certain flags on the Cell > Lighting tab? e.g. "Show Sky", "Use Sky Lighting", and "Sunlight Shadows".

 

For example, there would be a terminal in the interior cell. It would have 2 terminal entries: 1) Retract Roof, and 2) Close Roof. So the player could open or close the roof by using the terminal. When the roof is open, it shows the sky, when the roof is closed, it doesn't.

 

The first part of the script fragment attached to the terminal entry would enable/disable the roof, but then I'm stuck on the second part, i.e. getting the "Show Sky" and its two sub options, "Use Sky Lighting" and "Sunlight Shadows", to work, and being able to switch back and forth via terminal.

 

Appreciate any suggestions, thanks!

Link to comment
Share on other sites

To my knowledge, there's no function which will let you change cells' flags via script, but what you have in mind can be done just with the disable/enable functions. You set your cell to "show sky", and when the the roof is enabled, player won't see it anyway. As for lights and shadows, you can't keep the flags "Use Sky Lighting" and "SunlightShadows", instead you'd have to place actual light forms in your CK's cell, above the roof, and enable them when the roof is disabled (or rather, before the roof is disabled). Did that in a tent in Skyrim, although honestly placing different markers of light to simulate the sun's course and disabling/enabling it on a timer update was a little bit of a drag but it doesn't look that bad, especially since nobody keeps looking up all the time. Transitions are a bit abrupt but in many ways they are in the base game too, shadows change and move a rather jerky manner in game, not much different than the translateTo(...) function, and you can try various speeds.

 

A lot of work, I know, but unless I missed something, once they've been set and loaded once, cell's flags can't be changed. But keep in mind the only time I tried to do that was in Skyrim, not in Fallout4.

Link to comment
Share on other sites

@Thuggysmurf: I'll echo what Hoamaii has said. I've done more less what you're describing in my Slog Diner mod but had an activator button to control a sliding skylight door instead of a terminal. Once you have the "Show Sky" box checked, leave all the other settings in that section alone. Don't choose a region unless you want the same sky/weather conditions to be present all the time. If that's the case, choose DefaultInteriorRegion. Pretty sure that's what the Boston Public Library and Museum of Freedom cells use. I prefer to have my interior skies reflect weather conditions that are present when you enter the cell from the outside.

 

Here's what I do and it always works: create a new Location for your interior cell and in the Parent Location tab assign the Location of the exterior cell load door the best you can. Some places don't have a specific Location so you may have to just use Commonwealth for example.

 

I think that's what tells the game to replicate exterior weather visuals and sounds inside, but am just guessing. It always gives me the intended result. Also, this is why you don't want to check those "Use Sky Lighting" and "Sunlight Shadows" boxes. With those checked, the exterior weather conditions tend to actually occur inside. Unchecked, you get all the sights and sounds of a radstorm if one is present in the world, but without taking rads for example.

Edited by RedRocketTV
Link to comment
Share on other sites

Thanks Hoamaii and RedRocket.

 

Went with "Show Sky" and passed on "Use skylighting" and "Sunlight Shadows". Seems to work well enough so far and is avoiding taking Radiation damage indoors during a Radstorm.

 

Will have to give the custom lights on timers a try, although not sure how that's gonna work with day/night length mods, e.g. in my game it's only dark 4 hours a night, and the Commonwealth settings for day/night length appear to be what is controlling the sunrise and sunset times in the interior cell.

 

Was using "FXDiamondSky" for the region sky. Switched it to "none" and that is working too.

 

BTW, RedRocket, I stumbled across your Precombine/Previs tutorial on YouTube the other day. Well done and super helpful!

Link to comment
Share on other sites

In retrospect, it's entirely possible I has a region selected when I was getting weather effects in the interior cell. Too long ago for me to remember the exact settings I had, but I do know deactivating the Use Sky Lighting and it stopped. Getting sandstorms in the cell was not what I had planned. :D

 

Glad you found the tutorial helpful!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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