- Joined
- Aug 16, 2018
- Messages
- 39
Hi evryone. I'm working on a project. and there is a specific area I want to play a sound for but only for one team and not for evryone els. I seen some threads but I didd'nt usderstand them. could you help.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Play sound at location

Events

Conditions

Actions


Set tempPoint = (Position of myLocation)


Player Group - Pick every player in myPlayers and do (Actions)



Loop - Actions




Sound - Play mySound at 100.00% volume, located at tempPoint with Z offset 0.00


Custom script: call RemoveLocation(udg_tempPoint)
I tryed that but it was not what I wanted.You could use a trigger like this :
Play sound at location
Events
Conditions
Actions
Set tempPoint = (Position of myLocation)
Player Group - Pick every player in myPlayers and do (Actions)
Loop - Actions
Sound - Play mySound at 100.00% volume, located at tempPoint with Z offset 0.00
Custom script: call RemoveLocation(udg_tempPoint)
Custom script: if GetLocalPlayer() == Player (0) then
I want the sound to start playing when someone enters a location not at the location. sorryWhat do you exactly want to achieve ?
My previous code means to play a sound for a group of players at a specific location, what do you want more ?
What want the sound to start playing when someone enters a location not at the location. sorry
Set tempPoint = (Position of (Triggering Unit))
I added a ''then'' and It works perfectly thanksWhat do you exactly want to achieve ?
My previous code means to play a sound for a group of players at a specific location, what do you want more ?
Edit : For the other code I think there is a "then" missing, correct line would be
Custom script: if GetLocalPlayer() == Player (0) then
I added a ''then'' and It works perfectly thanks
I know what to do from hereThis will only works for Player 1 not for a group of players as you wanted in your first post.


Play sound for a team

Events


Unit - A unit enters Region 000 <gen>

Conditions

Actions


Custom script: set bj_wantDestroyGroup = true


Set tempLocation = (Position of (Triggering unit))


Player Group - Pick every player in (All players matching (((Owner of (Triggering unit)) Equals to (Matching player)) or (((Triggering unit) belongs to an ally of (Matching player)) Equals to TRUE))) and do (Actions)



Loop - Actions




Custom script: if (GetLocalPlayer() == GetEnumPlayer()) then




Sound - Play CUSTOM_SOUND at 100.00% volume, located at tempLocation with Z offset 0.00




Custom script: endif


Custom script: call RemoveLocation(udg_tempLocation)
Yes it's clear. I was about to post another reply on how to do it for all players at the same time, but this way is better and more orginized.This is not really how it should be done in my opinion.It is painful to develop, if you want to add one condition or action in the future you will have to manually copy everything for every trigger.
Besides, you are playing a sound for everyone here and you wanted to play a sound only for a team.
You should pick a sound in the Sound Editor -> Right Clic -> "Use as sound" and check "3D sound" is enabled.
A trigger that plays a sound for a every player in a team when a unit from this team enters the region may be :
When you are using the "Sound - Play" function alone, it will play the sound for everyone.
Play sound for a team
Events
Unit - A unit enters Region 000 <gen>
Conditions
Actions
Custom script: set bj_wantDestroyGroup = true
Set tempLocation = (Position of (Triggering unit))
Player Group - Pick every player in (All players matching (((Owner of (Triggering unit)) Equals to (Matching player)) or (((Triggering unit) belongs to an ally of (Matching player)) Equals to TRUE))) and do (Actions)
Loop - Actions
Sound - Play CUSTOM_SOUND at 100.00% volume, located at tempLocation with Z offset 0.00
Custom script: call RemoveLocation(udg_tempLocation)
Tell me if this clear for you![]()
This is not really how it should be done in my opinion.It is painful to develop, if you want to add one condition or action in the future you will have to manually copy everything for every trigger.
Besides, you are playing a sound for everyone here and you wanted to play a sound only for a team.
You should pick a sound in the Sound Editor -> Right Clic -> "Use as sound" and check "3D sound" is enabled.
A trigger that plays a sound for a every player in a team when a unit from this team enters the region may be :
When you are using the "Sound - Play" function alone, it will play the sound for everyone.
Play sound for a team
Events
Unit - A unit enters Region 000 <gen>
Conditions
Actions
Custom script: set bj_wantDestroyGroup = true
Set tempLocation = (Position of (Triggering unit))
Player Group - Pick every player in (All players matching (((Owner of (Triggering unit)) Equals to (Matching player)) or (((Triggering unit) belongs to an ally of (Matching player)) Equals to TRUE))) and do (Actions)
Loop - Actions
Sound - Play CUSTOM_SOUND at 100.00% volume, located at tempLocation with Z offset 0.00
Custom script: call RemoveLocation(udg_tempLocation)
Tell me if this clear for you![]()
Play sound for a team

Events


Unit - A unit enters Region 000 <gen>

Conditions


((Triggering unit) is A Hero) Equals to TRUE

Actions


Custom script: set bj_wantDestroyGroup = true


-------- Play a simple sound for the owner of the unit and his team --------


Player Group - Pick every player in (All players matching (((Owner of (Triggering unit)) Equals to (Matching player)) or (((Triggering unit) belongs to an ally of (Matching player)) Equals to TRUE))) and do (Actions)



Loop - Actions




Custom script: if (GetLocalPlayer() == GetEnumPlayer()) then




Sound - Play YOUR_SOUND <gen>




Custom script: endif
I think you forgot GetLocalPlayer usage here, since Player Group stuff is pointless and you just play same sound at same position N times, and to all players.