Changes to play_sound?

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
User avatar
Gwledig
Posts: 568
Joined: March 30th, 2009, 5:10 pm
Location: UK

Changes to play_sound?

Post by Gwledig »

Hi I'm in the process of trying to debug my old mod conquest+ based on the original conquest, I am getting a missing file/macro error and references to PLAY_SOUND, looking at the macro reference it looks like this has changed but I can't see any clear instructions how to play a sound now, I want to convert the following to whatever the new format is, any ideas?

e.g.

Code: Select all

#define BUILD_SOUND
    {PLAY_SOUND ("staff.wav")}
    {DELAY 100}
    {PLAY_SOUND ("pincers.ogg")}
    {DELAY 160}
    {PLAY_SOUND ("sling.ogg")}
#enddef
this stuff is causing the errors I am seeing when trying to run the mod locally, thanks for any knowledge of the new way to play a sound...
Maintainer of Conquest (Original Gameplay), Conquest+, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building MP game)
User avatar
Gwledig
Posts: 568
Joined: March 30th, 2009, 5:10 pm
Location: UK

Re: Changes to play_sound?

Post by Gwledig »

looks like this works, although I'm still testing...

#define BUILD_SOUND
[sound]
name="staff.wav"
immediate="yes"
[/sound]
[sound]
name="pincers.ogg"
immediate="yes"
[/sound]
[sound]
name="sling.ogg"
immediate="yes"
[/sound]

the delay macro looks deprecated so I just removed it
Maintainer of Conquest (Original Gameplay), Conquest+, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building MP game)
User avatar
Iris
Site Administrator
Posts: 6797
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Changes to play_sound?

Post by Iris »

immediate=yes does not mean anything in [sound] tags. It’s only used in [music], [set_global_variable], and [clear_global_variable].

Also, the nonexistent DELAY macro that code referred was presumably (expected to be) defined as follows:

Code: Select all

#define DELAY TIME
    [delay]
        time={TIME}
    [/delay]
#enddef
Since basic WML is faster than most people assume, unless you insert delays between sounds, you will hear them all at the same time. If this is not the intended effect, try bringing back the delays.

(Also, while this topic deals with sound effects, it doesn’t belong in Music & Sound Development because it’s about WML assistance and not about the actual music and sounds! Moved to WML Workshop.)
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
Post Reply