Adding in hitsounds?


(Seph64) #1

I thought a while back I read something about someone posting a tutorial for implementing hitsounds into ET, but either it never existed or I just can’t find it.

Anyone know if it exists? Aw, hell, is adding hitsounds easy that even a donkey could do it (if motivated to write code)?


(Serge) #2

You can add an event to tell the client to play a sound. You can also precache the hitsounds depending on what you allow the client to do (select custom hitsounds for
exemple).

An exemple of achieving this is to

  • Add an event in bg_public.h
  • Modify the function G_Damage() in g_combat.c in order to send an event to the attacker
    when he hit someone. If using the same event for all hitsounds you then use event_parm
    to specify what type of hitsound to play.
  • in the media member of the cgs_t struct add some sound handles for your hitsound.
    Register them in CG_RegisterSounds() in cg_main.c
  • Modify the function CG_EntityEvent() in cg_event.c so that your hitsound event can be
    handled by the client.

Be aware that:
-If not running a pure server, the clients can connect with an improper client dll which
may result as them beeing disconnected with an unknow event xx error message or
the events not beeing correctly handled or crashs depending on what you have done
with events ( add/del/changed order ).
-If not having done shrub mod or etpro mod you will receive messages from MadJack
trying to tell the world that your mod works in a strange way.


(MADDOG) #3

This is what my mod ET Live fire will have! also alot of other stuff that is well enhanced for ET!


(faltytower) #4

Hmmm, would a similar method work if one were to add (instead of hitsound) RtCW-style ricochet sound?


(MADDOG) #5

Yes our mod will probably have ricochet sounds in it aswell!


(Seph64) #6

Well yes actually it is easy…

All you have to do is copy some code from the Quake 3 Mod Source to the ET Mod source and voila hitsounds are in.

Now it’s just a matter of finding a good pair of hitsounds to put into my mod (for testing purposes, I extracted the hitsounds wav files from the ETPro pak file, won’t use them unless the ETPro team gives me the permission to use those sounds in my mod).


(Floris) #7

Hello,

I am working on a mod for an unpatched tournament, could someone help me out with making Hitsounds and Headshot sounds client side cvar controlable and server side Force on / off / Dont force ?

Thanks for any reply’s


(Jaquboss) #8

long story … buuuh , make server side cvar ( see cg_bluelimbotime for example how to get it to server side) and then use if ( cg_blblblblblbah.integer == 1 ) {} not so hard…


(Floris) #9

Uhhm, that works thanks.
Could someone help me with headshots now? (I know Im being pushy :P)

Could I just fill in the code only then for headshots, and what should I enter with PERS_ then?


(Jaquboss) #10

This is pretty easy I managed to do it alone and also with headshot support , and i am noob :smiley:


(Floris) #11

I’m pro in being noob, I want this to be client side only so it can be used on unpure shrub servers, could you help me?


(Jaquboss) #12

uhm , just do what seph64 posted…


(Floris) #13

But thats only Hitsounds, no headshotsounds :frowning:


(Jaquboss) #14

oh yes , headshots require small server side change :wink:


(Floris) #15

Meeh too bad :frowning:
But I remember this guy from unpatched clan AR having a mod, Whaleclient… It has goat sounds, hitsounds, headshot sounds and everything… And its client side :
http://forums.rainhosting.com/forum_posts.asp?TID=896&PN=1


(Jaquboss) #16

so you can just reasearch ! , it will be easy just you need to find it !