• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How to play sound that will not stop?

Status
Not open for further replies.
Level 15
Joined
Dec 6, 2008
Messages
345
Hi, i have an simple question.
How to play any sound using triggers, that will not stop when you play another sound?
For example, if unit attack to unit, trigger turn on sound of axe attack...
If 10 units will attack together, all sounds of all unit will play and none of the played sound will stop until it finish the sound lenght.

Is there some way? Thanks :)
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
A unit is Attacked - Play Axe-Attack sound.

Or just modify the "Sound - Attack" field in the Object Editor on the unit.
 
Level 13
Joined
Sep 29, 2008
Messages
671
I don't think you could do that with triggers. Maybe make multiple sound variables or make a no target (instant cast) ability and set "Sound - Effect Sound" to the sound u want to use then make a dummy to cast that spell, something like that I guess.

I think there's no other way to do this in GUI triggers.
Maybe some people might now, but those are the only suggestions I can give you.
 
For every sound, create an integer variable and do this to create a sound:

  • Custom script: set udg_YOUR_INTEGER = NewSound("insert filepath here", Duration in milliseconds over here, is It Looping? (true or false), is it 3D? (true or false))
An example for a sound with filepath "war3importedsound1", duration of 4 seconds, not looping and not 3D:

  • Custom script: set udg_Integer = NewSound("war3importedsound1", 4000, false, false)
To play the sound:

  • Custom script: call RunSound(udg_Integer)
If you want to play the sound on a unit:

  • Custom script: call RunSoundOnUnit(udg_Integer, UNIT)
At a point:

  • Custom script: call RunSoundAtPoint(udg_Integer, X, Y, Z)
For a player:

  • Custom script: call RunSoundForPlayer(udg_Integer, PLAYER)
 
Status
Not open for further replies.
Top