[Script] Linedef Executor - Change Skybox (skyboxchange.lua)

Status
Not open for further replies.

Monster Iestyn

Fangtastic
Administrator
Sonic Team Junior
Kart Krew™️
Judge
I bet a number of people around have been puzzled by the fact we have linedefs for changing sky and weather ...but not skyboxes? Naturally I've gone and made a script to redeem this heinous crime against SRB2 modding!

Set-up instructions:
  • Plonk the Lua script linked below into a wad for your level, with a lump name like LUA_MAIN, LUA_FUN or LUA_LOL, doesn't matter at all except for the "LUA_" bit
  • Set up your skyboxes each with their own skybox viewpoints, making sure to pay attention to the order you place the skybox viewpoints! Note that the last skybox viewpoint is the first one that will be used on map load.
  • Set up a linedef executor involving linedef type 443 - this should have a front upper texture of name "SETSKYBX".
  • Front x offsets of the linedef determine the "skybox id" of your skybox to switch to - x offsets of 1 sets it to the first skybox viewpoint you placed on the map, 2 to the second viewpoint etc.
  • By default, the skybox change will affect only the player that triggered the linedef executor (does not do anything if not a player). If the Not Climbable flag is checked on the skybox change linedef however, the skybox change will affect ALL players! (It doesn't matter what triggers the linedef if so).
  • Do be warned that deleting Things placed before the Skybox viewpoints can potentially lead to your level editor automatically re-ordering the viewpoints' Thing numbers. This could have dire consequences.

A test map (at MAP01) and gif of the script in action are also attached below; note that the test map already has the script within as the "LUA_SKYB" lump. Some commenting is provided in the Lua script to help understand what's going on. (may be useful for Lua scripting peoples!)

Credit to Jay (known as Spiny on IRC) for helping me test the script out.
 

Attachments

  • srb20063.gif
    srb20063.gif
    3.1 MB · Views: 872
  • skyboxchange-test.zip
    4.5 KB · Views: 476
  • skyboxchange.lua
    2.7 KB · Views: 508
Last edited:

Monster Iestyn

Fangtastic
Administrator
Sonic Team Junior
Kart Krew™️
Judge
...welp, I'll see if I can contact Spiny about that. Alternatively, maybe I can make my own test map I guess?
 

Monster Iestyn

Fangtastic
Administrator
Sonic Team Junior
Kart Krew™️
Judge
Done, created my own test map and added a new gif showing said map in action.
 

TehRealSalt

(σᴥσ)
Kart Krew™️
Good job! I don't really need this for now, but it's definitely good to know that this is here for whenever I do need it.

Nice, the test map takes places in a Holographic Laser Cage of the Future Age™.
 
Sorry for the bump but how does this work for other players? If Player 'A' activates the skybox change, will it affect Player 'B' who hasn't activated the skybox change? Or will they view the previous skybox it was already set to?
Well, I think that you can choose whether player A's activation will affect just player A or all players, judging by the description.
Monster Iestyn said:
By default, the skybox change will affect only the player that triggered the linedef executor (does not do anything if not a player). If the Not Climbable flag is checked on the skybox change linedef however, the skybox change will affect ALL players! (It doesn't matter what triggers the linedef if so).
 
Status
Not open for further replies.
Top