vfig on 19/5/2020 at 10:06
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.
(
https://www.dropbox.com/s/6g543hr0i4qinet/test_swapsky.zip?dl=1) test_swapsky.zip (Dropbox)
[video=youtube;CXzm1cOXUSA]https://www.youtube.com/watch?v=CXzm1cOXUSA[/video]
trefoilknot on 20/5/2020 at 13:49
Dope! I've been looking for a way to accomplish exactly this!
vfig on 20/5/2020 at 17:48
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: (
https://www.dropbox.com/s/tc09noknb35cylq/hlsky.zip?dl=1) 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 (
https://www.ttlg.com/forums/showthread.php?t=143190) 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.
GORT on 24/5/2020 at 23:43
@ vfig
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.
vfig on 25/5/2020 at 12:47
That's an interesting approach! Were there any downsides you encountered with it, like does it work with fog correctly?
Sperry on 25/5/2020 at 20:31
This is very cool; I was trying to achieve this age ago.