emmiting complex sounds( spk or emit_sound? )
Hi everyone!
Here is the situation: If you play half life: opposing force or sven co-op, you'll come across "shock trooper"s. They say something like this: "may ha hmm may he he". If you check the sound files, and the senteces.txt, you'll find this: Code:
// SHOCK TROOPERHere comes the HL console: Code:
spk "shocktrooper/mub puh mub dit dit"If we use the following code, we can emit the sound to all players: PHP Code:
Code:
spk "shocktrooper/(v30) mub puh mub dit dit"I've tried the following code to make a function, though it's not working: PHP Code:
|
Re: emmiting complex sounds( spk or emit_sound? )
First of all, you should explain what is not working about it (which requires some debugging).
Second, your method of counting players and using that for the for loop is not good. This is how I would do it and see if it works: -Code Removed- |
Re: emmiting complex sounds( spk or emit_sound? )
PHP Code:
The code is only for a test. It would say hello to every connecting player. But it doesn't. If I can add a balance paramether, then I can calculate a sound source's direction and volume according to the distance. |
Re: emmiting complex sounds( spk or emit_sound? )
Another example of vox used for creatures is Sven Coop's robot grunt sounds. When the robogrunt sees a grenade it says:
spk "vox/(p120) dadeda emergency evacuate" it would look like this called from the function: spk("vox/dadeda emergency evacuate",120,100); Oh, by the way it's dadeda and not dadada as I thought... :( I corrected the plugin and inserted fysiks' code: PHP Code:
By the way, what are the parameters of spk/speak? The ones I've found are the following(tested all the letters) Code:
p - pitch(%) - default value is 100 - raises/lowers pitch |
Re: emmiting complex sounds( spk or emit_sound? )
And what about fakemeta's
PHP Code:
|
Re: emmiting complex sounds( spk or emit_sound? )
Ok, the code is corrected, but a new error appeared, which I don't know where it came from:
Code:
L 07/20/2010 - 04:15:34: replace() buffer not big enough (36>=30)The code is: PHP Code:
|
Re: emmiting complex sounds( spk or emit_sound? )
For that error use replace_all() instead of replace().
|
Re: emmiting complex sounds( spk or emit_sound? )
Replaced it, but still not working...
Code:
L 07/20/2010 - 05:00:36: replace() buffer not big enough (37>=27)PHP Code:
|
Re: emmiting complex sounds( spk or emit_sound? )
Ok, I figured out the problem. You can't reuse the variable "sentence" because you are trying to make it longer but is only as long as the original string that was submitted to it.
Try this: PHP Code:
|
Re: emmiting complex sounds( spk or emit_sound? )
Super, I am most greatful to you. Only one thing remains. How to sort out the balancing problems? Idea: make new files, like: emergency_l.wav and emergency_r.wav, but as I see spk only supports 1 channel at a time...( need to test this )
So how can a creature have a complex sound like this? |
| All times are GMT -4. The time now is 07:11. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.