Page 1 of 1

Request to allow Custom Addons to change some stuff

PostPosted: Sat Oct 04, 2008 5:47 am
by Don
I'm writing a Custom Addon and I would like to be able to play my winning sound or allow the regular sound depending on some circumstances of the game. It would be best if there were cvars that allowed me to disable any particular sound and substitute my own. I'm not sure of the best way to do this but for now consider it a request for after public release. Don't worry about adding anything like this until after we release as I don't want to sidetrack anyone.

Just something to think about for the future.

PostPosted: Sat Oct 04, 2008 12:11 pm
by RideGuy
For now you could use es.stopsound() to kill the winner sound, then play your own.

PostPosted: Sat Oct 04, 2008 5:09 pm
by XE_ManUp
Yes, I don't care for how I have done the sounds. Although it is nice to have the method we do, I am fairly sure that it needs to be re-worked, although I am not quite sure how I would go about doing so.

Re:

PostPosted: Sat Oct 04, 2008 5:12 pm
by Don
RideGuy wrote:For now you could use es.stopsound() to kill the winner sound, then play your own.

How would I go about that since the winner sound is random, or do I not understand the .ini file having it as @random? I guess I'm not sure how to know which winner sound is being played.

Re: Request to allow Custom Addons to change some stuff

PostPosted: Sat Oct 04, 2008 6:31 pm
by RideGuy
gungamelib.getSound('@random")

I think that will work. That will tell you the song that will be played at gg_win.

PostPosted: Sat Oct 04, 2008 7:08 pm
by Don
Nope.

Traceback (most recent call last):
  File "C:\srcds\cstrike\addons\eventscripts\es.py", line 207, in tick
    x()
  File "C:\srcds\cstrike\addons\eventscripts\_libs\python\gamethread.py", line 174, in tick
    _executenode(first)
  File "C:\srcds\cstrike\addons\eventscripts\_libs\python\gamethread.py", line 156, in _executenode
    function(*a, **kw)
  File "C:\srcds\cstrike\addons\eventscripts\gungame\custom_addons\gg_1v1\gg_1v1.py", line 119, in do_1v1
    win_sound = gungamelib.getSound('@random')
  File "C:\srcds\cstrike\addons\eventscripts\_libs\python\gungamelib.py", line 2163, in getSound
    raise SoundError('Cannot get sound (%s): sound file not found.' % soundName)
SoundError: Cannot get sound (@random): sound file not found.

Re: Request to allow Custom Addons to change some stuff

PostPosted: Sat Oct 04, 2008 7:48 pm
by RideGuy
woops
gungamelib.getSound('winner')

PostPosted: Mon Oct 27, 2008 3:42 pm
by Saul
In 5.1 I might add some sort of hooking system, where you can hook GG's core events (like gg_win), and make it so then it doesn't play a sound, etc.