clientside hitsound for MH2

Discussions about Coding and Scripting
User avatar
Barbie
Godlike
Posts: 3313
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: clientside hitsound for MH2

Post by Barbie »

Letylove49 wrote: Sun Apr 20, 2025 11:08 pm i would like to add ClientHitvolume how i can add that ?
If you want one volume setting for all clients, just add it to the ClientPlaySound() function:

Code: Select all

PlayerPawn(InstigatedBy).ClientPlaySound(HitSound, , ClientHitvolume);
If you want to us a specific sound slot, I'd recomment SLOT_Interact:

Code: Select all

PlayerPawn(InstigatedBy).ClientPlaySound(HitSound, SLOT_Interact, ClientHitvolume);
If you want that clients can control their hit volume, things will get a bit more complex.
"If Origin not in center it be not in center." --Buggie
User avatar
Letylove49
Adept
Posts: 497
Joined: Tue Feb 28, 2012 7:47 pm
Personal rank: AK admin
Location: suisse

Re: clientside hitsound for MH2

Post by Letylove49 »

i want the player only the sound of their hit no the sound from others player. what is the best way ?
Image
Image
Letylove49 aka Alicia
User avatar
Barbie
Godlike
Posts: 3313
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: clientside hitsound for MH2

Post by Barbie »

Letylove49 wrote: Mon Apr 21, 2025 10:26 pm i want the player only the sound of their hit no the sound from others player. what is the best way ?
That is done by PlayerPawn's ClientPlaySound() - only that PlayerPawn will hear it.
"If Origin not in center it be not in center." --Buggie
User avatar
Letylove49
Adept
Posts: 497
Joined: Tue Feb 28, 2012 7:47 pm
Personal rank: AK admin
Location: suisse

Re: clientside hitsound for MH2

Post by Letylove49 »

Barbie wrote: Mon Apr 21, 2025 9:55 am
Letylove49 wrote: Sun Apr 20, 2025 11:08 pm i would like to add ClientHitvolume how i can add that ?
If you want one volume setting for all clients, just add it to the ClientPlaySound() function:

Code: Select all

PlayerPawn(InstigatedBy).ClientPlaySound(HitSound, , ClientHitvolume);
If you want to us a specific sound slot, I'd recomment SLOT_Interact:

Code: Select all

PlayerPawn(InstigatedBy).ClientPlaySound(HitSound, SLOT_Interact, ClientHitvolume);
If you want that clients can control their hit volume, things will get a bit more complex.
when i add this : PlayerPawn(InstigatedBy).ClientPlaySound(HitSound, SLOT_Interact , ClientHitvolume); i got this :
Error: D:\UT coding\UnrealTournament\MH2GoldCTGv2c\Classes\MH2Base.uc(665) : Error, Call to 'ClientPlaySound': Bad expression or missing ')'
Image
Image
Letylove49 aka Alicia
User avatar
Barbie
Godlike
Posts: 3313
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: clientside hitsound for MH2

Post by Barbie »

Probably "HitSound" and/or "ClientHitvolume" are not defined.
"If Origin not in center it be not in center." --Buggie