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

JASS: WaitForSoundBJHint

Status
Not open for further replies.
Level 3
Joined
Dec 7, 2012
Messages
52
WaitForSoundBJ - yes, i know, thx! :)
... but i need to use WaitForSoundBJHint, and this function with such parameters return error: "expected a function name"!.. :(
 
Level 3
Joined
Dec 7, 2012
Messages
52
Hm!... very strange!..
I found this function in war3.mpq\UI\TriggerStrings.txt
--
Ok, how to insert "wait" between sounds which run by different triggers? "Wait" duration must be equal duration of last played sound (if sound is playing).
 
Level 3
Joined
Dec 7, 2012
Messages
52
I've trying to create a my own SoundSet. And, for example, i have two events: 1) event "Select a unit" has an action PlaySound "What1";
2) event "Unit is issued an order targeting a point" has an action PlaySound "Yes1";
Each of them run with different triggers.
--
And when play sound "What1" (if i select a unit) and i give to my unit order targeting a point - my another trigger is running immediately!
How i can insert pause between my triggers, so that second sound wait for first sound will finishing playing?
Insert WaitForSound action after PlaySound "What1" do not work in this situation!..
I try custom script: call WaitForSoundBJ( GetLastPlayedSound(), GetSoundDuration(GetLastPlayedSound() ) )
but this not help me too...
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Waits work for the trigger instance they are in. Different trigger/instances can run parallel. You have to put the Wait before Yes1.

But when you observe the behavior in Wc3, it's actually not the way that the sounds would be queued up, rather it checks if there is already a sound playing and in this case refrains from playing the 2nd one altogether. Else the delayed feedback may seem weird, and you do not want to build an endless chain of sounds.
 
Level 3
Joined
Dec 7, 2012
Messages
52
ok, thx!
Maybe you know function (actions) which allows to return UnitType with max (Stats)-Priority from units in currently selected unit group and to compare returned UnitType with the UnitType that have required to me? :)
 
Level 3
Joined
Dec 7, 2012
Messages
52
No, i need UnitPriority for play only the SoundSet of Unit that have a highest priority in currently selected UnitGroup. Otherwise, i have more than one playing SoundSet (from different UnitTypes) if currently selected UnitGroup contains my CustomUnit.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
That is custom, you are using it in a fashion different from its original purpose. Rather than "Priority" you can change "Point-value", which has no mechanism attached and can be read via script. Yet since one would usually want to assign more/a lot of custom data to a unit type for example, the uniform method would be to do this in code, e.g. in a hashtable using the unit type id as key.
 
Status
Not open for further replies.
Top