Changing the skybox in-game.

Discussion in 'Mapping Questions & Discussion' started by Darksoul, Nov 1, 2009.

  1. Darksoul

    Darksoul L1: Registered

    Messages:
    35
    Positive Ratings:
    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: Nov 1, 2009
  2. Dr. ROCKZO

    Dr. ROCKZO L8: Fancy Shmancy Member

    Messages:
    580
    Positive Ratings:
    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..
     
  3. Cameron:D

    Cameron:D L6: Sharp Member

    Messages:
    363
    Positive Ratings:
    145
    The lighting probably cant be changed - this is generated when you compile.
     
  4. Dr. ROCKZO

    Dr. ROCKZO L8: Fancy Shmancy Member

    Messages:
    580
    Positive Ratings:
    159
    Oh is it too? But what about a light_dynamic?
     
  5. Freyja

    aa Freyja ¯\_(ツ)_/¯

    Messages:
    2,878
    Positive Ratings:
    4,955
    You could always make a fake skybox but it wouldn't look very good.
     
  6. zpqrei

    aa zpqrei Theme Changer Extraordinaire

    Messages:
    1,067
    Positive Ratings:
    1,123
    You /could/ use the sun model in the 3D skybox and attach it and a light dynamic to a tracktrain and play with them, it might work.
     
  7. Jindo

    Jindo L3: Member

    Messages:
    121
    Positive Ratings:
    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:

    [​IMG]
    [​IMG]

    ---

    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.
     
  8. Cameron:D

    Cameron:D L6: Sharp Member

    Messages:
    363
    Positive Ratings:
    145
  9. Bermuda Cake

    Bermuda Cake L9: Fashionable Member

    Messages:
    679
    Positive Ratings:
    192
    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...
     
  10. martijntje

    martijntje L8: Fancy Shmancy Member

    Messages:
    539
    Positive Ratings:
    168
    • Thanks Thanks x 3
    Last edited: Nov 1, 2009
  11. Jindo

    Jindo L3: Member

    Messages:
    121
    Positive Ratings:
    123
    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).

    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)

    Ha, I had no idea there was a cvar to do that.
     
  12. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,535
    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?
     
  13. Jindo

    Jindo L3: Member

    Messages:
    121
    Positive Ratings:
    123
    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: Nov 1, 2009
  14. Dr. ROCKZO

    Dr. ROCKZO L8: Fancy Shmancy Member

    Messages:
    580
    Positive Ratings:
    159
    So... does sv_skyname work?
     
  15. Jindo

    Jindo L3: Member

    Messages:
    121
    Positive Ratings:
    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.
     
  16. martijntje

    martijntje L8: Fancy Shmancy Member

    Messages:
    539
    Positive Ratings:
    168
    sorry, my bad, that only works with single player games

     
  17. Bermuda Cake

    Bermuda Cake L9: Fashionable Member

    Messages:
    679
    Positive Ratings:
    192
    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) ?
     
  18. Jindo

    Jindo L3: Member

    Messages:
    121
    Positive Ratings:
    123
    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.
     
  19. Lancey

    aa Lancey Currently On: ?????

    Messages:
    3,076
    Positive Ratings:
    1,314
    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.
     
  20. Darksoul

    Darksoul L1: Registered

    Messages:
    35
    Positive Ratings:
    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.