Skip to content

C_SFX Daedalus class

Class C_SFX defines sound effects of the game.

Definition

Class definition as it is defined in Scripts/System/_intern/SFX.d script file.

class C_Sfx
{
    var string file;            // Sound file in `.wav` format
    var int    pitchOff;        // Pitch offset in semitones
    var int    pitchVar;        // Semitone variance
    var int    vol;             // Sound volume
    var int    loop;            // Enable looping
    var int    loopStartOffset; // Loop start offset
    var int    loopEndOffset;   // Loop end offset
    var float  reverbLevel;     // Reverb level
    var string pfxName;         // Particle effect name
};

Members

string file

This variable holds the name of the sound file in .wav format. It is used to specify which sound effect should be played. The file must be located in the _work/Data/Sound/SFX/ directory, so the game can access it.

int pitchOff

The pitchOff variable sets the pitch offset in semitones. This allows you to adjust the pitch of the sound effect up or down, providing flexibility in how the sound is perceived in the game.

int pitchVar

pitchVar defines the semitone variance for the sound effect.

int vol

This variable controls the sound volume.

int loop

The loop variable enables or disables looping of the sound effect. When set to true, the sound will continuously repeat, which is useful for background sounds or ambient effects like fire or wind.

int loopStartOffset

loopStartOffset specifies the point in the sound file where looping should start. This allows for more precise control over which part of the sound effect is repeated.

int loopEndOffset

Similar to loopStartOffset, loopEndOffset defines where the looping should end. Together, these two variables allow you to create seamless loops by specifying the exact segment of the sound file to be repeated.

float reverbLevel

The reverbLevel variable sets the level of reverb applied to the sound effect.

string pfxName

This variable holds the name of the particle effect associated with the sound.