Page 1 of 1

Random Multi level Sound

PostPosted: Fri May 29, 2009 6:06 pm
by wondeR
Hey guys,

Im not sure if this is the right place to be posting this, so if it is not I apologize.

A few clan mates and I have been setting up a GG server, and I was just wondering if it is possible to set up that when you multi level, that the sound that plays is a random one out of three or something.
We have set up random songs for when someone wins, but is it possible to do it for when someone multi levels?

If so, could you please let me know how I would go about doing this, and if not, thank you for your time.

Look forward to your response. Thanks.

~ |FDG| wondeR.

Re: Random Multi level Sound

PostPosted: Thu Jun 11, 2009 6:04 am
by XE_ManUp
Nope. Not at the current moment, unfortunately.

PostPosted: Wed Oct 27, 2010 3:55 pm
by Carbon16
Hmmm, I take it this applies to all the other gungame sounds as well then ManUp? I was actually just looking for a way to randomize most of the sounds and I havent been having much luck, I realise this is an oldish thread, but should I assume this hasnt changed?

PostPosted: Wed Oct 27, 2010 7:47 pm
by XE_ManUp
Yes, as of the current point in time, randomizing of sounds is limited to certain sounds. I can't remember how I went about reading for random sounds, so I can't say whether or not this would be an easy change.

Re: Random Multi level Sound

PostPosted: Thu Oct 28, 2010 2:07 am
by lqhnybear
*****EDIT YES IT WORKS*****(Silly coders not knowing their own code. LOL j/k <3 you guys.)
;) Random sounds for everything.... sound familiar? lol

I think if I remember right from trying this before. If you put #Random..... never mind that was a long time ago. lol


I suggest some one try creating a sound.txt file and putting that in one of the fields they wish to attempt to have random sounds in

So if you wanted random multilevel sounds it look like this.
multilevel = "multilevelsongs.txt"


Then just make your sounds pak and go from there. I recommend testing it with a currently working soundpak you may have. I don't have time to do this myself or I would.

I know the game might not of been coded like this, but I've done similar things in the passed and to the surprise of the coders, it worked. LOL! (hense the #Random comment above)


You know what, screw it I'll try it right now on my demo server and post the results in a couple minutes.
*****EDIT YES IT WORKS*****(I can't believe no one has tried this before.)

PostPosted: Thu Oct 28, 2010 2:23 am
by satoon101
Yeah, it seems as if core/sound/__init__.py checks if the variable endswith .txt and if it does, it checks that the file exists and chooses a random sound listed in that file. Make sure each sound is on a separate line. It looks as though the these .txt files must be located in the servers ../cfg/gungame51/sound_packs/random_sound_files/ directory.

Satoon

PostPosted: Thu Oct 28, 2010 6:34 am
by XE_ManUp
Damn...I forgot that I did it that way! I'm good! :D

PostPosted: Thu Oct 28, 2010 6:39 am
by lqhnybear
LOL no more whiskey for you ManUp!

PostPosted: Thu Oct 28, 2010 7:03 am
by Carbon16
Perfect, thanks guys :D

Re:

PostPosted: Thu Oct 28, 2010 6:49 pm
by XE_ManUp
lqhnybear wrote:LOL no more whiskey for you ManUp!

But whiskey drives my binges of innovation... :(

:D

...or is it the other way around?

PostPosted: Fri Oct 29, 2010 1:01 am
by lqhnybear
LOL

I did find out for some reason in certain fields using the text files, that the text files can't have any commented code. ie:
//----------------------------------------------------------------------------
// winner_sounds.txt -- Random winner sound file definitions.
//
// In the chosen soundpack file, "winner" MUST be set to "winner_sounds.txt"
// for this to work.
//
// All files are relative to "../cstrike/sound/".
//
// Example: gungame/winner.mp3 would be ../cstrike/sound/gungame/winner.mp3
//          on the server.
//
// Note: Any alteration of this file requires a server restart or a reload of
//       GunGame.
//----------------------------------------------------------------------------


my server kept trying to play
// on the server.
and
// GunGame.
as sound files. LOL

Re: Random Multi level Sound

PostPosted: Fri Oct 29, 2010 6:26 pm
by lqhnybear
Hate to keep coming to this thread. lol but.... I've noticed 2 minor problems with the sounds, at least if using them for TripleLevels

1. When a player TripleLevels and the song is triggered, it seems and other sound that play during the 10 second will cancel out the TripleLevel sound. I never noticed it when I was only using one sound file instead of mulitples.

2. For some reason all the sound files are download upon connect to the server and every time there is a TripleLevel it plays a different song. Personally I like it like this, but I know it wasn't intended to work this way. I myself would like to keep it like that on my server, but I believe other servers may want an option to do one random song per map.

Re: Random Multi level Sound

PostPosted: Fri Nov 05, 2010 7:59 pm
by lqhnybear
Noticed something else as well. Again this is only tested on the Triple level sounds when using random sounds. It appears that at certain distances the audio doesn't trigger on all clients. So in other words if you're too far from the person who tripled then you don't hear the sound file. At least that's how it appears to be happening.

All I know for sure is that the sound files don't play 100% of the time and there are no errors given in console.


hmmm maybe I should move these posts into the 5.1 section as that's what I'm using. lol

Re: Random Multi level Sound

PostPosted: Mon Nov 08, 2010 3:28 am
by lqhnybear