- Joined
- Mar 24, 2020
- Messages
- 80
Hi guys, just a quick one! I am just trying to figure out the best way to manage player specific sounds.
Q.1 - Is there a way to GetLocalPlayer to detect the picked player? So I could put it in a player group loop?
Q.2 - How do I optimize the below?
During the first 30 seconds a voiceover is being played to all players. This voiceover is broken down into 4 sounds/parts. If a player within the first 30 seconds begins building too close to a point, the voiceover stops playing for that specific player and then plays a sound/voiceover to that specific triggering player. What I need to happen is if this sound/warning is being played to the specific player, that specific player won't hear the next part of the main voiceover, IF the warning sound is still being played to them.
I hope that makes sense! So far I have this:
Q.1 - Is there a way to GetLocalPlayer to detect the picked player? So I could put it in a player group loop?
Q.2 - How do I optimize the below?
During the first 30 seconds a voiceover is being played to all players. This voiceover is broken down into 4 sounds/parts. If a player within the first 30 seconds begins building too close to a point, the voiceover stops playing for that specific player and then plays a sound/voiceover to that specific triggering player. What I need to happen is if this sound/warning is being played to the specific player, that specific player won't hear the next part of the main voiceover, IF the warning sound is still being played to them.
I hope that makes sense! So far I have this:
-
Build near gates
-
Events
- Unit - A unit Begins construction
-
Conditions
-
Or - Any (Conditions) are true
-
Conditions
- (Distance between (Position of (Triggering unit)) and (Position of DomainGate[1])) Less than or equal to 3500.00
- (Distance between (Position of (Triggering unit)) and (Position of DomainGate[2])) Less than or equal to 3500.00
-
Conditions
-
Or - Any (Conditions) are true
-
Actions
- Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to (Matching player)).) for 20.00 seconds the text: |cffff0000You are b...
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Owner of (Triggering unit)) Equal to Player 1 (Red)
-
Then - Actions
- Custom script: if GetLocalPlayer() == Player(0) then
- Sound - Stop CurrentSound Immediately
- Sound - Play You_Are_Building_Next_To_One_Of_My_Gates <gen>
- Set VariableSet SoundGateBuildWarningBoolean[(Player number of (Owner of (Triggering unit)))] = True
- Wait 9.00 game-time seconds
- Set VariableSet SoundGateBuildWarningBoolean[(Player number of (Owner of (Triggering unit)))] = False
- Custom script: endif
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Owner of (Triggering unit)) Equal to Player 2 (Blue)
-
Then - Actions
- Custom script: if GetLocalPlayer() == Player(1) then
- Sound - Stop CurrentSound Immediately
- Sound - Play You_Are_Building_Next_To_One_Of_My_Gates <gen>
- Set VariableSet SoundGateBuildWarningBoolean[(Player number of (Owner of (Triggering unit)))] = True
- Wait 9.00 game-time seconds
- Set VariableSet SoundGateBuildWarningBoolean[(Player number of (Owner of (Triggering unit)))] = False
- Custom script: endif
- Else - Actions
-
If - Conditions
-
Events
-
Example
- Events
- Conditions
-
Actions
- Sound - Play Part_3 <gen>
- Set VariableSet CurrentSound = (Last played sound)
-
Player Group - Pick every player in Players and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- SoundGateBuildWarningBoolean[(Player number of (Picked player))] Equal to False
- Then - Actions
-
Else - Actions
- Custom script: if GetLocalPlayer() == Player(PickedPlayer) then
- Sound - Stop CurrentSound Immediately
- Custom script: endif
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
Last edited: