ReplaceTextures (ZScript)
Jump to navigation
Jump to search
Note: This feature is for ZScript only. |
struct LevelLocals
void ReplaceTextures(String from, String to, int flags)
Usage
Changes all the instances of a texture in the level to another texture, similar to the ReplaceTextures ACS function. Also has flags to exclude specific instances of the texture to be replaced from being so, for more fine control.
Parameters
- String from
- The texture to be replaced in the map.
- String to
- The texture to replace the texture specified above with.
- int flags
- The flags that can be used to exclude certain types of the From texture from being replaced. To combine multiple flags, use the | separator. Because the flags are inside the TexMan struct, you need to add the TexMan. prefix on every flag like in the example below to use them.
- NOT_BOTTOM: Excludes the bottom sidedefs of lines from being replaced.
- NOT_MIDDLE: Excludes the middle sidedefs of lines from being replaced.
- NOT_TOP: Excludes the top sidedefs of lines from being replaced.
- NOT_FLOOR: Exludes floor flats from being replaced.
- NOT_CEILING: Exludes ceiling flats from being replaced.
- NOT_WALL: Excludes all walls from being replaced.
- NOT_FLAT: Excludes all flats from being replaced.
Examples
This is a special Imp that when spawned will replace all STARTAN1 instances, except for ones on bottom sidedefs, with GSTONE1. Replace all FLOOR0_1 instances, except for ones on any linedef or ceiling, with BLOOD1, and replace all CEIL1_1 instances, except for ones on floors and linedefs with the special F_SKY1 sky texture.
class TextureReplacingImp : {{Class|DoomImp}}
{
override void PostBeginPlay()
{
Super.PostBeginPlay();
Level.ReplaceTextures ("STARTAN2", "GSTONE1", TexMan.NOT_BOTTOM);
Level.ReplaceTextures ("FLOOR0_1", "BLOOD1", TexMan.NOT_WALL|TexMan.NOT_CEILING);
Level.ReplaceTextures ("CEIL1_1", "F_SKY1", TexMan.NOT_WALL|TexMan.NOT_FLOOR);
}
}