Changes to play_sound?

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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.

Changes to play_sound?

Postby Gwledig » May 10th, 2014, 4:54 pm

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+ Classic, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building multiplayer scenario)
User avatar
Gwledig
 
Posts: 351
Joined: March 30th, 2009, 5:10 pm
Location: UK

Re: Changes to play_sound?

Postby Gwledig » May 10th, 2014, 5:17 pm

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+ Classic, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building multiplayer scenario)
User avatar
Gwledig
 
Posts: 351
Joined: March 30th, 2009, 5:10 pm
Location: UK

Re: Changes to play_sound?

Postby shadowm » May 10th, 2014, 7:15 pm

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.
I also made Wesnoth RCX, a team-color preview tool for artists and content creators.
Elsewhere: shadowmBlogFollow me on Twitter
User avatar
shadowm
Wesnoth.org Administrator
 
Posts: 6182
Joined: November 14th, 2006, 5:54 pm
Location: Chile


Return to WML Workshop

Who is online

Users browsing this forum: No registered users and 4 guests