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:
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.
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
Last edited: