[Obsolete] [ALL] Read Game Sounds (v1.1, 2013-11-19)
12 Attachment(s)
As of SourceMod 1.6.1, this extension is obsolete. Use SDKTools instead.
2013-11-19: Fixed a memory leak, added AMBuild packaging system. CS:GO, Blade Symphony, Insurgency, and DOTA2 versions have been rebuilt against the new SDKs, although note that the latter 3 may need separate recompiling as they were built against SourceMod 1.5 despite being games that require SourceMod 1.6. 2013-10-10 (u3): Added new stock: EmitAmbientGameSound to readgamesounds.inc 2013-10-09: Make sure to grab the updated readgamesounds.inc from this post.[/SIZE] It fixes a bug in the EmitGameSoundToAll stock. You will need to recompile it against the new version. Read Game Sounds is an extension that provides 1 native and 3 stocks that plugins can use. The native is Code:
native bool:GetGameSoundParams(const String:gameSound[], &channel, &soundLevel, &Float:volume, &pitch, String:sample[], maxlength, entity=SOUND_FROM_PLAYER); For TF2, you could call this with something like "Announcer.SD_Rocket_PreLaunch" as the game sound to retrieve one of the Announcer's Special Delivery map start lines... randomly, because it has a rndwave section. This native does not precache the sound it returns. The 3 stocks are: Code:
stock bool:EmitGameSound(const clients[], Note that these function DO precache the sample and are recommended instead of calling GetGameSoundParams directly. I've compiled this extension for every game under the sun and tested it a bit in TF2. The compile size is about the same for every game except CS:GO on Linux... not sure why, but it's nearly 10 times the size of the others. For those of you who are developers, this extension just wraps the Source SDK's ISoundEmitterSystemBase's GetSoundIndex and GetSoundParametersEx functions. |
Re: [ALL] Read Game Sounds
2 Attachment(s)
uuh.. nice
also in-game https://forums.alliedmods.net/attach...1&d=1380962402 *edit soundscape not relative |
Re: [ALL] Read Game Sounds
Quote:
|
Re: [ALL] Read Game Sounds
yea, I was thinking where to look those game sounds entries ^^ without looking game_sounds.txt
|
Re: [ALL] Read Game Sounds
Once this is tested a bit more, I may try submitting it on the SourceMod BugTracker for inclusion as part of sdktools (sdktools_sound for the stocks). We'll see.
|
Re: [ALL] Read Game Sounds
I've considered adding a EmitAmbientGameSound stock, but I don't think any games store ambient sounds in their game_sounds, although I could be wrong.
|
Re: [ALL] Read Game Sounds
PHP Code:
You may also want to TrimString, StripQuotes, then TrimString again. PHP Code:
|
Re: [ALL] Read Game Sounds
4 Attachment(s)
Quote:
Quote:
I should have just copied EmitSoundToAll and changed it instead of retyping it. Luckily, being a stock, it doesn't required an extension recompile, only a recompile of the plugin that uses it. |
Re: [ALL] Read Game Sounds (v1.0 u1, 2013-10-09)
1 Attachment(s)
Actually, I have another stocks update. All the stocks should now return a boolean... their signatures were booleans before, but they didn't actually return anything.
Additionally, the EmitSound stock now returns false if the extension isn't loaded. Which means the other two do as well, since they return the value of EmitGameSound. |
Re: [ALL] Read Game Sounds (v1.0 u2, 2013-10-09)
1 Attachment(s)
Turns out an EmitAmbientGameSound stock would be useful after all, so I added it.
|
All times are GMT -4. The time now is 22:53. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.