MusicLevel

Category: Music
Since engine version: 4.6.5.0 CP

Description

Sets the volume for playback of background music (see Music).

Syntax

int MusicLevel (int iLevel);

Parameter

iLevel:
Desired volume (0-100).

Example

local iVolume;

func Initialize()
{
  iVolume = 100;
}

func Timer()
{
  iVolume--;
  MusicLevel(iVolume);
  if(iVolume <= 0)
  {
    Music();
    RemoveObject();
  }
}
Script for an object which will fade out background music: the "Timer" function will decrease the volume step by step until it is 0. Then the music will be turned off and the helper object deleted.
See also: Music
PeterW, Februar 2003