[General] Can custom sound be implemented with triggers instead of importing and replacing another?

Level 11
Joined
Feb 4, 2023
Messages
636
There was a post I came across from a while back. 2009 and it was about making a custom soundset.
Custom Unit Soundsets
In the thread, as you can see a person came with a question about making one.
The next person came and showed them the method that I've seen most in how people create custom soundsets, and that is by replacing an existing one (which I've always found to be a bit annoying and I feel like could potentially limit creativity) and while I haven't gone into personally making a custom soundset, I figured it would be similar to importing and naming it in the editor like you would (in the simplest sense) with models, textures and using the appropriate editors, no?

Anyway, a couple of posts down, in the same thread has a post from user @Graber that you could use triggers instead and not need to replace them (specifically he had a problem where they'd reset, but that's not my point.)
I have three questions that I hope can be answered in a clear way that could clear up misconceptions and/or potentially make searching for what people want in an easier fashion.

1. Can you actually do what Graber mentioned in that thread or has reforged somehow made that impossible?
2. Sifting through the tutorial archives, I came across this thread from 2020 Adding new soundsets and not replacing them. As you can see, it's in the tutorial archive, but I have to know. Is this the standard for implementing new soundsets now and not just "replacing other ones"? If it's not the standard, may I be linked to the new standard of getting new soundsets implemented, please?

Forgive me if it seems naive or "lazy" for me to ask. The keywords I use to try and search this stuff up easily doesn't yield the results desired, so if I could get a hand with those two questions, I'd be very grateful.
Thank you for reading.
 
Level 20
Joined
Jun 27, 2011
Messages
1,868
Not sure about the standards but yes, you can do what Graber said. The logic is still the same. The Trigger Editor is powerful - you can make a trigger that listens to whatever anything any unit is trying to do, and apply the custom sound effects based on that. Graber outlined it already in his post. If you're still interested in this, I can make a demo map following Graber's logic.
 
Level 11
Joined
Feb 4, 2023
Messages
636
Not sure about the standards but yes, you can do what Graber said. The logic is still the same. The Trigger Editor is powerful - you can make a trigger that listens to whatever anything any unit is trying to do, and apply the custom sound effects based on that. Graber outlined it already in his post. If you're still interested in this, I can make a demo map following Graber's logic.
That's fantastic! I'll follow that from now on! It feels like a circumstance where it would limit creativity.
This really expands my horizons! Thank you.
 
Level 19
Joined
Oct 17, 2012
Messages
859
If you plan on triggering your unit sound sets, just be wary of these limitations in WC3:

  • You can only play up to 16 sounds at the same time
  • You can only play up to 4 sounds of the same filepath (but at different sound handles) at the same time
  • You can only play 1 sound per sound handle at the same time (obviously)
  • Even if a sound filepath is on different sound handles, they must have a delay of at least 0.1 seconds in between them to play

So basically this boils down to:
  • Create 4 sound handles for each filepath as a small array
  • Loop through the array when you want to play the sound, until you find one that returns true for the following condition:
if GetSoundIsPlaying(snd) == false and GetSoundIsLoading(snd) == false then
- then play this sound

Having more than 4 sound handles of the same filepath is pointless.
 
Level 11
Joined
Feb 4, 2023
Messages
636
If you plan on triggering your unit sound sets, just be wary of these limitations in WC3:

  • You can only play up to 16 sounds at the same time
  • You can only play up to 4 sounds of the same filepath (but at different sound handles) at the same time
  • You can only play 1 sound per sound handle at the same time (obviously)
  • Even if a sound filepath is on different sound handles, they must have a delay of at least 0.1 seconds in between them to play

So basically this boils down to:
  • Create 4 sound handles for each filepath as a small array
  • Loop through the array when you want to play the sound, until you find one that returns true for the following condition:
if GetSoundIsPlaying(snd) == false and GetSoundIsLoading(snd) == false then
- then play this sound

Having more than 4 sound handles of the same filepath is pointless.
Forgive me for misunderstanding, but by "sounds of the same filepath", could I get additional clarification on that?
How I interpret it as (for example) if I were to have a folder on Desktop called Pig and in it is a file called squeal (to replace a Yes, let's say), and another folder called Hog with another sound called squeal2 (to replace a What), is this what you mean?
I hope I worded that correctly.
 
Top