Page 1 of 1

Skyboxes across games (F_SKY/F_SKY1)

PostPosted: Wed Feb 03, 2021 4:18 pm
by eharper256
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.

Re: Making a sky in a level work across Heretic, Doom and He

PostPosted: Wed Feb 03, 2021 4:35 pm
by Mikk-
You can create a text lump called MAPINFO and insert this code:
Code: Select allExpand view
gameinfo
    
{
    
SkyFlatName "F_SKY1"
    


and that should solve your issue.

Re: Making a sky in a level work across Heretic, Doom and He

PostPosted: Wed Feb 03, 2021 4:42 pm
by eharper256
Mikk- wrote:You can create a text lump called MAPINFO and insert this code:
Code: Select allExpand view
gameinfo
    
{
    SkyFlatName = "F_SKY1"
    


and that should solve your issue.

Genius.
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. :shotty:

Nevertheless, thanks Mikk.

Re: Making a sky in a level work across all games

PostPosted: Fri Feb 19, 2021 5:35 pm
by eharper256
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.

Re: Skyboxes across games (F_SKY/F_SKY1)

PostPosted: Wed Feb 24, 2021 3:24 pm
by eharper256
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.

Re: Skyboxes across games (F_SKY/F_SKY1)

PostPosted: Thu Mar 04, 2021 3:35 pm
by Graf Zahl
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.

Re: Skyboxes across games (F_SKY/F_SKY1)

PostPosted: Thu Mar 04, 2021 3:55 pm
by eharper256
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.

Figured as much; I hit a brick wall awhile ago with it, thanks for the confirmation, Graf.

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 allExpand view
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\""
}

It would be nice if the variable could be altered to an array or such, but that's not going to happen. :lol:

Re: Skyboxes across games (F_SKY/F_SKY1)

PostPosted: Thu Mar 04, 2021 3:57 pm
by Rachael
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.

Re: Skyboxes across games (F_SKY/F_SKY1)

PostPosted: Thu Mar 04, 2021 5:59 pm
by eharper256
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.

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. :lol:

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