Two sounds in one attack

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
Seylamander
Posts: 30
Joined: July 22nd, 2010, 3:06 am
Location: We ALL live in The Matrix.

Two sounds in one attack

Post by Seylamander »

Hey! I'm back again, and I have yet another animation question.

Is it possible to have more than one sound in one attack hit/miss? I'm trying to create "holy lightning" which plays the "Holy" sound list at the same time as the lightning ones. Here is the code I have so far (mostly taken from the "LIGHTNING_ANIMATION NAME_STRING DIRECTION_NUMBER" macro).

Code: Select all

#define HOLY_LIGHTNING_ANIMATION NAME_STRING DIRECTION_NUMBER
    [effect]
        apply_to=new_animation
        name={NAME_STRING}
        [attack_anim]
            [filter_attack]
                name={NAME_STRING}
            [/filter_attack]
            {LIGHTNING_BOLT {DIRECTION_NUMBER}}
            [if]
                hits=no
                [frame]
                    begin=-200
                    end=0
                    sound=lightning-miss.ogg,{SOUND_LIST:HOLY_MISS}
                [/frame]
            [/if]
            [else]
                hits=yes
                [frame]
                    begin=-200
                    end=0
                    sound=lightning.ogg,{SOUND_LIST:HOLY}
                [/frame]
            [/else]
        [/attack_anim]
    [/effect]
#enddef
Thanks!
"There's no escaping reason, no denying purpose, because as we both know, without purpose, we would not exist. It is purpose that created us."
-Mr. Smith, The Matrix Reloaded
blueknight1758
Posts: 252
Joined: March 30th, 2011, 8:38 pm
Location: The UK

Re: Two sounds in one attack

Post by blueknight1758 »

I don't know how to do that with WML but you could download an install Audacity (free software) and open both files and save them as one, then use that sound file as both.
User avatar
DEATH_is_undead
Posts: 960
Joined: March 4th, 2007, 3:00 pm
Location: Northern United States

Re: Two sounds in one attack

Post by DEATH_is_undead »

blueknight1758 wrote:I don't know how to do that with WML but you could download an install Audacity (free software) and open both files and save them as one, then use that sound file as both.
Problem with that is that users would have to have the map/era to play Multiplayer.

If it is possible to play more then one sound track, I believe it would be a better alternative if it is a Multiplayer addon. If not, go ahead with the Audacity idea.
3P MP Scenario - Great Dwarves Escape
The best way to learn is to follow. In order to learn WML, you have to follow other's work, and check their codes.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Two sounds in one attack

Post by zookeeper »

Yes, it's possible. Examples: wolves, cavalry units, thrown spears. Look and learn.
User avatar
Seylamander
Posts: 30
Joined: July 22nd, 2010, 3:06 am
Location: We ALL live in The Matrix.

Re: Two sounds in one attack

Post by Seylamander »

Got it. Thanks!

For future reference, I just looked at
Examples: wolves, cavalry units, thrown spears.
"There's no escaping reason, no denying purpose, because as we both know, without purpose, we would not exist. It is purpose that created us."
-Mr. Smith, The Matrix Reloaded
Post Reply