Przejdź do treści

C_MUSICTHEME Daedalus class

Class C_MUSICTHEME describes musical themes1.

Definition

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

class C_MusicTheme
{
    var string file;         // Sound file in DirectMusic `.sgt` format
    var float  vol;          // Sound volume
    var int    loop;         // Enable cycle
    var float  reverbMix;    // Reverb mixing
    var float  reverbTime;   // Reverb time
    var int    transType;    // Type of transition to the next theme
    var int    transSubType; // Subtype of transition to the next theme song
};

Members

string file

DirectMusic sound in *.sgt format or MIDI file.

float vol

The volume of the theme song. From 0.0 to 1.0.

int loop

Enable/disable theme music looping. Disabled = 0. Enabled = 1.

float reverbMix

Reverb mixing. Measured in decibels.

float reverbTime

Reverberation time in milliseconds.

int transType

The type of transition to the next theme song.

The list of constants for all transitions types is described in the file Scripts/System/_intern/Music.d

1
2
3
4
5
6
7
const int TRANSITION_TYPE_NONE          = 1;    // No transition
const int TRANSITION_TYPE_GROOVE        = 2;    // Ripple
const int TRANSITION_TYPE_FILL          = 3;    // Padding
const int TRANSITION_TYPE_BREAK         = 4;    // Break
const int TRANSITION_TYPE_INTRO         = 5;    // Introductory
const int TRANSITION_TYPE_END           = 6;    // End topic
const int TRANSITION_TYPE_ENDANDINTRO   = 7;    // End and start new

int transSubType

The subtype of transition to the next theme song.

The list of constants for all transitions subtypes is described in the file Scripts/System/_intern/Music.d

1
2
3
const INT TRANSITION_SUB_TYPE_IMMEDIATE = 1;    // Instant transition
const INT TRANSITION_SUB_TYPE_BEAT      = 2;    // Rhythmic transition
const INT TRANSITION_SUB_TYPE_MEASURE   = 3;    // Gradual transition

Name features

The musical themes of the game are played depending on the game situation. By default, the theme with the _STD (standard) suffix is played. In case of a threat, the _THR (threat) theme will be played. During the combat the _FGT (fight) theme plays.

Danger

Make sure that you use proper naming convention for MusicThemes and oCZoneMusic vobs. The theme with OC_ prefix will play in a zone with name like OLDCAMP_OC or any other ending with _OC

instance WOO_DAY_STD(C_MUSICTHEME_STANDARD)
{
    file = "woo_daystd.sgt";
};

instance WOO_DAY_THR(C_MUSICTHEME_THREAT)
{
    file = "woo_daythr.sgt";
};

instance WOO_DAY_FGT(C_MUSICTHEME_FIGHT)
{
    file = "woo_dayfgt.sgt";
};
In addition, the suffix _DAY_ and _NGT_ determines whether the theme should be played on day or night.
1
2
3
4
5
6
7
8
9
instance OWD_DAY_FGT(C_MUSICTHEME_FIGHT)
{
    file = "owp_dayfgt.sgt";
};

instance OWD_NGT_STD(C_MUSICTHEME_STANDARD)
{
    file = "owd_daystd.sgt";
};

Tip

In G2 the C_MUSICTHEME_STANDARD, C_MUSICTHEME_THREAT and C_MUSICTHEME_FIGHT prototypes are used by default.


  1. Heavily inspired by the amazing documentation site Gothic library