Help Home

Tutorials

Weapon Scr. I
Weapon Scr. II
Missions

Reference

All Commands
General
Load/Add
Graphics
HUD
Sounds
Player
Terrain
Projectiles
Particles
Collision
Objects
AI
Nodes
Missions

Commands: sounds

Legend

  • X - X is a number
  • 'X' - X is a string (a letter/word/text)
  • [X=0] - X is an optional parameter with value 0 when omitted (NEVER add [] to your script!)
  • hard sync - command is hard synced

channelplaying(CHANNEL)

Parameters:
CHANNEL - sound channel from 0 to 9
Returns:
PLAYING - 1 if sound is still playing, else 0
Returns 1 if there is a sound playing in this channel or 0 if there is no sound playing.

playsound(SOUND, [CHANNEL=-1], [VOLUME=1.0])

Parameters:
SOUND - sound ID
[CHANNEL=-1] - channel for sound control, 0 to 9, or -1 for no channel
[VOLUME=1.0] - sound volume from 0.0 to 1.0
Plays a sound.
You can also use one of 10 channels (0-9) which allows you to check when the playback is finished and to stop the sound. Use -1 as CHANNEL if you do not want to use a channel.

Use the VOLUME parameter to change the volume of the sound. You can use values from 0.0 (silent) to 1.0 (loud).

Moreover Carnage Contest has some built in sounds. You can insert the following values for SOUND to use them:
sfx_explosion1, ..., sfx_explosion7
sfx_hitwater1, ..., sfx_hitwater5
sfx_splatter1, ..., sfx_splatter5
sfx_ricochet1
sfx_waterstep
sfx_steam
sfx_turn_next
sfx_turn_you
sfx_turn_roundgong

stopchannel(CHANNEL)

Parameters:
CHANNEL - sound channel from 0 to 9
Stops the playback of a sound in a channel.