Classes:SoundEnvironment
Note: Wait! Stop! You do not need to copy this actor's code into your project! Here's why:
|
Sound environment | |||
---|---|---|---|
Actor type | Map spot | Game | ![]() |
DoomEd Number | 9048 | Class Name | SoundEnvironment |
Classes: SoundEnvironment
A sound environment changes the reverberation qualities of an area in the map. This is not limited to a sector, boundaries must be drawn with Line_SetIdentification (in Hexen format) or the zoneboundary flag set to true (in UDMF). Only one reverb can be active in an area at a time.
The thing takes two arguments, which define which type of environment to use. See the REVERBS lump for a list of environments. For example, with a first argument of 30 and a second argument of 0, the "Castle Alcove" environment (30-0) is used.
A sound environment thing given the DORMANT flag in the map editor does not take effect until activated, but an active environment cannot be simply deactivated to disable the effect; instead another environment must be activated in the same area. The environment 0-0 can be used in this way to disable reverberation effects.
ZScript definition
Note: The ZScript definition below is for reference and may be different in the current version of GZDoom.The most up-to-date version of this code can be found on GZDoom GitHub. |
class SoundEnvironment : Actor
{
default
{
+NOSECTOR
+NOBLOCKMAP
+NOGRAVITY
+DONTSPLASH
+NOTONAUTOMAP
}
override void PostBeginPlay ()
{
Super.PostBeginPlay ();
if (!bDormant)
{
Activate (self);
}
}
override void Activate (Actor activator)
{
CurSector.SetEnvironmentID((args[0]<<8) | (args[1]));
}
// Deactivate just exists so that you can flag the thing as dormant in an editor
// and not have it take effect. This is so you can use multiple environments in
// a single zone, with only one set not-dormant, so you know which one will take
// effect at the start.
override void Deactivate (Actor deactivator)
{
bDormant = true;
}
}
DECORATE definition
Note: This is legacy code, kept for archival purposes only. DECORATE is deprecated in GZDoom and is completely superseded by ZScript. GZDoom internally uses the ZScript definition above. |
ACTOR SoundEnvironment native { +NOSECTOR +NOBLOCKMAP +NOGRAVITY +DONTSPLASH }