Sound coding questions - PART 2


(P4nth3r) #1

I bumbed into another problem =/

g_main.c

	G_SoundIndex( "sound/player/gurp1.wav"	);
	G_SoundIndex( "sound/player/gurp2.wav"	);

This uses another type of code, I don’t really understand.
I tried this

	G_SoundIndex( "sound/player/gurp1.wav"	);
	G_SoundIndex( "sound/player/gurp2.wav"	);
	G_SoundIndex( "sound/player/gurp3.wav"	);
	G_SoundIndex( "sound/player/gurp4.wav"	);
	G_SoundIndex( "sound/player/gurp5.wav"	);

To add some more sounds to it, but ofcourse it didn’t work.
I can’t figure out where it’s determined how many it uses.

help me.

Thnx & Greetz Panther


(P4nth3r) #2

This most be a tricky one! nobody???


(kamikazee) #3

I’ll need the code for that, but can you actually give a list of the errors you get?
Or is there simply no reaction when you play it in game?
It could be that you can add them to the list, but that it won’t play them.


(*Shadow* Commando) #4

In g_active.c
Have a look at this:

// play a gurp sound instead of a normal pain sound
					if (ent->health <= ent->damage) {
						G_Sound(ent, G_SoundIndex("*drown.wav"));
					} else if (rand()&1) {
						G_Sound(ent, G_SoundIndex("sound/player/gurp1.wav"));
					} else {
						G_Sound(ent, G_SoundIndex("sound/player/gurp2.wav"));
					}

(P4nth3r) #5

So if I do this it should work?

// play a gurp sound instead of a normal pain sound 
               if (ent->health <= ent->damage) { 
                  G_Sound(ent, G_SoundIndex("*drown.wav")); 
               } else if (rand()&1) { 
                  G_Sound(ent, G_SoundIndex("sound/player/gurp1.wav")); 
               } else { 
                  G_Sound(ent, G_SoundIndex("sound/player/gurp2.wav")); 
               } else { 
                  G_Sound(ent, G_SoundIndex("sound/player/gurp3.wav")); 
               } else { 
                  G_Sound(ent, G_SoundIndex("sound/player/gurp4.wav")); 
               } else { 
                  G_Sound(ent, G_SoundIndex("sound/player/gurp5.wav")); 
               }

By the way is the drown sound active if I give it a location of a sound file??

Thnx & Greetz Panther


(*Shadow* Commando) #6

That won’t work. Because now it will always play gurp5.wav if it doesn’t play gurp 1.
I tried something myself. This works:

// play a gurp sound instead of a normal pain sound
					if (ent->health <= ent->damage) {
						G_Sound(ent, G_SoundIndex("*drown.wav"));
					} else if (rand()&1) {
						G_Sound(ent, G_SoundIndex("sound/player/gurp1.wav"));
					} else if (rand()&2) {
						G_Sound(ent, G_SoundIndex("sound/player/gurp2.wav"));
					} else if (rand()&3) {
						G_Sound(ent, G_SoundIndex("sound/player/gurp3.wav"));
					} else if (rand()&4) {
						G_Sound(ent, G_SoundIndex("sound/player/gurp4.wav"));
					} else {
						G_Sound(ent, G_SoundIndex("sound/player/gurp5.wav"));
					}

(P4nth3r) #7

Thnx, I’ll try that as soon as I get home ^^

Thnx & Greetz Panther


(P4nth3r) #8

Is it possible to never let him play the same sound twice after eachother?
Cause I find the drowning sounds kinda fake cause you hear the 2 sounds over and over again, I now have 7 different drowning sounds, but still he plays some to many times =(
Maybe it’s an option to let him play al sounds 1 by one in the order the come in??

Thnx & Greetz Panther aka Way2evil


(P4nth3r) #9

I also reactivated the drown sound, but now if you drown he plays the drown sound and “medic” sound at the same time.
Can’t I turn of the medic sound when he drowns??

Thnx & Greetz Panther


(Jaquboss) #10

just find where the event is sent…
it should be EV_MEDIC_CALL or something like that


(P4nth3r) #11

C’mon Jaquboss you should know by now I’m not a coder =(
I can’t figure it out, I keep getting errors and fails to build what ever I try :blush:

Help me plz

Thnx & Greetz Panther


(P4nth3r) #12

I tried stopping the EV_MEDIC_CALL the same way the pain sounds are stopped, it compiled succesfull, but then when I started to drown strange stuff started to happen, my HP went reall high and after some time my 1st person weapon disapeared and I couldn’t drown anymore =P

Help me

Thnx & Greetz Panther