If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Swappable skyboxes

Over in the discord, Schlock asked, "is there a good way to change the skybox while the mission is being played?"

My best understanding is that changing the newsky during a mission is not possible. But it is possible, using NewDark materials, to render a non-sky material as a skybox with a cubemap texture. And if, instead of hardcoding the cubemap texture name in the .mtl, you use one of the envmap zones to specify the texture, then a script can dynamically change this skybox while running.

Pros:

Can change skyboxes

Can maybe even use animated skybox textures (although I've not tried)

Can have different skyboxes in different areas of the map, even indoors.

Cons

Can't have newsky effects in this fake sky: so no distant art, no celestial objects, no cloud deck

You can't have weather effects under this fake sky, as preciptation only spawns underneath SKY_HACK

You can't use fog in areas with this fake sky: it looks terrible, as the brushes fog up like ordinary walls, not like a proper sky

You can't use sunlight in areas with this fake sky: it's only cast from SKY_HACK.

Here's a demo mission (T2, requires NewDark 1.26 or later). Note: because I'm lazy, I just added a .mtl for the cave texture. You should probably use your own fam instead.

There's some more discussion on potential uses and caveats over in #scripting in Discord. Also a second test map, which changes both the skybox and lighting when you walk in and out of a room: hlsky.zip (Dropbox). It's basically a quick hack to begin exploring the possibilities—and weaknesses—of using animlights instead of sunlight.

For future reference, there’s a good—if short—discussion in this thread on simulating daylight changes by varying the mission’s lighting, and two missions that do this: Midday Eclipse and Mine Saga's End.

That's pretty cool. I have an other way of changing the sky.
EX: I was getting annoyed by how the distant art wouldn't cover the bottom end of the sky correctly. So, here's what I did.

1.) I make my usual newsky settings.
2.) I created a half sphere-like object that has my desired distant art.
3.) I have the object physically attached to the player.

This is how I got the background mountain range set in the 10th mission of TROTB 2. Now with this idea in mind, theoretically you can have this object with joint sections for like clouds and what not. Also, you could have the object change according to what roombrush the player is in. Therefore, you could make multiple custom sky objects. I think I'll do something like this in one of my future FMs.