Skyboxes across games (F_SKY/F_SKY1)
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
- eharper256
- Posts: 1038
- Joined: Sun Feb 25, 2018 2:30 am
- Location: UK
- Contact:
Skyboxes across games (F_SKY/F_SKY1)
So, I've a made a testing map for my mod that works across all three games (Doom, Heretic and Hexen) by being divorced of all iwad content.
I have a single problem though. My ceiling in the map is set to be F_SKY1 so that GZDoom creates the sky for it. This is fine and works well when the map is called in Doom and Heretic. But Hexen shows us the cyan and white squares.
Obviously, looking this up it seems Hexen instead recognises F_SKY instead of F_SKY1.
So how do I apply both at once to the same map so it is recognised regardless of the game?
Or is it something I must create a skybox for? (and is a Skybox always using F_SKY1, or is that rule discarded again in Hexen?)
I tried adding a SkyPicker object to all the relevant sectors (with no arguments, so it will use the MAPINFO one), but that seems to have no effect.
I have a single problem though. My ceiling in the map is set to be F_SKY1 so that GZDoom creates the sky for it. This is fine and works well when the map is called in Doom and Heretic. But Hexen shows us the cyan and white squares.
Obviously, looking this up it seems Hexen instead recognises F_SKY instead of F_SKY1.
So how do I apply both at once to the same map so it is recognised regardless of the game?
Or is it something I must create a skybox for? (and is a Skybox always using F_SKY1, or is that rule discarded again in Hexen?)
I tried adding a SkyPicker object to all the relevant sectors (with no arguments, so it will use the MAPINFO one), but that seems to have no effect.
Last edited by eharper256 on Fri Feb 19, 2021 5:36 pm, edited 3 times in total.
Re: Making a sky in a level work across Heretic, Doom and He
You can create a text lump called MAPINFO and insert this code:
and that should solve your issue.
Code: Select all
gameinfo
{
SkyFlatName = "F_SKY1"
}
- eharper256
- Posts: 1038
- Joined: Sun Feb 25, 2018 2:30 am
- Location: UK
- Contact:
Re: Making a sky in a level work across Heretic, Doom and He
Genius.Mikk- wrote:You can create a text lump called MAPINFO and insert this code:and that should solve your issue.Code: Select all
gameinfo { SkyFlatName = "F_SKY1" }
For some reason I didn't think of checking for a GAMEINFO setting, even though I've been editing mine several times over the last few weeks. Super derp.
Nevertheless, thanks Mikk.
- eharper256
- Posts: 1038
- Joined: Sun Feb 25, 2018 2:30 am
- Location: UK
- Contact:
Re: Making a sky in a level work across all games
I'm re-opening this query because actually the above doesn't fully work after all.
Or rather, it fixes my universal level, but muggins here didn't actually test with the actual vanilla Hexen Campaign IWAD until today. Which this now breaks as all the vanilla skies are using F_SKY, of course.
I tried putting SkyFlatName = "F_SKY1", "F_SKY"
to see if I could have multiple entries, but obviously no dice.
Or rather, it fixes my universal level, but muggins here didn't actually test with the actual vanilla Hexen Campaign IWAD until today. Which this now breaks as all the vanilla skies are using F_SKY, of course.
I tried putting SkyFlatName = "F_SKY1", "F_SKY"
to see if I could have multiple entries, but obviously no dice.
- eharper256
- Posts: 1038
- Joined: Sun Feb 25, 2018 2:30 am
- Location: UK
- Contact:
Re: Skyboxes across games (F_SKY/F_SKY1)
So considering I've still not seen a solution to this, I'm guessing making a skybox is going to be the only way forwards.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Skyboxes across games (F_SKY/F_SKY1)
This is fundamentally unsolvable. Internally the engine checks a single variable named "skyflatnum", so it can only contain one name. Unfortunately both Hexen and Strife chose different ones so you cannot make such a map universal without affecting other maps.
- eharper256
- Posts: 1038
- Joined: Sun Feb 25, 2018 2:30 am
- Location: UK
- Contact:
Re: Skyboxes across games (F_SKY/F_SKY1)
Figured as much; I hit a brick wall awhile ago with it, thanks for the confirmation, Graf.Graf Zahl wrote:This is fundamentally unsolvable. Internally the engine checks a single variable named "skyflatnum", so it can only contain one name. Unfortunately both Hexen and Strife chose different ones so you cannot make such a map universal without affecting other maps.
Well I guess we're going with the workaround option.
For reference for anyone with the same query, what this involves is including a second copy of the testing map with F_SKY instead of F_SKY1, and then writing a section like this in my menu:
Code: Select all
Optionmenu "Testing Map"
{
Title "Testing Map"
StaticText "____________________________________________________________"
IfGame(Doom, Heretic)
{
Command ">>Go to The Testing Map<<", "Testaccess" //calls the alias set in KEYCONF
}
IfGame(Hexen)
{
Command ">>Go to The Testing Map<<", "Testaccess2" //alternate call, map has F_SKY instead of F_SKY1
}
StaticText "------------------------------------------------------------"
StaticText "Press this to immediately commence the testing map!"
StaticText "This map works irregardless of what game you are currently in!" //Actually it doesn't lol. LIES!!!
StaticText "------------------------------------------------------------"
StaticText "Change class before activating this by using the below toggles.", "Gold"
Command "Set Class to Myrmidon", "set playerclass \"Baratus the Myrmidon\""
Command "Set Class to Crusader", "set playerclass \"Parias the Crusader\""
Command "Set Class to Magister", "set playerclass \"Daedolon the Magister\""
Command "Set Class to Druid", "set playerclass \"Illitheya the Druid\""
}
Re: Skyboxes across games (F_SKY/F_SKY1)
Maybe a possible solution for a universal sky (as a feature request) is to have a surface flag (be it floor or ceiling) that marks it as a sky.
Bonus points: The texture in the sky can then be the texture as defined in said flat - like how it works in Build.
--
Other than that though you might also be able to change textures in the level to the current sky texture using an event handler in ZScript, as well.
Bonus points: The texture in the sky can then be the texture as defined in said flat - like how it works in Build.
--
Other than that though you might also be able to change textures in the level to the current sky texture using an event handler in ZScript, as well.
- eharper256
- Posts: 1038
- Joined: Sun Feb 25, 2018 2:30 am
- Location: UK
- Contact:
Re: Skyboxes across games (F_SKY/F_SKY1)
Whilst a feature request of that sort might be nice; it would show immense hubris on my part to request that of the dev-team just to combat my one edge case.Rachael wrote:Maybe a possible solution for a universal sky (as a feature request) is to have a surface flag (be it floor or ceiling) that marks it as a sky.
Bonus points: The texture in the sky can then be the texture as defined in said flat - like how it works in Build.
--
Other than that though you might also be able to change textures in the level to the current sky texture using an event handler in ZScript, as well.
Of course I'll not complain if Graf gets bored enough one day to implement it though; or if others can provide motive for it to be a better feature request than just 'I can't have multi-game compatible levels for a specific mod, waaa!'.
Maybe I'll come back to it at a later date; pot-pourri monster mode (mixing all three games monsters) is theoretically on the cards at a later date and if that works out, it could benefit from such a feature (maybe).
I honestly really liked the BUILD way of doing things. SECTOREFFECTORS were really versatile little widgets. I have a cache of olde levels somewhere on floppies that I can no longer access, lol.
---
I'm sure that there is some ZScript wizardry that can make it work for sure. But coding is by far my weakest field (I'm an artist and writer first and foremost) so I'll stick to my workaround for now. The Testmap is only 35 Kb, two of them in my pk3 isn't going to break the bank.