Meteor Scripting Functions
Audio
void playSound(string soundName)
Play a sound locally without spatialisation.

Example
playSound("battle");

See also
playSound2D

void playSound2D(vector2 pos, string soundName)
Play a sound from a 2D position.

Example
playSound2D(getPos(getPlayer()), "battle");

Comments
If run from the server the sound is also played on all clients.
If run from a client the sound is local only.

See also
playSound

void playMusic(string musicFileName)
Play music from file.

Example
playMusic("ALTWORLD.MOD");

Comments
Pass a filename only to search in base\music.
Pass an absolute path to play from another location.
Supported formats include Ogg Vorbis, MOD, S3M, XM.

See also
stopMusic restartMusic getMusicFilename setMusicPos

float getMusicPos()
Get the currently playing music position in seconds.

Example
print(getMusicPos())

See also
setMusicPos

void setMusicPos(float seconds)
Seek the currently playing music to the current position in seconds.

Example
// jump to 30 seconds in
setMusicPos(30);

See also
getMusicPos

string getMusicFilename()
Get the currently playing music filename.

Example
print(getMusicFilename())

See also
playMusic

void stopMusic()
Stop music playing.

Example
stopMusic();

Comments
Music is stopped and cannot be resumed (use playMusic to play more music).
Music will not resume until a new level is started.

See also
playMusic restartMusic

void restartMusic()
Rewind currently playing music to the start.

Example
restartMusic();

See also
playMusic stopMusic

void pauseMusic()
Pause currently playing music.

Example
pauseMusic();

See also
resumeMusic isMusicPaused

void resumeMusic()
Resume current music.

Example
pauseMusic();

See also
resumeMusic isMusicPaused

void isMusicPaused()
Is music paused?

Example
if(isMusicPaused())
{
    print("Music is paused");
}
else
{
    print("Music is not paused");
}

See also
pauseMusic resumeMusic


Index