ChangeSky (ZScript)

From ZDoom Wiki
Jump to navigation Jump to search
Note: This feature is for ZScript only.


struct LevelLocals
static Void ChangeSky(TextureID sky1, TextureID sky2);

Usage

Changes the sky textures of the map, similar to the ChangeSky ACS function. Unlike it however, Level.ChangeSky() directly uses TextureIDs instead of texture name strings.

Parameters

  • TextureID sky1
The TextureID of the first sky layer.
  • TextureID sky2
The TextureID of the second sky layer, useful in maps that use a double sky, have lightning, or have sectors of the type 200.

To use this function to simply change the sky textures on a map, like the equivalent ACS function, you need to retrieve the TextureIDs of the textures you want to change the sky layers to, to do that you need to write the ChangeSky() function like below:

Level.ChangeSky(TexMan.CheckForTexture("texturename1",TexMan.Type_Any),TexMan.CheckForTexture("texturename2",TexMan.Type_Any));

Examples

Below is the code for a special Zombieman who when spawned, changes the levels' sky1 to the FWATER1 texture, and sky2 to NUKAGE1.

Class SkyChangingZombieman : Zombieman
{
	Override Void PostBeginPlay()
	{
		Super.PostBeginPlay();
		Level.ChangeSky(TexMan.CheckForTexture("FWATER1",TexMan.Type_Any),TexMan.CheckForTexture("NUKAGE1",TexMan.Type_Any));
	}
}