Sound Help

Status
Not open for further replies.
Level 3
Joined
Jun 28, 2018
Messages
36
Hi I would like to have a units sound set be played by using triggers I know about

going into the sound editor and replacing the sounds of one of the existing sound

sets but I really don’t want to do it that way and I have already tried writing a trigger

myself but it didn’t work. Maybe someone knows of a tutorial that could help me out

or explain how to do it, any help would be good thanks.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Here's one way to trigger it.

When you select the unit it will play a random SelectSound.
When you issue an order targeting a Point it will play a random MoveSound.
When you issue an order targeting an Enemy it will play a random AttackSound.

  • Setup Sounds
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet SelectSounds[1] = FootmanWhat1 <gen>
      • Set VariableSet SelectSounds[2] = FootmanWhat2 <gen>
      • Set VariableSet SelectSounds[3] = FootmanWhat3 <gen>
      • Set VariableSet MoveSounds[1] = FootmanYes1 <gen>
      • Set VariableSet MoveSounds[2] = FootmanYes2 <gen>
      • Set VariableSet MoveSounds[3] = FootmanYes3 <gen>
      • Set VariableSet AttackSounds[1] = FootmanYesAttack1 <gen>
      • Set VariableSet AttackSounds[2] = FootmanYesAttack2 <gen>
      • Set VariableSet AttackSounds[3] = FootmanYesAttack3 <gen>
  • Play Select Sound
    • Events
      • Player - Player 1 (Red) Selects a unit
      • Player - Player 2 (Blue) Selects a unit
      • Player - Player 3 (Teal) Selects a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Rifleman
      • PreventSounds[(Player number of (Triggering player))] Equal to False
    • Actions
      • Set VariableSet TempPlayer = (Triggering player)
      • Set VariableSet TempSound = No sound
      • Custom script: if GetLocalPlayer() == udg_TempPlayer then
      • Set VariableSet TempSound = SelectSounds[(Random integer number between 1 and 3)]
      • Custom script: endif
      • Sound - Play TempSound at 100.00% volume, attached to (Triggering unit)
      • Set VariableSet PreventSounds[(Player number of (Triggering player))] = True
      • Wait 2.00 seconds
      • Set VariableSet PreventSounds[(Player number of (Triggering player))] = False
  • Play Move Sound
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Rifleman
      • Or - Any (Conditions) are true
        • Conditions
          • (Issued order) Equal to (Order(move))
          • (Issued order) Equal to (Order(smart))
          • (Issued order) Equal to (Order(patrol))
          • (Issued order) Equal to (Order(attack))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PreventSounds[(Player number of (Owner of (Triggering unit)))] Equal to False
        • Then - Actions
          • Set VariableSet TempPlayer = (Owner of (Triggering unit))
          • Set VariableSet TempSound = No sound
          • Custom script: if GetLocalPlayer() == udg_TempPlayer then
          • Set VariableSet TempSound = MoveSounds[(Random integer number between 1 and 3)]
          • Custom script: endif
          • Sound - Play TempSound at 100.00% volume, attached to (Triggering unit)
          • Set VariableSet PreventSounds[(Player number of (Owner of (Triggering unit)))] = True
          • Wait 2.00 seconds
          • Set VariableSet PreventSounds[(Player number of (Owner of (Triggering unit)))] = False
        • Else - Actions
  • Play Attack Sound
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Rifleman
      • ((Target unit of issued order) belongs to an enemy of (Owner of (Triggering unit)).) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PreventSounds[(Player number of (Owner of (Triggering unit)))] Equal to False
        • Then - Actions
          • Set VariableSet TempPlayer = (Owner of (Triggering unit))
          • Set VariableSet TempSound = No sound
          • Custom script: if GetLocalPlayer() == udg_TempPlayer then
          • Set VariableSet TempSound = AttackSounds[(Random integer number between 1 and 3)]
          • Custom script: endif
          • Sound - Play TempSound at 100.00% volume, attached to (Triggering unit)
          • Set VariableSet PreventSounds[(Player number of (Owner of (Triggering unit)))] = True
          • Wait 2.00 seconds
          • Set VariableSet PreventSounds[(Player number of (Owner of (Triggering unit)))] = False
        • Else - Actions
I used a Rifleman as an example, setting it's Unit Sound Set to None in the Object Editor and triggering it to sound like a Footman. Of course, you would want to change the Footman sound VARIABLES with your custom ones.

The Boolean PreventSounds is used to add a delay between playing sounds so you aren't overwhelmed with multiple sounds at once.
 

Attachments

  • Sound Example.w3m
    19.9 KB · Views: 45
Last edited:
Level 3
Joined
Jun 28, 2018
Messages
36
Here's one way to trigger it.

