The default player sounds, such as grunts, footsteps and impacts, are set up in UTPawnSoundGroup.UC (and by extension UTPawnSoundGroup_Liandri.UC since the UDK generic Bot is from the Liandri family).
In UTPawn.UC, line 5497: SoundGroupClass=class'UTGame.UTPawnSoundGroup'
we get the definition for the file that sounds will be established in. This is found in the file's DefaultProperties
. Further down, we get additional SoundCues
given for ArmorHitSound=
, SpawnSound=
, TeleportSound=
, and FallImpactSound=
, all of which can be overridden in your MyPawn.UC file's DefaultProperties
. We also have some control over the audible distance with MaxFootstepDistSq, and MaxJumpSoundDistSq.
In this recipe we won't be considering changes to the weapon sounds for the default player, but these are, similarly, set in the DefaultProperties
of the appropriate weapon class.
In ConTEXT you can open multiple files, so open up the C:UDK~DevelopmentSrcUTGameClassesUTPawnSoundGroup.UC
first, then open up in another tab C:UDK~DevelopmentSrcUTGameClassesUTPawn.UC
and look for line 5535, mentioned above using Ctrl + G. Since MyPawn.UC that we created in C:UDK~DevelopmentSrcMyGameClasses
extends UTPawn.UC, if you have a line in the derived file which is the same as the base file, MyPawn.UC will act as an override. You can edit either UTPawn.UC or MyPawn.UC as you see fit, depending on what you have already provisioned in MyGame. Besides the two files from UTGame, also open up C:UDK~DevelopmentSrcMyGameClassesMyGame.UC
.
DefaultProperties
:DefaultProperties
{
PlayerControllerClass=class'MyGame.MyPlayerController'
DefaultPawnClass=class'MyGame.MyPawn'
}
DefaultProperties
, also insert the following above the end curly brace }:SoundGroupClass=class'MyGame.MyPawnSoundGroup'
C:UDK~DevelopmentSrcMyGameClassesMyPawnSoundGroup.UC
and also change the first line of your new MyPawnSoundGroup.UC to read class
MyPawnSoundGroup extends
UTPawnSoundGroup.DefaultProperties
section. Leaving it there would just double up what's already in the class we're deriving from.DefaultProperties
for this class you will see there are a lot of SoundCue entries. Replace all the SoundCue paths as follows: PacktWavs.Cue.Name, where Name refers to the action you are setting the sound for: DrownSound=SoundCue'PacktWavs.Cue.Drown_Cue'
.DefaultProperties
. Later you can change these to whatever sounds you've sourced. After setting your SoundCue list, compile, then load a scene and set its View | World Properties | GameType | Game Type for PIE to MyGame and PIE to see what you get for your player sounds now.Chapter 3, It Lives! discussed footsteps assigned in the sequence properties of an AnimSet to create footstep sounds timed to the keyframed steps of the character. Check out the recipe Sounds for non-Matinee controlled animation.
18.222.184.0