Replacing Sounds In Game Using The Xtbl Method

There are two ways to replace in game sounds. One is the xtbl method and the other is by editing audio banks.
This is an addendum to the Adding Music ... tutorial. However since it doesn't concern changing sounds in the audio banks
I felt it should have it's own Tutorial.

Note: Very little of this work is mine. The credit here needs to go to Idolninja for sharing the info and writing it down
as well as SuperNull for sharing the original post. All I am doing is trying to put all the info on sound replacement
in one place so that it is more easily accessible.

Right now let's look at the xtbl method. The following is from a post in the Guides
and Tutorials section page 3

post courtesy of SuperNull - excerpt courtesy Idolninja and Curly Haired Boy

For this tutorial we will be referencing the foley.xtbl and the weapons.xtbl
unmodded copies of both can be sound in the common.vpp_pc folder. I will not be
changing either file here just walking you through an example of how to do so.
(Warning: Do Not change the Foley.xtbl. Doing so can cause all kinds of problems.

IdolNinja: just like effects.xtbl is our graphic effects reference, we will be using a sound reference file to find the names of sound effects we can use
IdolNinja: to look up stuff we can try
IdolNinja: once again, in the extracted\common folder, it's called foley.xtbl
IdolNinja: so open it up
IdolNinja: DO NOT CHANGE IT
IdolNinja: we're just going to look stuff up
IdolNinja: like we did with effects.xtbl
curly haired boy: kk
IdolNinja: <root>
<Table>
<Foley>
<Name>SFX_EXP_FLASHBANG</Name>
<AudioBanks>Other InMemory</AudioBanks>
<_Editor>
IdolNinja: that's the first entry
curly haired boy: yep
IdolNinja: once again, between the <Name> tags is what we want
IdolNinja: that defines the sound that's heard
IdolNinja: so SFX_EXP_FLASHBANG is probably the sound fx for the flashbang explosion
IdolNinja: that weeee and muffled sound thing
curly haired boy: cool
curly haired boy: :D
curly haired boy: let's try that
IdolNinja: actually I have a better idea
IdolNinja: but first
IdolNinja: SFX_DTH_
IdolNinja: see those definitions?
IdolNinja: the 2nd one is one
IdolNinja: SFX_DTH_DRUGSTILL
curly haired boy: ok
IdolNinja: took me a bit figure out what those were
IdolNinja: DTH is death
IdolNinja: it's the destruction of the object
IdolNinja: the sound it makes
curly haired boy: ahh
IdolNinja: SFX_DTH_FENCE
curly haired boy: XD
IdolNinja: would be the fence destroyed
IdolNinja: there's one called something gasp
IdolNinja: I think it's a crowd gasping
curly haired boy: I'll try that one :D
IdolNinja: I think it would be a funny sound to use
IdolNinja: going to find it yourself and change?
curly haired boy: already done
curly haired boy: already edited
IdolNinja: haha!
IdolNinja: I knew you could do it
IdolNinja: you could find some other ones for alt attack
IdolNinja: or reload
curly haired boy: etc.
IdolNinja: some won't work FYI

Ok now for an example:

(The following is an excerpt from the weapons.xtbl file)

(unmodded)
Code:
<Weapon>
        <Name>glock</Name>
        <Weapon_Class>pistol</Weapon_Class>
        <Trigger_Type>single</Trigger_Type>
        <Magazine_Size>12</Magazine_Size>
        <Range_Max>120</Range_Max>
        <Sound_Radius>50</Sound_Radius>
        <Damage_Max>
            <NPC_Damage>150</NPC_Damage>
            <Player_Damage>75</Player_Damage>
            </Damage_Max>
        <_Editor>
            <Category>Entries:Ranged</Category>
            </_Editor>
        <Ragdoll_Force_Shoot>150</Ragdoll_Force_Shoot>
        <MeleeAttacks>
            <StandingSecondary>pistol_stand_ns</StandingSecondary>
            <MovingSecondary>pistol_move_ns</MovingSecondary>
            <ProneAttackSecondary>pistol_prone_kick</ProneAttackSecondary>
            <Melee_Range>1.4</Melee_Range>
            <StandingSynced>pistol_stand</StandingSynced>
            <MovingSynced>pistol_move</MovingSynced>
            </MeleeAttacks>
        <Animation_Group>Pistol</Animation_Group>
        <AI_Range_Max>50</AI_Range_Max>
        <Brass>Handgun</Brass>
        <Muzzle_Effect>muzz_handgun_nl</Muzzle_Effect>
        <Category>WPNCAT_PISTOL</Category>
        <PlayerWeaponSpread>
            <SpreadMinMax>
                <SpreadMovementMultipliers>
                    <Movement_Multiplier_Walk>1.0</Movement_Multiplier_Walk>
                    <Movement_Multiplier_Crouch>0.8</Movement_Multiplier_Crouch>
                    <Movement_Multiplier_Run>1.1</Movement_Multiplier_Run>
                    <Movement_Multiplier_Sprint>1.5</Movement_Multiplier_Sprint>
                    <Movement_Multiplier_Vehicle>0.8</Movement_Multiplier_Vehicle>
                    <Movement_Multiplier_Fine_Aim>0.5</Movement_Multiplier_Fine_Aim>
                    </SpreadMovementMultipliers>
                <Player_Spread_Max>3</Player_Spread_Max>
                <Player_Spread_Min>0.1</Player_Spread_Min>
                <Movement_Multiplier_Vehicle>1.0</Movement_Multiplier_Vehicle>
                </SpreadMinMax>
            <SpreadDynamics>
                <SpreadDynamicMultipliers>
                    <Movement_Multiplier_Crouch>1.0</Movement_Multiplier_Crouch>
                    <Movement_Multiplier_Walk>1.0</Movement_Multiplier_Walk>
                    <Movement_Multiplier_Run>1.0</Movement_Multiplier_Run>
                    <Movement_Multiplier_Sprint>1.0</Movement_Multiplier_Sprint>
                    <Movement_Multiplier_Vehicle>1.0</Movement_Multiplier_Vehicle>
                    </SpreadDynamicMultipliers>
                <Player_To_Spread_Max>3</Player_To_Spread_Max>
                <Player_To_Spread_Min>200</Player_To_Spread_Min>
                </SpreadDynamics>
            <Movement_Multiplier_Vehicle>1.0</Movement_Multiplier_Vehicle>
            </PlayerWeaponSpread>
        <NPCWeaponSpread>
            <SpreadMinMax>
                <NPC_Spread_Max>4</NPC_Spread_Max>
                <NPC_Spread_Min>0.6</NPC_Spread_Min>
                <SpreadMovementMultipliers>
                    <Movement_Multiplier_Crouch>0.8</Movement_Multiplier_Crouch>
                    <Movement_Multiplier_Walk>1.0</Movement_Multiplier_Walk>
                    <Movement_Multiplier_Run>1.1</Movement_Multiplier_Run>
                    <Movement_Multiplier_Sprint>1.5</Movement_Multiplier_Sprint>
                    <Movement_Multiplier_Vehicle>1.75</Movement_Multiplier_Vehicle>
                    </SpreadMovementMultipliers>
                <SpreadTargetMovementMultipliers>
                    <Target_Movement_Multiplier_Walk>1.25</Target_Movement_Multiplier_Walk>
                    <Target_Movement_Multiplier_Run>1.5</Target_Movement_Multiplier_Run>
                    <Target_Movement_Multiplier_Sprint>2.0</Target_Movement_Multiplier_Sprint>
                    <Target_Movement_Multiplier_Vehicle>2.5</Target_Movement_Multiplier_Vehicle>
                    </SpreadTargetMovementMultipliers>
                </SpreadMinMax>
            <SpreadDynamics>
                <NPC_To_Spread_Max>3</NPC_To_Spread_Max>
                <NPC_To_Spread_Min>200</NPC_To_Spread_Min>
                <SpreadDynamicMultipliers>
                    <Movement_Multiplier_Crouch>1.0</Movement_Multiplier_Crouch>
                    <Movement_Multiplier_Walk>1.0</Movement_Multiplier_Walk>
                    <Movement_Multiplier_Run>1.0</Movement_Multiplier_Run>
                    <Movement_Multiplier_Sprint>1.0</Movement_Multiplier_Sprint>
                    <Movement_Multiplier_Vehicle>1.0</Movement_Multiplier_Vehicle>
                    </SpreadDynamicMultipliers>
                </SpreadDynamics>
            </NPCWeaponSpread>
        <feedback_name_shot_in_vehicle>IV_WF_PS_Glock</feedback_name_shot_in_vehicle>
        <feedback_name_shot_on_foot>OF_WF_PS_Glock</feedback_name_shot_on_foot>
        <feedback_name_melee_soft>OF_WF_BS__Default_Soft</feedback_name_melee_soft>
        <feedback_name_melee_hard>OF_WF_BS__Default_Hard</feedback_name_melee_hard>
        <pickup_info>
            <min_ammo_given>5</min_ammo_given>
            <max_ammo_given>15</max_ammo_given>
            </pickup_info>
        <Flags>
            <Flag>dual wieldable</Flag>
            </Flags>
        <Time_Management>
            <Refire_Delay>150</Refire_Delay>
            <npc_refire_delay>
                <min>400</min>
                <max>900</max>
                </npc_refire_delay>
            </Time_Management>
        <feedback_name_spinup>Null_Feedback</feedback_name_spinup>
        <Ammo>Bullet Pistol</Ammo>
        <Inv_Slot>pistol</Inv_Slot>
        <Ammo_per_Shot>0</Ammo_per_Shot>
        <Audio>
            <Fire_Sound>GLOCK_FIRE</Fire_Sound>
            <NPC_Fire_Sound>GLOCK_FIRE_NPC</NPC_Fire_Sound>
            <Secondary_Fire_Sound>RFL_MELEE</Secondary_Fire_Sound>
            <Reload_Sound>GLOCK_RELOAD</Reload_Sound>
            <No_Ammo_Sound>GLOCK_DRY</No_Ammo_Sound>
            <Hit_Wall_Sound>IMP_METAL_HIT</Hit_Wall_Sound>
            <Spinning_Snd_Pitch_End>1</Spinning_Snd_Pitch_End>
            <MeleeSound>
                <ImpactFoleyFlesh>IMP_METAL_HIT_FLESH</ImpactFoleyFlesh>
                </MeleeSound>
            </Audio>
        <Constant_Effects></Constant_Effects>
        <Alt_Trigger_Type>single</Alt_Trigger_Type>
        <Spinebend_Limits>Pistol</Spinebend_Limits>
        <Strafe_Angles>Pistol</Strafe_Angles>
        <Player_Combat_Ready_MS>3000</Player_Combat_Ready_MS>
        <NPC_Combat_Ready_MS>2000</NPC_Combat_Ready_MS>
        <Tracer_Effect>gun_tracer</Tracer_Effect>
        </Weapon>

The part that we are concerned with is the audio section.
Specifically the <Fire_Sound>GLOCK_FIRE</Fire_Sound> line.
Here is where you swap out your in game sound files changing the
one that plays as you fire the gun.

Just to demonstrate I am going to switch out GLOCK_FIRE for PICKUP_COLLECT
which is the sound of money being picked up

<Fire_Sound>PICKUP_COLLECT</Fire_Sound>

So our new code would read:

Code:
<Weapon>
        <Name>glock</Name>
        <Weapon_Class>pistol</Weapon_Class>
        <Trigger_Type>single</Trigger_Type>
        <Magazine_Size>12</Magazine_Size>
        <Range_Max>120</Range_Max>
        <Sound_Radius>50</Sound_Radius>
        <Damage_Max>
            <NPC_Damage>150</NPC_Damage>
            <Player_Damage>75</Player_Damage>
            </Damage_Max>
        <_Editor>
            <Category>Entries:Ranged</Category>
            </_Editor>
        <Ragdoll_Force_Shoot>150</Ragdoll_Force_Shoot>
        <MeleeAttacks>
            <StandingSecondary>pistol_stand_ns</StandingSecondary>
            <MovingSecondary>pistol_move_ns</MovingSecondary>
            <ProneAttackSecondary>pistol_prone_kick</ProneAttackSecondary>
            <Melee_Range>1.4</Melee_Range>
            <StandingSynced>pistol_stand</StandingSynced>
            <MovingSynced>pistol_move</MovingSynced>
            </MeleeAttacks>
        <Animation_Group>Pistol</Animation_Group>
        <AI_Range_Max>50</AI_Range_Max>
        <Brass>Handgun</Brass>
        <Muzzle_Effect>muzz_handgun_nl</Muzzle_Effect>
        <Category>WPNCAT_PISTOL</Category>
        <PlayerWeaponSpread>
            <SpreadMinMax>
                <SpreadMovementMultipliers>
                    <Movement_Multiplier_Walk>1.0</Movement_Multiplier_Walk>
                    <Movement_Multiplier_Crouch>0.8</Movement_Multiplier_Crouch>
                    <Movement_Multiplier_Run>1.1</Movement_Multiplier_Run>
                    <Movement_Multiplier_Sprint>1.5</Movement_Multiplier_Sprint>
                    <Movement_Multiplier_Vehicle>0.8</Movement_Multiplier_Vehicle>
                    <Movement_Multiplier_Fine_Aim>0.5</Movement_Multiplier_Fine_Aim>
                    </SpreadMovementMultipliers>
                <Player_Spread_Max>3</Player_Spread_Max>
                <Player_Spread_Min>0.1</Player_Spread_Min>
                <Movement_Multiplier_Vehicle>1.0</Movement_Multiplier_Vehicle>
                </SpreadMinMax>
            <SpreadDynamics>
                <SpreadDynamicMultipliers>
                    <Movement_Multiplier_Crouch>1.0</Movement_Multiplier_Crouch>
                    <Movement_Multiplier_Walk>1.0</Movement_Multiplier_Walk>
                    <Movement_Multiplier_Run>1.0</Movement_Multiplier_Run>
                    <Movement_Multiplier_Sprint>1.0</Movement_Multiplier_Sprint>
                    <Movement_Multiplier_Vehicle>1.0</Movement_Multiplier_Vehicle>
                    </SpreadDynamicMultipliers>
                <Player_To_Spread_Max>3</Player_To_Spread_Max>
                <Player_To_Spread_Min>200</Player_To_Spread_Min>
                </SpreadDynamics>
            <Movement_Multiplier_Vehicle>1.0</Movement_Multiplier_Vehicle>
            </PlayerWeaponSpread>
        <NPCWeaponSpread>
            <SpreadMinMax>
                <NPC_Spread_Max>4</NPC_Spread_Max>
                <NPC_Spread_Min>0.6</NPC_Spread_Min>
                <SpreadMovementMultipliers>
                    <Movement_Multiplier_Crouch>0.8</Movement_Multiplier_Crouch>
                    <Movement_Multiplier_Walk>1.0</Movement_Multiplier_Walk>
                    <Movement_Multiplier_Run>1.1</Movement_Multiplier_Run>
                    <Movement_Multiplier_Sprint>1.5</Movement_Multiplier_Sprint>
                    <Movement_Multiplier_Vehicle>1.75</Movement_Multiplier_Vehicle>
                    </SpreadMovementMultipliers>
                <SpreadTargetMovementMultipliers>
                    <Target_Movement_Multiplier_Walk>1.25</Target_Movement_Multiplier_Walk>
                    <Target_Movement_Multiplier_Run>1.5</Target_Movement_Multiplier_Run>
                    <Target_Movement_Multiplier_Sprint>2.0</Target_Movement_Multiplier_Sprint>
                    <Target_Movement_Multiplier_Vehicle>2.5</Target_Movement_Multiplier_Vehicle>
                    </SpreadTargetMovementMultipliers>
                </SpreadMinMax>
            <SpreadDynamics>
                <NPC_To_Spread_Max>3</NPC_To_Spread_Max>
                <NPC_To_Spread_Min>200</NPC_To_Spread_Min>
                <SpreadDynamicMultipliers>
                    <Movement_Multiplier_Crouch>1.0</Movement_Multiplier_Crouch>
                    <Movement_Multiplier_Walk>1.0</Movement_Multiplier_Walk>
                    <Movement_Multiplier_Run>1.0</Movement_Multiplier_Run>
                    <Movement_Multiplier_Sprint>1.0</Movement_Multiplier_Sprint>
                    <Movement_Multiplier_Vehicle>1.0</Movement_Multiplier_Vehicle>
                    </SpreadDynamicMultipliers>
                </SpreadDynamics>
            </NPCWeaponSpread>
        <feedback_name_shot_in_vehicle>IV_WF_PS_Glock</feedback_name_shot_in_vehicle>
        <feedback_name_shot_on_foot>OF_WF_PS_Glock</feedback_name_shot_on_foot>
        <feedback_name_melee_soft>OF_WF_BS__Default_Soft</feedback_name_melee_soft>
        <feedback_name_melee_hard>OF_WF_BS__Default_Hard</feedback_name_melee_hard>
        <pickup_info>
            <min_ammo_given>5</min_ammo_given>
            <max_ammo_given>15</max_ammo_given>
            </pickup_info>
        <Flags>
            <Flag>dual wieldable</Flag>
            </Flags>
        <Time_Management>
            <Refire_Delay>150</Refire_Delay>
            <npc_refire_delay>
                <min>400</min>
                <max>900</max>
                </npc_refire_delay>
            </Time_Management>
        <feedback_name_spinup>Null_Feedback</feedback_name_spinup>
        <Ammo>Bullet Pistol</Ammo>
        <Inv_Slot>pistol</Inv_Slot>
        <Ammo_per_Shot>0</Ammo_per_Shot>
        <Audio>
            <Fire_Sound>PICKUP_COLLECT</Fire_Sound>
            <NPC_Fire_Sound>GLOCK_FIRE_NPC</NPC_Fire_Sound>
            <Secondary_Fire_Sound>RFL_MELEE</Secondary_Fire_Sound>
            <Reload_Sound>GLOCK_RELOAD</Reload_Sound>
            <No_Ammo_Sound>GLOCK_DRY</No_Ammo_Sound>
            <Hit_Wall_Sound>IMP_METAL_HIT</Hit_Wall_Sound>
            <Spinning_Snd_Pitch_End>1</Spinning_Snd_Pitch_End>
            <MeleeSound>
                <ImpactFoleyFlesh>IMP_METAL_HIT_FLESH</ImpactFoleyFlesh>
                </MeleeSound>
            </Audio>
        <Constant_Effects></Constant_Effects>
        <Alt_Trigger_Type>single</Alt_Trigger_Type>
        <Spinebend_Limits>Pistol</Spinebend_Limits>
        <Strafe_Angles>Pistol</Strafe_Angles>
        <Player_Combat_Ready_MS>3000</Player_Combat_Ready_MS>
        <NPC_Combat_Ready_MS>2000</NPC_Combat_Ready_MS>
        <Tracer_Effect>gun_tracer</Tracer_Effect>
        </Weapon>

Then you would just save your work, drop the file into your mods
directory and compile. Then just replace the files in the game directory.
 
Last edited:
Back
Top