Hey all
When using a SpecialEvent to trigger a sound, is it possible to make the sound play only for the person who triggers it?
I messed around with various properties in SpecialEvent but the sound was still being played for every player in the map, even if they were far away from the trigger.
Thanks
Triggered sounds: how to make them play for instigator only?
-
- Experienced
- Posts: 109
- Joined: Tue May 21, 2013 3:57 pm
- Personal rank: Oaf
Triggered sounds: how to make them play for instigator only?
Join the BunnyTrack.net Discord chat server: https://www.bunnytrack.net/discord
-
- Godlike
- Posts: 3767
- Joined: Fri Jan 14, 2011 1:53 pm
- Personal rank: -Retired-
Re: Triggered sounds: how to make them play for instigator o
Subclass it and script your own. Would take about 10 seconds of work. AFAIK there's not a way to restrict a triggered sound to the instigator with the default settings. I'm sure there's a way to cheat it (like the bunny trick for triggers) but it's just going to be simpler to subclass and restrict.
So long, and thanks for all the fish
-
- Godlike
- Posts: 2536
- Joined: Fri Sep 25, 2015 9:01 pm
- Location: moved without proper hashing
Re: Triggered sounds: how to make them play for instigator o
No. But as Jack suggested, you can easily expand (subclass) this Actor and use ClientPlaySound() to play the sound only for the instigator. Create a new state PlayerPlaySoundEffect for example:Dizzy wrote:When using a SpecialEvent to trigger a sound, is it possible to make the sound play only for the person who triggers it?
Code: Select all
//=============================================================================
// SpecialEventEx.
//=============================================================================
class SpecialEventEx expands SpecialEvent;
state() PlayerPlaySoundEffect {
function Trigger( actor Other, pawn EventInstigator ) {
local pawn P;
Global.Trigger( Self, EventInstigator);
if (PlayerPawn(EventInstigator) != None)
PlayerPawn(EventInstigator).ClientPlaySound(Sound);
}
}
I have used such in my SBBeepTrigger: here the sound can be played for the instigator only optionally.
You do not have the required permissions to view the files attached to this post.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
-
- Experienced
- Posts: 109
- Joined: Tue May 21, 2013 3:57 pm
- Personal rank: Oaf
Re: Triggered sounds: how to make them play for instigator o
Join the BunnyTrack.net Discord chat server: https://www.bunnytrack.net/discord
-
- Godlike
- Posts: 2536
- Joined: Fri Sep 25, 2015 9:01 pm
- Location: moved without proper hashing
Re: Triggered sounds: how to make them play for instigator o
Code: Select all
if (
PlayerPawn(EventInstigator) != none &&
PlayerPawn(EventInstigator).bIsPlayer &&
PlayerPawn(EventInstigator).IsA('PlayerPawn')
)

Make it really safe! Are you sure? - Yes. - Really? - Yes! - I mean, really really? - Yeehes.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
-
- Godlike
- Posts: 3767
- Joined: Fri Jan 14, 2011 1:53 pm
- Personal rank: -Retired-
Re: Triggered sounds: how to make them play for instigator o
You obviously aren't married. This is SO a normal conversation.Barbie wrote: Make it really safe! Are you sure? - Yes. - Really? - Yes! - I mean, really really? - Yeehes.
So long, and thanks for all the fish
-
- Godlike
- Posts: 6133
- Joined: Sun May 09, 2010 6:15 pm
- Location: On the roof.
Re: Triggered sounds: how to make them play for instigator o
Isn't more simple to look for "TournamentPlayer" instead ?
I suppose "GoTo" used even in that "decompiled" MapVote is CPU intensive, not these USELESS checks iterating through objects, right ?
ISA is slow somehow doing the same effect as "PlayerPawn(EventInstigator) != None" one of these is pointless...
PS:
You forgot other check(s) if you want more USELESS safety...
Now that it's definitely a PlayerPawn and nothing else -> inspired from codes shared through these almost 20 years of UT...
I suppose "GoTo" used even in that "decompiled" MapVote is CPU intensive, not these USELESS checks iterating through objects, right ?
ISA is slow somehow doing the same effect as "PlayerPawn(EventInstigator) != None" one of these is pointless...
PS:

UselessCodingSession
Code: Select all
if (PlayerPawn(EventInstigator).bIsPawn &&
!PlayerPawn(EventInstigator).bDeleteMe &&
PlayerPawn(EventInstigator).Health > 0 &&
!PlayerPawn(EventInstigator).bHidden &&
PlayerPawn(EventInstigator).Mesh != None &&
PlayerPawn(EventInstigator).DrawType == DT_Mesh &&
!PlayerPawn(EventInstigator).ISA('ScriptedPawn')&&
!PlayerPawn(EventInstigator).ISA('FlockPawn')&&
!PlayerPawn(EventInstigator).ISA('TeamCannon')&&
!PlayerPawn(EventInstigator).ISA('Carcass')&&
!PlayerPawn(EventInstigator).ISA('Mover')&&
!PlayerPawn(EventInstigator).ISA('NavigationPoint')&&
!PlayerPawn(EventInstigator).ISA('KeyPoint')&&
!PlayerPawn(EventInstigator).ISA('Triggers')
/*&&
etc. all bullshit useless checking
*/)