You are going to have to edit the explosion effect itself which is client
side. Ill give you the location but actually getting your own sound to play
is going to require some skill on your part, that being, you will need to
create a new variable in that explosion FX so you can if statement your
sound. The effect dispatch on the server sends the required data to the
client to create the effect.

The sound is played in the client cpp fx_explosion, here is the function.

void C_BaseExplosionEffect::PlaySound( void )
{
    if ( m_fFlags & TE_EXPLFLAG_NOSOUND )
        return;

    CLocalPlayerFilter filter;
    C_BaseEntity::EmitSound( filter, SOUND_FROM_WORLD,
"BaseExplosionEffect.Sound", &m_vecOrigin );
}

Have fun :p

On Thu, Jul 31, 2008 at 2:50 PM, Jonathan Murphy <[EMAIL PROTECTED]>wrote:

> I'm pretty sure that "if" is not supported by weapon "scripts" as they
> aren't really scripts but rather data definition formats.
>
> Could you give us the code you have so far, the SuperFrag/HolyGrenade .cpp
> and .h?
>
> On Fri, Aug 1, 2008 at 12:31 AM, Yorg Kuijs <[EMAIL PROTECTED]> wrote:
>
> > Well I've been it at for a few more hours and still no luck, I was
> > thinking however how it may eventually prove to be faster and easier to
> > do it in the script file(game_sounds_weapons.txt) and somehow decide
> > sounds by checking what weapon_name.txt script is loaded.
> > Ehm here an example of what I want(I know that the way I put it probably
> > doesn't work, just an example of what I *want *to achieve:
> >
> > "BaseExplosionEffect.Sound"
> > {
> >    "channel"    "CHAN_STATIC"
> >    "volume"    "1.0"
> >    "soundlevel"    "SNDLVL_140dB"
> >    "pitch"    "PITCH_NORM"
> >
> >    if weapon_frag.txt
> >    {
> >        "rndwave"
> >        {
> >            "wave"    "^weapons/explode3.wav"
> >            "wave"    "^weapons/explode4.wav"
> >            "wave"    "^weapons/explode5.wav"
> >        }
> >    }
> >    else if weapon_superfrag.txt
> >    {
> >        "wave  "^weapons/holyexplode.wav
> >    }
> > }
> >
> > like I said that's probably not gonna work but maybe anyone with some
> > experienced with scripts can tell me if what I'm trying is possible at
> > all using scripts like this and if so can explain how to do it or maybe
> > link to a tutorial..
> > in the meantime I'll be looking for tutorials myself.
> >
> > _______________________________________________
> > To unsubscribe, edit your list preferences, or view the list archives,
> > please visit:
> > http://list.valvesoftware.com/mailman/listinfo/hlcoders
> >
> >
>
>
> --
> Programmer for Resistance and Liberation
> www.resistanceandliberation.com
> Programmer for Red Tribe
> www.redtribe.com
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives,
> please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>


-- 
~Ryan
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to