Monthly Target: $400 Donations: $344
 86% 

Blocking a one of client side sounds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Location: Where am i ?
Old 04-15-2012 , 13:52   Blocking a one of client side sounds
Reply With Quote #1

hello !

Today i try to replace material pain sound,

Example, i shoot the block, the block have Wood texture that will make a strange old sound
" valve/sound/debris/wood[random 1-4].wav "


that is the sound what i want to block.

If i get the bullet entity id and the touch time when bullet touch the wall then i just emit the sound with some new sound with correct channel and it will replace the sound.

So the question is how to do it?
Thanks!

Last edited by .Dare Devil.; 04-15-2012 at 13:52.
.Dare Devil. is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-15-2012 , 17:07   Re: Blocking a one of client side sounds
Reply With Quote #2

If it truly is client-side then you can't do anything about the sound playing. You maybe able to block the touch though which would effectively stop the sound.
__________________
fysiks is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-15-2012 , 17:33   Re: Blocking a one of client side sounds
Reply With Quote #3

It's played server-side, hook FM_EmitSound. You should learn to look yourself in the HLSDK and you would have your answer..
__________________
Working on : CS Weapon Mod (72%) , MonsterAI (PAUSED),

Arkshine is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 04-16-2012 , 04:19   Re: Blocking a one of client side sounds
Reply With Quote #4

I wouldn't be so sure about this...
From cl_dlls/ev_hldm.cpp

Code:
// play a strike sound based on the texture that was hit by the attack traceline.  VecSrc/VecEnd are the
// original traceline endpoints used by the attacker, iBulletType is the type of bullet that hit the texture.
// returns volume of strike instrument (crowbar) to play
float EV_HLDM_PlayTextureSound( int idx, pmtrace_t *ptr, float *vecSrc, float *vecEnd, int iBulletType )
{
......
        case CHAR_TEX_WOOD: fvol = 0.9; fvolbar = 0.2;
        rgsz[0] = "debris/wood1.wav";
        rgsz[1] = "debris/wood2.wav";
        rgsz[2] = "debris/wood3.wav";
        cnt = 3;
        break;
......
}
__________________


Last edited by NiHiLaNTh; 04-16-2012 at 04:19.
NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-16-2012 , 04:28   Re: Blocking a one of client side sounds
Reply With Quote #5

It would depending if you shoot at one entity or not.

func_breakable entity are handled server-side, something you can see at func_break.cpp.
And yes, if you shoot at the world, it's done client-side. I thought you were talking about the entity.
__________________
Working on : CS Weapon Mod (72%) , MonsterAI (PAUSED),

Arkshine is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Location: Where am i ?
Old 04-16-2012 , 11:51   Re: Blocking a one of client side sounds
Reply With Quote #6

Quote:
Originally Posted by Arkshine View Post
It would depending if you shoot at one entity or not.

func_breakable entity are handled server-side, something you can see at func_break.cpp.
And yes, if you shoot at the world, it's done client-side. I thought you were talking about the entity.
Right, nope non entity ofcourse or " world solid block what ever. " : )

Anyway i have idea for making my own new bullet entity on server side.
Then i need to make new weapon entity like Minigun, but that is pretty easy thing.


Is it good to create entity, give him velocity and mayby a model " or sprite "?
it will hurt if 32 players will shoot, it will take much much cpu right?

So, mayby we create a x entitys when server start and when player shooting then give entity player view origin and push the enitity or i dont know..

Any ideas about that ?
.Dare Devil. is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-16-2012 , 12:42   Re: Blocking a one of client side sounds
Reply With Quote #7

If you block a weapon properly as you should when creating a new weapon, such problem won't exist.
Also, there is no bullet in CS, I'm not sure why you want to create them when it's totally useless for such weapon.
To play your new texture sound, you need simply to know the hit origin and finding the texture. As simple as that.
__________________
Working on : CS Weapon Mod (72%) , MonsterAI (PAUSED),

Arkshine is offline
Reply


Thread Tools
Display Modes

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 22:03.


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