• 🏆 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!

Prompt sound from unit?

Status
Not open for further replies.
Level 25
Joined
Jul 10, 2006
Messages
3,315
Well yes.

The sounds from each unit's sound set are all individually available in the sound editor. If you want to randomise it, put all the sounds in an array and specify a random index:

Set FootmanAttackSound[1] = Footman Attack 1
Set FootmanAttackSound[2] = Footman Attack 2
etc

Then play it with Sound - Play FootmanAttackSound[random number between 1 and 2]
 
Level 7
Joined
May 11, 2010
Messages
278
Thing is I'd like to make a trigger that selects a random unit from a group and plays one of that units "what" (selection) quotes. And I mean I can do that, but if I have to select the "what" quote of every possible unit in the sound editor and then write a trigger checking the unit type and selecting the right sound to play, it's just too much work for a fairly minor thing and simply not worth it.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
You can read the UI\SoundInfo\UnitAckSounds.slk programmatically and convert it to your jass lines, mapping the paths to the unit type id and maybe the string identifier.

edit: You also need the Units\unitUI.slk to know which soundset is attached to the unit.

and ofc the war3map.w3u for custom changes.
 
Last edited:
Status
Not open for further replies.
Top