When you select the unit it will play a random SelectSound.
When you issue an order targeting a Point it will play a random MoveSound.
When you issue an order targeting an Enemy it will play a random AttackSound.

  • Setup Sounds
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet SelectSounds[1] = FootmanWhat1 <gen>
      • Set VariableSet SelectSounds[2] = FootmanWhat2 <gen>
      • Set VariableSet SelectSounds[3] = FootmanWhat3 <gen>
      • Set VariableSet MoveSounds[1] = FootmanYes1 <gen>
      • Set VariableSet MoveSounds[2] = FootmanYes2 <gen>
      • Set VariableSet MoveSounds[3] = FootmanYes3 <gen>
      • Set VariableSet AttackSounds[1] = FootmanYesAttack1 <gen>
      • Set VariableSet AttackSounds[2] = FootmanYesAttack2 <gen>
      • Set VariableSet AttackSounds[3] = FootmanYesAttack3 <gen>
  • Play Select Sound
    • Events
      • Player - Player 1 (Red) Selects a unit
      • Player - Player 2 (Blue) Selects a unit
      • Player - Player 3 (Teal) Selects a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Rifleman
      • PreventSounds[(Player number of (Triggering player))] Equal to False
    • Actions
      • Set VariableSet TempPlayer = (Triggering player)
      • Set VariableSet TempSound = No sound
      • Custom script: if GetLocalPlayer() == udg_TempPlayer then
      • Set VariableSet TempSound = SelectSounds[(Random integer number between 1 and 3)]
      • Custom script: endif
      • Sound - Play TempSound at 100.00% volume, attached to (Triggering unit)
      • Set VariableSet PreventSounds[(Player number of (Triggering player))] = True
      • Wait 2.00 seconds
      • Set VariableSet PreventSounds[(Player number of (Triggering player))] = False
  • Play Move Sound
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Rifleman
      • Or - Any (Conditions) are true
        • Conditions
          • (Issued order) Equal to (Order(move))
          • (Issued order) Equal to (Order(smart))
          • (Issued order) Equal to (Order(patrol))
          • (Issued order) Equal to (Order(attack))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PreventSounds[(Player number of (Owner of (Triggering unit)))] Equal to False
        • Then - Actions
          • Set VariableSet TempPlayer = (Owner of (Triggering unit))
          • Set VariableSet TempSound = No sound
          • Custom script: if GetLocalPlayer() == udg_TempPlayer then
          • Set VariableSet TempSound = MoveSounds[(Random integer number between 1 and 3)]
          • Custom script: endif
          • Sound - Play TempSound at 100.00% volume, attached to (Triggering unit)
          • Set VariableSet PreventSounds[(Player number of (Owner of (Triggering unit)))] = True
          • Wait 2.00 seconds
          • Set VariableSet PreventSounds[(Player number of (Owner of (Triggering unit)))] = False
        • Else - Actions
  • Play Attack Sound
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Rifleman
      • ((Target unit of issued order) belongs to an enemy of (Owner of (Triggering unit)).) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PreventSounds[(Player number of (Owner of (Triggering unit)))] Equal to False
        • Then - Actions
          • Set VariableSet TempPlayer = (Owner of (Triggering unit))
          • Set VariableSet TempSound = No sound
          • Custom script: if GetLocalPlayer() == udg_TempPlayer then
          • Set VariableSet TempSound = AttackSounds[(Random integer number between 1 and 3)]
          • Custom script: endif
          • Sound - Play TempSound at 100.00% volume, attached to (Triggering unit)
          • Set VariableSet PreventSounds[(Player number of (Owner of (Triggering unit)))] = True
          • Wait 2.00 seconds
          • Set VariableSet PreventSounds[(Player number of (Owner of (Triggering unit)))] = False
        • Else - Actions
I used a Rifleman as an example, setting it's Unit Sound Set to None in the Object Editor and triggering it to sound like a Footman. Of course, you would want to replace the Footman sounds with your custom ones.

The Boolean PreventSounds is used to add a delay between playing sounds so you aren't overwhelmed with multiple sounds at once.
Thank you very much for the answer I have not had a chance yet to go and try all that out Ill go check it out now
but I noticed at the bottom you say that I will have to replace the sound of the Footman but that is exactly what I
don't want to do I want to import custom sounds and have them play with triggers. But anyway Ill check it all out
and thank you again very much.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Poor choice of words on my part, I meant you need to change or set the sound variables as your custom sounds.
  • Set VariableSet SelectSounds[1] = YourSound <gen>
And I didn't add variables/triggers for every type of sound (like the Death sound) but hopefully you understand the triggers and can add these yourself. If not, I could edit it myself, just let me know what you need.
 
Last edited:
Level 3
Joined
Jun 28, 2018
Messages
36
Poor choice of words on my part, I meant you need to change or set the sound variables as your custom sounds.
  • Set VariableSet SelectSounds[1] = YourSound <gen>
And I didn't add variables/triggers for every type of sound (like the Death sound) but hopefully you understand the triggers and can add these yourself. If not, I could edit it myself, just let me know what you need.

Awesome thank you.
 
Level 3
Joined
Jun 28, 2018
Messages
36
Poor choice of words on my part, I meant you need to change or set the sound variables as your custom sounds.
  • Set VariableSet SelectSounds[1] = YourSound <gen>
And I didn't add variables/triggers for every type of sound (like the Death sound) but hopefully you understand the triggers and can add these yourself. If not, I could edit it myself, just let me know what you need.

Hi Uncle you will have to excuse me I am still learning, I just need to know what type
of variable must I use for SelectSounds MoveSounds and AttackSounds I guessed that
it is probably a sound variable also I need to know when I am busy making the trigger
how do you get it to say (Set VariableSet) because the closest I can get is as shown in
the picture below. Also I don’t know how to get PreventSounds to appear under conditions.
Also will it be ok to just copy and paste the custom script that you have given here or do
I have to change anything?
My Trigger.jpg
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
1) Yes, it's a Sound variable (Array)
2) Set VariableSet is a Reforged bug, it's the same thing as Set Variable
3) PreventSounds is a Boolean, it's found under Variables (it's a bubble that you can click, you'll see it near the top) after you select Boolean Comparison
4) Yes, just copy and paste the custom script.

