1553 Turns on or off cinematic mode. Cinematic mode can be used for cutscenes etc. |
1553 Turns on or off cinematic mode. Cinematic mode can be used for cutscenes etc. |
1554 If `enable` is set to `true`, cinematic mode is enabled, |
1554 If `enable` is set to `true`, cinematic mode is enabled, |
1555 if it is `false`, cinematic mode is disabled. |
1555 if it is `false`, cinematic mode is disabled. |
1556 |
1556 |
1557 == Sound functions == |
1557 == Sound functions == |
1558 === <tt>!PlaySound(soundId, [gearUid [, instaVoice]])</tt> === |
1558 === `PlaySound(soundId, [gearUid [, instaVoice]])` === |
1559 Plays the specified sound. Possible values for `soundId` are listed on the [Sounds] page. |
1559 Plays the specified sound. Possible values for `soundId` are listed on the [Sounds] page. |
1560 |
1560 |
1561 To play a voice (see [Taunts] for a list), you must also set `gearUid`. `gearUid` is the hedgehog gear which is used to “talk”. |
1561 To play a voice (see [Taunts] for a list), you must also set `gearUid`. `gearUid` is the hedgehog gear which is used to “talk”. |
1562 |
1562 |
1563 If you play a voice, by default the voice will respect an internal queue and might be played with an delay in order to prevent annoying voice overlapping. Since version 0.9.24, you can disable this behaviour and force Hedgewars to instantly play the voice by also setting `instaVoice` to `true`. Only use `instaVoice` when you really need it. |
1563 If you play a voice, by default the voice will respect an internal queue and might be played with an delay in order to prevent annoying voice overlapping. Since version 0.9.24, you can disable this behaviour and force Hedgewars to instantly play the voice by also setting `instaVoice` to `true`. Only use `instaVoice` when you really need it. |
1564 |
1564 |
1565 === <tt>!PlayMusicSound(soundId)</tt> (0.9.25) === |
1565 === `PlayMusicSound(soundId)` (0.9.25) === |
1566 Plays a sound as replacement for the background music. The sound is played once. The main music is paused and the sound is played instead. The main background music does not resume automatically, so you should call `StopMusicSound` after a while. |
1566 Plays a sound as replacement for the background music. The sound is played once. The main music is paused and the sound is played instead. The main background music does not resume automatically, so you should call `StopMusicSound` after a while. |
1567 |
1567 |
1568 Example: |
1568 Example: |
1569 <code language="lua"> |
1569 <code language="lua"> |
1570 PlayMusicSound(sndRideOfTheValkyries) -- Replace the background music the Ride of the Valkyries |
1570 PlayMusicSound(sndRideOfTheValkyries) -- Replace the background music the Ride of the Valkyries |
1571 </code> |
1571 </code> |
1572 |
1572 |
1573 === <tt>!StopMusicSound(soundId)</tt> (0.9.25) === |
1573 === `StopMusicSound(soundId)` (0.9.25) === |
1574 Stops the specified “music sound” (if it was still playing) and resumes the main background music. |
1574 Stops the specified “music sound” (if it was still playing) and resumes the main background music. |
1575 |
1575 |
1576 === <tt>!SetSoundMask(soundId, isMasked)</tt> (0.9.24) === |
1576 === `SetSoundMask(soundId, isMasked)` (0.9.24) === |
1577 Disables a given sound (including taunts) from being played by the engine. `soundId` is a valid sound ID on [Sounds] or [Taunts]. `isMasked` is a boolean. If `true`, the sound will not be played by the engine anymore. If `false`, playing this sound is allowed again. |
1577 Disables a given sound (including taunts) from being played by the engine. `soundId` is a valid sound ID on [Sounds] or [Taunts]. `isMasked` is a boolean. If `true`, the sound will not be played by the engine anymore. If `false`, playing this sound is allowed again. |
1578 |
1578 |
1579 Sounds played by the Lua function `PlaySound` will always work, however, and ignore the sound mask. |
1579 Sounds played by the Lua function `PlaySound` will always work, however, and ignore the sound mask. |
1580 |
1580 |
1581 Note: Due to the way the voices work internally in Hedgewars, if you want to play a masked voice, you have to set `instaVoice` to `true` when you call `PlaySound`. Otherwise, it won't work. |
1581 Note: Due to the way the voices work internally in Hedgewars, if you want to play a masked voice, you have to set `instaVoice` to `true` when you call `PlaySound`. Otherwise, it won't work. |