Changing the skybox in-game.

Darksoul

L1: Registered
Jul 6, 2009
35
13
Greetings,

Our server runs the Themes v0.8 plugin that allows the server to change the theme of the map while playing, it even loads particles. I have no idea how J-factor does what he does, but I'm sure I've seen the weather change from dustbowl to viaduct and then...mess up and I saw it happen while playing on the same map.

My question is:

Is there a way to create a map that will change the theme: ligthing, fog, shadows and skybox, on my command?

I have been experimenting and I have been able to change the fog, emulating the control scheme that Valve provided with the 2Fort map; and I like to believe the light_enviroment can be tinkered with too.

However I'd really like to know if I can change the skybox texture too; with triggers of course. What I'm trying to accomplish is a map that can host several themes at the same time; by dynamically changing the theme when the player enters a given area; I believe this concept will go well with a gametype I'm "developing".

Creating a custom skybox that holds the several transitions from one theme to another is beyond me; the creative obstacle is insurmountable for me but if there's a technical way for me to exploit the engine to change between existing skyboxes; I will try to learn it.

Any help and ideas are welcomed, but I'll finish the layout and get the gametype working for the next map; before even attempting to add fog controllers; I really need to work on a different map other than Lumbercamp, or I'll never finish it.
 
Last edited:

Dr. ROCKZO

L8: Fancy Shmancy Member
Jul 25, 2009
580
159
From what I understand, I don't think so, as Fog and Lights are controlled by in-game entities and the Skybox is pretty much a brush and texture that is compiled from the .vmf.

I may be wrong however, and would be very interested in this topic if I was..
 

Jindo

L3: Member
Aug 6, 2009
121
123
The Themes plugin changes everything right at the map's start (when it is loaded), I don't know about integrating such a feature with a map itself, but with Sourcemod plugins I don't think you can change the skybox on the spot.

---

If you're at all interested, I wrote something small and similar to the Themes plugin which simply darkened all of the maps on my server for the duration of this halloween period, screenshots:

pl_goldrush0022.jpg

pl_goldrush0023.jpg


---

Also, I can tell you that it is possible to change lights to an extent. You can't change the genuine lighting or shading of the map because as people have said already in this thread, that stuff is built in to the compiled version of the map. However, there is an entity I've seen in vmf files which appears with the light_spot entity called the 'point_spotlight' entity, from what I can tell this entity creates the light beam and I've been successful in manipulating the colour and other aspects of this.
 

Bermuda Cake

L9: Fashionable Member
Feb 20, 2009
679
480
oooh, killing joke server!
I would be interested in this as well, imagine a dustbowl style map where the time of day changes as you go through the map...
 

Jindo

L3: Member
Aug 6, 2009
121
123
I would be interested in this as well, imagine a dustbowl style map where the time of day changes as you go through the map...

For me that's the next step, and it's already possible with the Themes plugin, but I'm attempting to recreate it in such a way that players won't have to download anything from my server before playing (which would mean no custom particles/colour correction).

Actually, IIRC you can mess with the colour correction
http://developer.valvesoftware.com/wiki/Color_correction
If you are using an external mod, it shouldn't be that hard.

Yes, this is also achieved in the Themes mod, although I don't know if there are any premade color correction files in TF2, the Themes mod had its own (which again you would have had to have downloaded, but they made things like night-time and under water look so much better)

sv_skyname <sky_name>
list of tf2 skies

Ha, I had no idea there was a cvar to do that.
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
It's possible because the plugin does it on map load. Servers can override any entity settings without the clients having issues, because the server has authority on entity status.
You cannot change the skybox mid-map. You cannot change the lighting, that is completely baked into the map. Lighting effects like the beam/glow can be, but they won't match the actual light and it would look bad. Though from those screenshots, it doesn't look like he gives a damn about it looking bad <_< What the hell was he thinking? Green fog?
 

Jindo

L3: Member
Aug 6, 2009
121
123
Though from those screenshots, it doesn't look like he gives a damn about it looking bad <_< What the hell was he thinking? Green fog?

After I saw the green fog in-game it barely lasted 10 minutes before I changed it (I had no idea what the outcome of my code would be before hand)

The sky is now purple and the fog is now dark bluey/purple and no where near as strong (just saying <_< >_>).
 
Last edited:

Jindo

L3: Member
Aug 6, 2009
121
123
Just tested, and no.

The description says "current name of the skybox texture", so I'm assuming it's intended as read-only and doesn't actually do anything.
 

Bermuda Cake

L9: Fashionable Member
Feb 20, 2009
679
480
What the hell was he thinking? Green fog?

it was for haloween.
would it be possible to change in between rounds?
Or, like have two skyboxes, and one of them disappears on round end?
Or is this doomed to fail because of some intrinsic design of the source sdk :)O) ?
 

Jindo

L3: Member
Aug 6, 2009
121
123
Or, like have two skyboxes, and one of them disappears on round end?

Correct me if I'm wrong, I haven't used Hammer in a while now:

You have one skybox, defined in the map's settings in Hammer; there's no way to have more than one skybox or adjust it in-game, once the map is loaded that's it, so you can only change the skybox on map start with a plugin (or use sv_skyname in single player!)

You could always ask Valve, although I'm not entirely sure if they'd want to adjust such a thing or how easy it would be considering they've managed absolutely fine for over a decade without the need to change a skybox mid-map.
 

lana

Currently On: ?????
aa
Sep 28, 2009
3,075
2,778
You could, however, create a func_illusionary with the skybox textures. It'd look like shit as well and wouldn't work that great either.
 

Darksoul

L1: Registered
Jul 6, 2009
35
13
It seems that it's really not possible, unless the skybox texture it self hosts all the themes at the same time. When it comes to the light_env entitiy, since it cannot be altered midgame; the best solution would be to create a set of ligthing parameters that are "neutral", and tinker the theme of the map with fog controllers and "low level" ligthing. The neutral of the parameters light_env would have to picked in such way they work well with the other fog themes...hmm, but as usual that's me talking crazy.