Scale BattleVO with distance??

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Scale BattleVO with distance??

Post by Anakin »

I put this in my rep_default_commando.odf. But you can hear it very loud when your team mates are under fire (the fleesound). And when playing the CIS you hear it, too. I got the tipp to scale the sound down by distance. Not sure if it is possible, but maybe someone of you know or knows an alternative solution.

Code: Select all

LowHealthSound			= "snd_rc_vo_low_health"
PreparingForDamageSound	= "snd_rc_vo_grenade"
FleeSound				= "snd_rc_ruckzug"
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Scale BattleVO with distance??

Post by Marth8880 »

Sure, and you can even do it easily with a handy Lua function called ScaleSoundParameter().
[color=#FFFFFF]soundhooks.txt[/color] wrote:

Code: Select all

ScaleSoundParameter(groupID, parameter, scale);

groupID   : Identifies the group which contains sounds that are changed
parameter : Parameter to scale on each sound within the group.  Can be one of 
            the following...
            Gain
            GainDev
            Pitch
            PitchDev
            PlayProbability
            PlayInterval
            PlayIntervalDev
            ReverbGain
            Pan
            MinDistance
            MuteDistance
            MaxDistance
            RollOff
            RollIn
            RollInDistance
 
scale     : Scale factor for the parameter

e.g
ScaleSoundParameter("weapons", "MaxDistance",  1.5);
ScaleSoundParameter("weapons", "MuteDistance", 1.5);
groupID is referring to the Group() name set in the sound property. For example, in Shepard's KillingSpree sound stream property:

Code: Select all

SoundStreamProperties()
{
    Name("ssv_chatter_Shepard_KillingSpree");
    Group("ssv_vo_shep");
    Inherit("me5_shepard_hero_battle_chatter_template");
	Gain(1.0);
    Stream("vo_quick_streaming");
    SegmentList()
    {
        Segment("ssv_shepard_killingspree01", 0.19); //  Don't stop!
        Segment("ssv_shepard_killingspree02", 0.19); //  Keep moving!
        Segment("ssv_shepard_killingspree03", 0.19); //  Go! Let's push ahead!
        Segment("ssv_shepard_killingspree04", 0.19); //  Keep moving!
        Segment("ssv_shepard_killingspree05", 0.19); //  Diet Dr. Pepper!
        Segment("ssv_shepard_killingspree_rare01", 0.0125); //  I've taken some risks in my time but this seems crazy.
        Segment("ssv_shepard_killingspree_rare02", 0.0125); //  We'll bang, okay?
        Segment("ssv_shepard_killingspree_rare03", 0.0125); //  Problem?
        Segment("ssv_shepard_killingspree_rare04", 0.0125); //  I'll take it!
    }
}
the Group() name is ssv_vo_shep, so I'd do something like:

Code: Select all

ScaleSoundParameter(ssv_vo_shep, MaxDistance, 0.75)
ScaleSoundParameter(ssv_vo_shep, MuteDistance, 0.75)
if I wanted to scale down the MaxDistance and MuteDistance to 75% their original values.
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Scale BattleVO with distance??

Post by Anakin »

Thank you for this detailed answer. Not sure what values should be good. You gave me good suggestions for the vibro and estaff values. Do you have an idea what could be good for my problem? (parameter and scale).
I just want someone to hear the sound who is about 4 or 5 meter from the speaker away. So after these 4 - 5 meter it should be 0. and from 2 to 4/5 it should scale down from 100 to 0.
Post Reply