I recommend copying and pasting an existing trigger like Play Attack Sounds (one that uses an If Then Else in it's Actions). Then from there you edit the Events/Conditions to suit your needs.

For example, creating a Death sound trigger:

Change the Event to "A unit dies".

Delete the "target unit of issued order belongs to an enemy" condition since we're not dealing with orders/targets.

Use the same exact Actions that Play Attack Sounds uses. This works because Triggering Unit is the same thing as Dying unit so no change is needed.

The only time you'll need to tweak the Actions is if Triggering Unit is NOT equal to the Unit in your Event, which will most likely never be the case.

Note: If you don't want to use PreventSounds, simply delete it from the Conditions and delete it from the Actions (including the Wait that goes along with it).
 
Last edited:
Level 3
Joined
Jun 28, 2018
Messages
36
1) Yes, it's a Sound variable (Array)
2) Set VariableSet is a Reforged bug, it's the same thing as Set Variable
3) PreventSounds is a Boolean, it's found under Variables (it's a bubble that you can click, you'll see it near the top) after you select Boolean Comparison
4) Yes, just copy and paste the custom script.

I recommend copying and pasting an existing trigger like Play Attack Sounds (one that uses an If Then Else in it's Actions). Then from there you edit the Events/Conditions to suit your needs.

For example, creating a Death sound trigger:

Change the Event to "A unit dies".

Delete the "target unit of issued order belongs to an enemy" condition since we're not dealing with orders/targets.

Use the same exact Actions that Play Attack Sounds uses. This works because Triggering Unit is the same thing as Dying unit so no change is needed.

The only time you'll need to tweak the Actions is if Triggering Unit is NOT equal to the Unit in your Event, which will most likely never be the case.

Note: If you don't want to use PreventSounds, simply delete it from the Conditions and delete it from the Actions (including the Wait that goes along with it).

Hi Uncle, I also need to know what type of variable is TempPlayer and TempSound
And I don’t know how to make the condition say PreventSounds[(Player number of (Owner of (Triggering unit)))] Equal to False the closest that I can get is PreventSounds Equal to False.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
PreventSounds is an Array. You use the player number as the Index.

TempPlayer and TempSound are named after what they do.

You can also figure out what they are by their value. See how I set TempSound = No sound. It's not like you can set an Integer = No sound.
  • Set VariableSet TempSound = No sound
Same goes for TempPlayer. The owner of a unit is obviously a Player.
  • Set VariableSet TempPlayer = (Owner of (Triggering unit))
 
Level 3
Joined
Jun 28, 2018
Messages
36
PreventSounds is an Array. You use the player number as the Index.

TempPlayer and TempSound are named after what they do.

You can also figure out what they are by their value. See how I set TempSound = No sound. It's not like you can set an Integer = No sound.
  • Set VariableSet TempSound = No sound
Same goes for TempPlayer. The owner of a unit is obviously a Player.
  • Set VariableSet TempPlayer = (Owner of (Triggering unit))

Hi Uncle, I got the first two triggers (move & select) working perfectly it is
so cool thank you but I am stuck on the attack trigger under condition where it says
((Target unit of issued order) belongs to an enemy of (Owner of (Triggering unit)).) Equal to True
I get as far as ((Target unit of issued order) but then I don’t know how to make it
say - belongs to an enemy of (Owner of (Triggering unit)).) I think you mentioned that you
are using the map editor from Reforged where as I am still using the old one would that
have anything to do with it? Another question I have is that in the sound editor if I go to
the settings of my imported files I am unable to select the option (3D sound) because it
is greyed out and when the unit is on the far other side of the map if I push shortcut key
to select it I am getting full volume.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
I forget how to fix the sounds but I believe it has to do with their file type. Maybe .wav or .mp3 will work. Search around for how to import 3d custom sounds.

And it's a Boolean Comparison to check if a unit belongs to an enemy of player. See the attached picture.
 

Attachments

  • ex.png
    ex.png
    52.8 KB · Views: 29
Level 3
Joined
Jun 28, 2018
Messages
36
I forget how to fix the sounds but I believe it has to do with their file type. Maybe .wav or .mp3 will work. Search around for how to import 3d custom sounds.

And it's a Boolean Comparison to check if a unit belongs to an enemy of player. See the attached picture.

Hi Uncle, I fixed the 3D sound problem so the short range and long range volume
is working correctly now, it turns out that I was unable to select 3D sound because
my imported sounds had 2 channels (or stereo) so I used an app called Audacity
and converted them to mono, I figured it out by looking at one of the default sounds
as an example. All three triggers are also working great now (move, select and attack)
but I would just like you to have a look at my triggers I’ve uploaded screenshots of them
because I can’t get it to say
Set PreventSounds[(Player number of (Triggering player))] = true or false
I can only get it to say Set PreventSounds = true or false
Ok, thanks again.

My Trigger 00001.jpg


My Trigger 00002.jpg
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
PreventSounds uses an Array. That's what adds the brackets after a Variable:
  • SomeVariable[1]
  • SomeVariable[2]
  • SomeVariable[3]
You can plug any Integer (like a Player's Number) in the Index [] of these Arrays.

I recommend looking up how to use Arrays if you're still confused.
 
Last edited:
Level 3
Joined
Jun 28, 2018
Messages
36
PreventSounds uses an Array. That's what adds the brackets after a Variable:
  • SomeVariable[1]
  • SomeVariable[2]
  • SomeVariable[3]
You can plug any Integer (like a Player's Number) in the Index [] of these Arrays.
I recommend looking up how to use Arrays if you're still confused.

Hi Uncle, everything is rite now the triggers all look rite and they are all working properly
I was just wondering if you could show me how to make a trigger for the angry sounds.
I already made a very simple trigger for the death sound which seems to be working fine
the only problem I had was that even after I set the sound set to (None) in the object
editor when the unit dies it plays the sound from my trigger and the units default death
sound together at the same time, so any help with that would be cool, ok thanks.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
I was thinking about that. My idea was to use that in combination with a Special Effect to mimic the Death animation (use a sfx model of the unit playing it's death animation), but then I realized that those would play the Death Sound as well.

I wonder if there's some trick to getting around it... Like skipping the part of the Animation that plays the Sound if that's even how it works.
 
Cool thats a good idea thank you but, I'd rather like the unit to die normally.

Is there any reason you need them to die normally? An alternative might be to remove/move the unit, and play an animation in its place - which is effectively how explode works anyways.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Edit:
Here's a flying height method that will silence the death sound.

I tested it with dying Footman but i'm not sure if the Wait will vary based on the unit-type (some unit's models might play their death sound earlier/later than others).
  • Silent Death 2
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Unit - Add Storm Crow Form to (Triggering unit)
      • Unit - Remove Storm Crow Form from (Triggering unit)
      • Animation - Change (Triggering unit) flying height to 10000.00 at 0.00
      • Wait 0.15 seconds
      • Animation - Change (Triggering unit) flying height to 0.00 at 0.00
Unfortunately, the Wait will cause the unit to disappear for a short moment.

Storm Crow Form is needed to change the flying height of non-flyers.
 
Last edited:
Level 3
Joined
Jun 28, 2018
Messages
36
Edit:
Here's a flying height method that will silence the death sound.

I tested it with dying Footman but i'm not sure if the Wait will vary based on the unit-type (some unit's models might play their death sound earlier/later than others).
  • Silent Death 2
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Unit - Add Storm Crow Form to (Triggering unit)
      • Unit - Remove Storm Crow Form from (Triggering unit)
      • Animation - Change (Triggering unit) flying height to 10000.00 at 0.00
      • Wait 0.15 seconds
      • Animation - Change (Triggering unit) flying height to 0.00 at 0.00
Unfortunately, the Wait will cause the unit to disappear for a short moment.

Storm Crow Form is needed to change the flying height of non-flyers.

Hi Uncle, that trigger you showed me looks like a good idea but it does not work
I think the reason might be because my unit is set to be a building because I am
making a TD I also did find that model editing app here on the Hive and the link you
gave me shows how to use it to remove the death sound but the only problem with
that is that after I removed the death sound the model bombs and does not appear
in the map so I had to load a backup, I am however able to change the death sound
to something else with the model editor so if I have got no other choice I can just
choose something quiet. Also I wanted to ask, it is not absolutely essential
but I would really like to include the angry sounds if there is any way of doing that,
that would be great please, ok thanks.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
You can choose something silent as well. No reason a sound needs to actually play anything.

And angry sounds is a bit more complex if you want it to work like Warcraft 3s system for multiple Units. (multiple clicks on the same unit replace it's original What responses with Pissed responses).

However, for a single unit, it's simple:
  • Play Select Sound
    • Events
      • Player - Player 1 (Red) Selects a unit
      • Player - Player 2 (Blue) Selects a unit
      • Player - Player 3 (Teal) Selects a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Rifleman
      • PreventSounds[(Player number of (Triggering player))] Equal to False
    • Actions
      • Set VariableSet PissedCounter[(Player number of (Triggering player))] = (PissedCounter[(Player number of (Triggering player))] + 1)
      • Set VariableSet TempPlayer = (Triggering player)
      • Set VariableSet TempSound = No sound
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PissedCounter[(Player number of (Triggering player))] Less than 4
        • Then - Actions
          • -------- What --------
          • Custom script: if GetLocalPlayer() == udg_TempPlayer then
          • Set VariableSet TempSound = SelectSounds[(Random integer number between 1 and 3)]
          • Sound - Play TempSound at 100.00% volume, attached to (Triggering unit)
          • Custom script: endif
        • Else - Actions
          • -------- Pissed --------
          • Custom script: if GetLocalPlayer() == udg_TempPlayer then
          • Set VariableSet TempSound = PissedSounds[(Random integer number between 1 and 3)]
          • Sound - Play TempSound at 100.00% volume, attached to (Triggering unit)
          • Custom script: endif
      • Set VariableSet PreventSounds[(Player number of (Triggering player))] = True
      • Wait 2.00 seconds
      • Set VariableSet PreventSounds[(Player number of (Owner of (Triggering unit)))] = False
      • Wait 5.00 seconds
      • Set VariableSet PissedCounter[(Player number of (Owner of (Triggering unit)))] = (PissedCounter[(Player number of (Owner of (Triggering unit)))] - 1)
PissedCounter = Integer (Array)

I keep track of the number of times the What sound has played recently with an Integer variable. Once you click a unit for the 4th+ time in a row, it will play it's Pissed sound instead of it's What sound. After 5.00 seconds I reduce this Integer so that it will eventually return back to it's normal What sound.

I also fixed a small bug in this trigger where I was using Player number of (Triggering player) after the 2.00 second Wait. It should be Player number of (Owner of (Triggering unit)), I fixed it in this update.
 
Level 3
Joined
Jun 28, 2018
Messages
36
You can choose something silent as well. No reason a sound needs to actually play anything.

And angry sounds is a bit more complex if you want it to work like Warcraft 3s system for multiple Units. (multiple clicks on the same unit replace it's original What responses with Pissed responses).

However, for a single unit, it's simple:
  • Play Select Sound
    • Events
      • Player - Player 1 (Red) Selects a unit
      • Player - Player 2 (Blue) Selects a unit
      • Player - Player 3 (Teal) Selects a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Rifleman
      • PreventSounds[(Player number of (Triggering player))] Equal to False
    • Actions
      • Set VariableSet PissedCounter[(Player number of (Triggering player))] = (PissedCounter[(Player number of (Triggering player))] + 1)
      • Set VariableSet TempPlayer = (Triggering player)
      • Set VariableSet TempSound = No sound
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PissedCounter[(Player number of (Triggering player))] Less than 4
        • Then - Actions
          • -------- What --------
          • Custom script: if GetLocalPlayer() == udg_TempPlayer then
          • Set VariableSet TempSound = SelectSounds[(Random integer number between 1 and 3)]
          • Sound - Play TempSound at 100.00% volume, attached to (Triggering unit)
          • Custom script: endif
        • Else - Actions
          • -------- Pissed --------
          • Custom script: if GetLocalPlayer() == udg_TempPlayer then
          • Set VariableSet TempSound = PissedSounds[(Random integer number between 1 and 3)]
          • Sound - Play TempSound at 100.00% volume, attached to (Triggering unit)
          • Custom script: endif
      • Set VariableSet PreventSounds[(Player number of (Triggering player))] = True
      • Wait 2.00 seconds
      • Set VariableSet PreventSounds[(Player number of (Owner of (Triggering unit)))] = False
      • Wait 5.00 seconds
      • Set VariableSet PissedCounter[(Player number of (Owner of (Triggering unit)))] = (PissedCounter[(Player number of (Owner of (Triggering unit)))] - 1)
PissedCounter = Integer (Array)

I keep track of the number of times the What sound has played recently with an Integer variable. Once you click a unit for the 4th+ time in a row, it will play it's Pissed sound instead of it's What sound. After 5.00 seconds I reduce this Integer so that it will eventually return back to it's normal What sound.

I also fixed a small bug in this trigger where I was using Player number of (Triggering player) after the 2.00 second Wait. It should be Player number of (Owner of (Triggering unit)), I fixed it in this update.

Hi Uncle, thank you for the trigger you made, I made mine exactly the same
going by your example, but I have a question, where the trigger says
Set TempSound = PissedSounds[(Random integer number between 1 and 3)]
the pissed sounds tell a story in order first 1 then 2 etc... so it can’t be random
could you maybe show me a way of how to do it that way. Also I have another question,
rite at the very end of the trigger where it sets PissedCounter to - 1 should it not rather set it back to 0?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
I personally think it works better with the -1 instead of resetting to 0. Otherwise, it will reset to 0 multiple times and could make it take like 8+ clicks to play the Pissed sound again.

And you can use an Integer the same way I used PissedCounter, then reference this Integer instead of a Random integer number between 1 and 3.

Set 3 to however many Pissed sounds the unit has.
  • -------- Pissed --------
  • If PissedStory[player number] < 3 then Set PissedStory[player number] = PissedStory[player number] + 1
  • Set TempSound = PissedSounds[PissedStory[player number]]
Then after the Wait 5.00 seconds:
  • Set PissedStory[player number] = PissedStory[player number] - 1
You can try it with resetting to 0, it won't break the system or anything it'll just function differently.
 
Level 3
Joined
Jun 28, 2018
Messages
36
I personally think it works better with the -1 instead of resetting to 0. Otherwise, it will reset to 0 multiple times and could make it take like 8+ clicks to play the Pissed sound again.

And you can use an Integer the same way I used PissedCounter, then reference this Integer instead of a Random integer number between 1 and 3.

Set 3 to however many Pissed sounds the unit has.
  • -------- Pissed --------
  • If PissedStory[player number] < 3 then Set PissedStory[player number] = PissedStory[player number] + 1
  • Set TempSound = PissedSounds[PissedStory[player number]]
Then after the Wait 5.00 seconds:
  • Set PissedStory[player number] = PissedStory[player number] - 1
You can try it with resetting to 0, it won't break the system or anything it'll just function differently.

Hi Uncle, sorry please excuse me but you are going a little bit to fast for me
I understand that I have to make a PissedStory integer array variable but I don’t know
how to make these two lines
If PissedStory[player number] < 3 then Set PissedStory[player number] = PissedStory[player number] + 1
Set TempSound = PissedSounds[PissedStory[player number]]
I don’t know where to find it maybe if you can walk me through it a little, also if it is
not to much trouble could you show me what the whole trigger should look like, ok thanks.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Variables:
SelectDuration = Real (Array)
SelectCounterOld = Integer (Array)
SelectCounterNew = Integer (Array)

PissedDuration = Real (Array)
PissedStory = Integer (Array)

SoundDuration = Real
PN = Integer

Create all of these variables before doing anything else!

  • Setup Sounds
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet SelectSounds[1] = FootmanWhat1 <gen>
      • Set VariableSet SelectSounds[2] = FootmanWhat2 <gen>
      • Set VariableSet SelectSounds[3] = FootmanWhat3 <gen>
      • Set VariableSet SelectDuration[1] = 1.10
      • Set VariableSet SelectDuration[2] = 1.20
      • Set VariableSet SelectDuration[3] = 1.50
      • -------- --------
      • Set VariableSet MoveSounds[1] = FootmanYes1 <gen>
      • Set VariableSet MoveSounds[2] = FootmanYes2 <gen>
      • Set VariableSet MoveSounds[3] = FootmanYes3 <gen>
      • -------- --------
      • Set VariableSet AttackSounds[1] = FootmanYesAttack1 <gen>
      • Set VariableSet AttackSounds[2] = FootmanYesAttack2 <gen>
      • Set VariableSet AttackSounds[3] = FootmanYesAttack3 <gen>
      • -------- --------
      • Set VariableSet PissedSounds[1] = FootmanPissed1 <gen>
      • Set VariableSet PissedSounds[2] = FootmanPissed2 <gen>
      • Set VariableSet PissedSounds[3] = FootmanPissed3 <gen>
      • Set VariableSet PissedDuration[1] = 2.10
      • Set VariableSet PissedDuration[2] = 2.70
      • Set VariableSet PissedDuration[3] = 3.10
  • Play Select Sound
    • Events
      • Player - Player 1 (Red) Selects a unit
      • Player - Player 2 (Blue) Selects a unit
      • Player - Player 3 (Teal) Selects a unit
    • Conditions
      • PreventSounds[(Player number of (Triggering player))] Equal to False
      • (Unit-type of (Triggering unit)) Equal to Rifleman
    • Actions
      • Set VariableSet PN = (Player number of (Triggering player))
      • -------- --------
      • Set VariableSet PreventSounds[PN] = True
      • Set VariableSet PissedCounter[PN] = (PissedCounter[PN] + 1)
      • Set VariableSet SelectCounterNew[PN] = (SelectCounterNew[PN] + 1)
      • Set VariableSet TempPlayer = (Triggering player)
      • Set VariableSet TempSound = No sound
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PissedCounter[PN] Less than 4
        • Then - Actions
          • -------- What --------
          • Set VariableSet TempInteger = (Random integer number between 1 and 3)
          • Set VariableSet SoundDuration = SelectDuration[TempInteger]
          • Custom script: if GetLocalPlayer() == udg_TempPlayer then
          • Set VariableSet TempSound = SelectSounds[TempInteger]
          • Sound - Play TempSound at 100.00% volume, attached to (Triggering unit)
          • Custom script: endif
        • Else - Actions
          • -------- Pissed --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PissedStory[PN] Less than 3
            • Then - Actions
              • Set VariableSet PissedStory[PN] = (PissedStory[PN] + 1)
            • Else - Actions
              • Set VariableSet PissedStory[PN] = 1
          • Set VariableSet SoundDuration = PissedDuration[PissedStory[PN]]
          • Custom script: if GetLocalPlayer() == udg_TempPlayer then
          • Set VariableSet TempSound = PissedSounds[PissedStory[PN]]
          • Sound - Play TempSound at 100.00% volume, attached to (Triggering unit)
          • Custom script: endif
      • -------- --------
      • Wait SoundDuration seconds
      • Set VariableSet PN = (Player number of (Owner of (Triggering unit)))
      • Set VariableSet PreventSounds[PN] = False
      • Wait 1.00 seconds
      • Set VariableSet PN = (Player number of (Owner of (Triggering unit)))
      • Set VariableSet SelectCounterOld[PN] = (SelectCounterOld[PN] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SelectCounterNew[PN] Equal to SelectCounterOld[PN]
        • Then - Actions
          • Set VariableSet PissedCounter[PN] = 0
          • Set VariableSet PissedStory[PN] = 0
        • Else - Actions

So I changed how the Select Sounds work. It will now work more like Warcraft 3's system, and that is if you stop clicking the unit for a short time it will reset back to the standard What Sounds and you'll have to click it a few more times to get back to the Pissed sounds.

I also added the PissedStory[] variable so the unit will play it's PissedSounds from 1 to 3 in that order.

Keep in mind that if you have more or less than 3 Sounds you will have to adjust the triggers accordingly for ANY of these sounds.

What to adjust:

WHAT SOUNDS:
Set VariableSet TempInteger = (Random integer number between 1 and 3)
-Set the 3 to your total # of what sounds

PISSED SOUNDS:
PissedStory[PN] Less than 3
-Set the 3 to your total # of pissed sounds

PissedCounter[PN] Less than 4
-Set the 4 to total # of pissed sounds + 1
 

Attachments

  • Sound Example 2.w3m
    21.4 KB · Views: 25
Last edited:
Level 3
Joined
Jun 28, 2018
Messages
36
Variables:
SelectDuration = Real (Array)
SelectCounterOld = Integer (Array)
SelectCounterNew = Integer (Array)

PissedDuration = Real (Array)
PissedStory = Integer (Array)

SoundDuration = Real
PN = Integer

Create all of these variables before doing anything else!

  • Setup Sounds
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet SelectSounds[1] = FootmanWhat1 <gen>
      • Set VariableSet SelectSounds[2] = FootmanWhat2 <gen>
      • Set VariableSet SelectSounds[3] = FootmanWhat3 <gen>
      • Set VariableSet SelectDuration[1] = 1.10
      • Set VariableSet SelectDuration[2] = 1.20
      • Set VariableSet SelectDuration[3] = 1.50
      • -------- --------
      • Set VariableSet MoveSounds[1] = FootmanYes1 <gen>
      • Set VariableSet MoveSounds[2] = FootmanYes2 <gen>
      • Set VariableSet MoveSounds[3] = FootmanYes3 <gen>
      • -------- --------
      • Set VariableSet AttackSounds[1] = FootmanYesAttack1 <gen>
      • Set VariableSet AttackSounds[2] = FootmanYesAttack2 <gen>
      • Set VariableSet AttackSounds[3] = FootmanYesAttack3 <gen>
      • -------- --------
      • Set VariableSet PissedSounds[1] = FootmanPissed1 <gen>
      • Set VariableSet PissedSounds[2] = FootmanPissed2 <gen>
      • Set VariableSet PissedSounds[3] = FootmanPissed3 <gen>
      • Set VariableSet PissedDuration[1] = 2.10
      • Set VariableSet PissedDuration[2] = 2.70
      • Set VariableSet PissedDuration[3] = 3.10
  • Play Select Sound
    • Events
      • Player - Player 1 (Red) Selects a unit
      • Player - Player 2 (Blue) Selects a unit
      • Player - Player 3 (Teal) Selects a unit
    • Conditions
      • PreventSounds[(Player number of (Triggering player))] Equal to False
      • (Unit-type of (Triggering unit)) Equal to Rifleman
    • Actions
      • Set VariableSet PN = (Player number of (Triggering player))
      • -------- --------
      • Set VariableSet PreventSounds[PN] = True
      • Set VariableSet PissedCounter[PN] = (PissedCounter[PN] + 1)
      • Set VariableSet SelectCounterNew[PN] = (SelectCounterNew[PN] + 1)
      • Set VariableSet TempPlayer = (Triggering player)
      • Set VariableSet TempSound = No sound
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PissedCounter[PN] Less than 4
        • Then - Actions
          • -------- What --------
          • Set VariableSet TempInteger = (Random integer number between 1 and 3)
          • Set VariableSet SoundDuration = SelectDuration[TempInteger]
          • Custom script: if GetLocalPlayer() == udg_TempPlayer then
          • Set VariableSet TempSound = SelectSounds[TempInteger]
          • Sound - Play TempSound at 100.00% volume, attached to (Triggering unit)
          • Custom script: endif
        • Else - Actions
          • -------- Pissed --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PissedStory[PN] Less than 3
            • Then - Actions
              • Set VariableSet PissedStory[PN] = (PissedStory[PN] + 1)
            • Else - Actions
              • Set VariableSet PissedStory[PN] = 1
          • Set VariableSet SoundDuration = PissedDuration[PissedStory[PN]]
          • Custom script: if GetLocalPlayer() == udg_TempPlayer then
          • Set VariableSet TempSound = PissedSounds[PissedStory[PN]]
          • Sound - Play TempSound at 100.00% volume, attached to (Triggering unit)
          • Custom script: endif
      • -------- --------
      • Wait SoundDuration seconds
      • Set VariableSet PN = (Player number of (Owner of (Triggering unit)))
      • Set VariableSet PreventSounds[PN] = False
      • Wait 1.00 seconds
      • Set VariableSet PN = (Player number of (Owner of (Triggering unit)))
      • Set VariableSet SelectCounterOld[PN] = (SelectCounterOld[PN] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SelectCounterNew[PN] Equal to SelectCounterOld[PN]
        • Then - Actions
          • Set VariableSet PissedCounter[PN] = 0
          • Set VariableSet PissedStory[PN] = 0
        • Else - Actions

So I changed how the Select Sounds work. It will now work more like Warcraft 3's system, and that is if you stop clicking the unit for a short time it will reset back to the standard What Sounds and you'll have to click it a few more times to get back to the Pissed sounds.

I also added the PissedStory[] variable so the unit will play it's PissedSounds from 1 to 3 in that order.

Keep in mind that if you have more or less than 3 Sounds you will have to adjust the triggers accordingly.

What to adjust:
Set VariableSet TempInteger = (Random integer number between 1 and 3)
-Set the 3 to your total # of what sounds

PissedStory[PN] Less than 3
-Set the 3 to your total # of pissed sounds

PissedCounter[PN] Less than 4
-Set the 4 to # of pissed sounds + 1

Hi Uncle, the trigger that you gave me for the pissed sounds is working BEAUTIFULLY
thank you so much. But I do have a little bug, you gave an example of how to make
the trigger for 3 pissed sounds and when I tested it with 3 sounds it works perfectly and
then you explained which things I need to adjust in case there are more than 3 pissed
sounds so I went and adjusted it for 5 pissed sounds:
Set VariableSet TempInteger = (Random integer number between 1 and 5)
PissedStory[PN] Less than 5
PissedCounter[PN] Less than 6
After I made the adjustments it still works correctly but if I click on the unit for the
first time it is silent then I keep the unit selected and click on him again and then
everything works normally from the second click onward?
Also thanks for the sound example map file but I can’t open it I get an
error message (Level Info data missing or invalid), ok thanks again.
 
Level 3
Joined
Jun 28, 2018
Messages
36
Is there any reason you need them to die normally? An alternative might be to remove/move the unit, and play an animation in its place - which is effectively how explode works anyways.

Hi Cokemonkey11, I figured out how to remove the death sound from model files I
downloaded a model editor that I found here on the hive I think it’s called
Magos or something like that, anyway I have posted two screenshots that
Shows how to do it and just read the little text bubble in the picture.

I figured it out by going to Windows/Sequence Manager and then in the little window
that pops up I double clicked on Death and then in the box that appears there is a section
that says (Interval) (From & To) then I made a note of the number that you see by (From)
then I went to Windows/Node Manager then in the box that appears I double clicked on all
of the little icons that look like a camera until I found the one that has got the death
sound in its settings, I tried to just disable the death sound by deleting the (From) number
out of the little icon that looks like a camera but then that made the model bomb and
I had to load a backup so then I realised that you can just delete the whole camera icon.
In the picture that I posted I explain about the name of the little camera icon but I am not
Sure because I wonder if the model making guys can probably name those icons to
Whatever they want but anyway still it works fine the way I’ve shown in those pictures.
Cool, ok buy.

Remove DS 01.jpg


Remove DS 02.jpg
 
Last edited:
Level 3
Joined
Jun 28, 2018
Messages
36
My mistake I should've made that more clear. TempInteger is used for the What sounds.
The Pissed variables are the only thing you need to change.

Hi Uncle, the triggers you helped me with are working great but I am a little
bit stuck because I want to make another trigger exactly the same for another
unit so what I did was by (Map Initialization) where it sets the variables I
created additional exactly the same type of variables and named them according
to the unit like (SelectSoundsFootman) etc, as for the rest of the variables I
just used the ones that are already there, so is that right?
And the problem that I am having is with the trigger for selecting it works fine
and if I click repeatedly it goes through the what sounds and then the pissed
sounds like it is supposed to but when the pissed sounds are finished if I keep
clicking it is silent for long like 10 or 30 seconds then it repeats the pissed sounds
again which is what it is supposed to do excepting for that long pause in between,
I have pasted my two triggers below then maybe you can show me where did I go
wrong. For the first one that I did with your help it is working perfectly I’m only
picking the problem up on this one. And I have not done the sounds for
the attack and move order yet but I’ll try those on my own first, ok thanks.

Trigger 01

Events
Map initialization
Conditions
Actions
Set ArcherSelectSound[1] = Elvan_Archer_Selected_01 <gen>
Set ArcherSelectSound[2] = Elvan_Archer_Selected_02 <gen>
Set ArcherSelectSound[3] = Elvan_Archer_Selected_03 <gen>
Set ArcherSelectSound[4] = Elvan_Archer_Selected_04 <gen>
Set ArcherSelectDuration[1] = 1.10
Set ArcherSelectDuration[2] = 1.20
Set ArcherSelectDuration[3] = 1.50
Set ArcherSelectDuration[4] = 1.50
-------- --------
Set ArcherMoveSound[1] = Elvan_Archer_Acknowledgement_01 <gen>
Set ArcherMoveSound[2] = Elvan_Archer_Acknowledgement_02 <gen>
-------- --------
Set ArcherAttackSound[1] = Elvan_Archer_Acknowledgement_03 <gen>
Set ArcherAttackSound[2] = Elvan_Archer_Acknowledgement_04 <gen>
-------- --------
Set ArcherPissedSound[1] = Elvan_Archer_Annoyed_01 <gen>
Set ArcherPissedSound[2] = Elvan_Archer_Annoyed_02 <gen>
Set ArcherPissedSound[3] = Elvan_Archer_Annoyed_03 <gen>
Set ArcherPissedDuration[1] = 2.10
Set ArcherPissedDuration[2] = 2.70
Set ArcherPissedDuration[3] = 3.10

Trigger 02

Events
Player - Player 1 (Red) Selects a unit
Player - Player 2 (Blue) Selects a unit
Player - Player 3 (Teal) Selects a unit
Player - Player 4 (Purple) Selects a unit
Conditions
PreventSounds[(Player number of (Triggering player))] Equal to False
(Unit-type of (Triggering unit)) Equal to My Unit
Actions
Set PN = (Player number of (Triggering player))
-------- --------
Set PreventSounds[PN] = True
Set PissedCounter[PN] = (PissedCounter[PN] + 1)
Set SelectCounterNew[PN] = (SelectCounterNew[PN] + 1)
Set TempPlayer = (Triggering player)
Set TempSound = No sound
-------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
PissedCounter[PN] Less than 6
Then - Actions
-------- What --------
Set TempInteger = (Random integer number between 1 and 4)
Set SoundDuration = ArcherSelectDuration[TempInteger]
Custom script: if GetLocalPlayer() == udg_TempPlayer then
Set TempSound = ArcherSelectSound[TempInteger]
Sound - Play TempSound at 100.00% volume, attached to (Triggering unit)
Custom script: endif
Else - Actions
-------- Pissed --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
PissedStory[PN] Less than 5
Then - Actions
Set PissedStory[PN] = (PissedStory[PN] + 1)
Else - Actions
Set PissedStory[PN] = 1
Set SoundDuration = PissedDuration[PissedStory[PN]]
Custom script: if GetLocalPlayer() == udg_TempPlayer then
Set TempSound = ArcherPissedSound[PissedStory[PN]]
Sound - Play TempSound at 100.00% volume, attached to (Triggering unit)
Custom script: endif
-------- --------
Wait SoundDuration seconds
Set PN = (Player number of (Owner of (Triggering unit)))
Set PreventSounds[PN] = False
Wait 1.00 seconds
Set PN = (Player number of (Owner of (Triggering unit)))
Set SelectCounterOld[PN] = (SelectCounterOld[PN] + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SelectCounterNew[PN] Equal to SelectCounterOld[PN]
Then - Actions
Set PissedCounter[PN] = 0
Set PissedStory[PN] = 0
Else - Actions
 
Level 3
Joined
Jun 28, 2018
Messages
36
How To Post Your Trigger

Note that pretty much all of those variables will need new versions, besides PN, TempPlayer, TempSound, TempInteger, and SoundDuration (Anything without an Index [] can stay the same).

Ok, thank you, but do you have any idea what could be causing that long pause? Because it does not
do that with the one that you helped me with it is only doing it with this one that I tried on my own,
ok cool thanks again.
 
Level 3
Joined
Jun 28, 2018
Messages
36
Apply the fixes that I mentioned and it should all sort itself out. Post your trigger when you're done and I can help you further.

Hi Uncle, I finished my triggers and they are working perfectly, thanks for the help,
I have posted my triggers below. I also wanted to ask something about the attacking
trigger because I noticed that if you right click on an enemy unit you get the correct
attack acknowledgement sound that you are supposed to get but if you right click on
that same enemy unit more than once it is just silent and if you want to here the
attack acknowledgement sound again you have to click on a different enemy unit.
I don’t know if I did something wrong in the trigger or not but that is the only thing
I noticed that is wrong everything else works perfectly.

Set Variables Trigger.jpg


Select and Pissed Trigger.jpg


Move Trigger.jpg


Attack Trigger.jpg
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Not sure about the Attack sound issue, it could have to do with the Event not going off. There is a 2.00 second delay before it goes off again as you can see, so I'm not sure if that is what you're experiencing.

You can send me your map if you'd like. I use the latest patch so I won't be able to send it back to you, but I can find any problems.
 
Level 3
Joined
Jun 28, 2018
Messages
36
Not sure about the Attack sound issue, it could have to do with the Event not going off. There is a 2.00 second delay before it goes off again as you can see, so I'm not sure if that is what you're experiencing.

You can send me your map if you'd like. I use the latest patch so I won't be able to send it back to you, but I can find any problems.

Hi Uncle, awesome! I’ve got the attack sound trigger working, I fixed it by adding
two lines as shown in the screenshot I’ve posted below.

My Trigger.jpg
 
Status
Not open for further replies.
Top