Raised This Month: $51 Target: $400
 12% 

[TF2] Noise Maker Player


Post New Thread Reply   
 
Thread Tools Display Modes
jouva
Senior Member
Join Date: Jan 2010
Old 11-11-2010 , 03:31   Re: [TF2] Noise Maker Player
Reply With Quote #21

It SHOULD be ok since I call IsSoundPrecached(). OnPluginStart() and OnMapStart() just both call a local PrecacheSounds() function that does all of the logic.
jouva is offline
naris
AlliedModders Donor
Join Date: Dec 2006
Old 11-12-2010 , 01:24   Re: [TF2] Noise Maker Player
Reply With Quote #22

Quote:
Originally Posted by jouva View Post
It SHOULD be ok since I call IsSoundPrecached(). OnPluginStart() and OnMapStart() just both call a local PrecacheSounds() function that does all of the logic.
Except that IsSoundPrecached() ALWAYS return true.
https://bugs.alliedmods.net/show_bug.cgi?id=3536
naris is offline
jouva
Senior Member
Join Date: Jan 2010
Old 11-12-2010 , 16:15   Re: [TF2] Noise Maker Player
Reply With Quote #23

hmmm. What issues would I notice if I tried to use a sound not precached then?
jouva is offline
Afronanny
Veteran Member
Join Date: Aug 2009
Old 11-14-2010 , 23:08   Re: [TF2] Noise Maker Player
Reply With Quote #24

Quote:
Originally Posted by jouva View Post
hmmm. What issues would I notice if I tried to use a sound not precached then?

IIRC OnMapStart is still called if a plugin is late-loaded.
Afronanny is offline
DarthNinja
SourceMod Plugin Approver
Join Date: Mar 2009
Location: PreThinkHook()
Old 11-15-2010 , 00:35   Re: [TF2] Noise Maker Player
Reply With Quote #25

Quote:
Originally Posted by Afronanny View Post
IIRC OnMapStart is still called if a plugin is late-loaded.
It is.

Might be nice if you could check for args so players could use sm_noisemaker 1/2/3/etc (for keybinds).
__________________

Last edited by DarthNinja; 11-15-2010 at 00:44.
DarthNinja is offline
jouva
Senior Member
Join Date: Jan 2010
Old 11-15-2010 , 03:25   Re: [TF2] Noise Maker Player
Reply With Quote #26

Yep I just read about OnMapStart() executing on late loading of the plugin. I'll go change that soon. And I'll also look into parameters for the command. I thought about this but was not too eager to put it in.

I'll also look into translation stuff. I'll see what I can do by Thanksgiving as I've got some "day job" stuff to do.
jouva is offline
DarthNinja
SourceMod Plugin Approver
Join Date: Mar 2009
Location: PreThinkHook()
Old 11-15-2010 , 04:55   Re: [TF2] Noise Maker Player
Reply With Quote #27

Quote:
Originally Posted by jouva View Post
Yep I just read about OnMapStart() executing on late loading of the plugin. I'll go change that soon. And I'll also look into parameters for the command. I thought about this but was not too eager to put it in.

I'll also look into translation stuff. I'll see what I can do by Thanksgiving as I've got some "day job" stuff to do.
Here's a version that does the OnMapStart stuff correctly and has the extra ability to use the command with an arg.

Usage:
sm_noisemaker (!noisemaker)
  • Shows a menu to pick sounds from
sm_noisemaker <0-8> (!noisemaker 0-8)
  • Plays corresponding sound.
Code:
    1.    Banshee
    2.    Cat
    3.    Gremlin
    4.    Crazy
    5.    Spooky
    6.    Stabby
    7.    Witch
    8.    Werewolf

0. Random of the above
So for example, "sm_noisemaker 3" would play the Gremlin sound. "sm_noisemaker 6" would play stabby. "sm_noisemaker 0" would play a random sound.
Attached Files
File Type: sp Get Plugin or Get Source (noisemaker_dn.sp - 505 views - 8.5 KB)
__________________
DarthNinja is offline
jouva
Senior Member
Join Date: Jan 2010
Old 11-15-2010 , 12:53   Re: [TF2] Noise Maker Player
Reply With Quote #28

Hey awesome! Thanks. I'll go incorporate this in the next release (1.2, or 2.0 if it's got translations by then)
jouva is offline
jouva
Senior Member
Join Date: Jan 2010
Old 11-17-2010 , 23:24   Re: [TF2] Noise Maker Player
Reply With Quote #29

Working on stuff right now. I would like help translating the word "Random" into various languages. Everything else I THINK I can grab from the official files from Valve.
jouva is offline
jouva
Senior Member
Join Date: Jan 2010
Old 11-18-2010 , 01:33   Re: [TF2] Noise Maker Player
Reply With Quote #30

Version 1.2.0 Released
  • Changed menu to panel. No more exit, but now no more "Next/Prev" either
  • sm_noisemaker now accepts numbers (0-8) as a parameter. 0 will play a random noise maker. 1-8 plays the respective noise maker as listed in the menu
  • sm_noisemaker now has "Random" as a choice
  • No longer precaches sounds in OnPluginLoad()
  • Multilingual support (en and es included in this release)
Thanks to DarthNinja for contributing code for sm_noisemaker to accept parameters. With this, I think it means that any subsequent releases will be minor bugs we haven't found yet or language files. So now just download the .zip and extract it to the sourcemod directory. Enjoy!
jouva is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:24.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode