Announcement

Collapse
No announcement yet.

UT2004 Custom "Headshot" Sound

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    UT2004 Custom "Headshot" Sound

    Is it possible to add a custom "HeadShot" sound in UT2004? I'd like to have the script written into my gun mutator. If anyone knows where I can find tutorials or personally know how to do it I'd be much appreciative. I've been racking my small brain on this and I need sleep! Thanks in Advance.

    #2
    I think the headshot message and sound are called from the damage type. Like in DamTypeSniperHead:

    Code:
    class DamTypeSniperHeadShot extends WeaponDamageType
    	abstract;
    
    var class<LocalMessage> KillerMessage;
    var sound HeadHunter; // OBSOLETE
    
    static function IncrementKills(Controller Killer)//This makes it display a "HeadHunter" sound when someone gets 15 headshots.
    {
    	local xPlayerReplicationInfo xPRI;
    	
    	if ( PlayerController(Killer) == None )
    		return;
    		
    	PlayerController(Killer).ReceiveLocalizedMessage( Default.KillerMessage, 0, Killer.PlayerReplicationInfo, None, None );
    	xPRI = xPlayerReplicationInfo(Killer.PlayerReplicationInfo);
    	if ( xPRI != None )
    	{
    		xPRI.headcount++;
    		if ( (xPRI.headcount == 15) && (UnrealPlayer(Killer) != None) )
    			UnrealPlayer(Killer).ClientDelayedAnnouncementNamed('HeadHunter',15);
    	}
    }		
    
    static function GetHitEffects(out class<xEmitter> HitEffects[4], int VictemHealth )
    {
        HitEffects[0] = class'HitSmoke';
        HitEffects[1] = class'HitFlameBig';
    }
    
    defaultproperties
    {
         KillerMessage=Class'XGame.SpecialKillMessage'//I believe this is the client sound thats played when someone gets a headshot.
         WeaponClass=Class'XWeapons.SniperRifle'
         DeathString="%o's cranium was made extra crispy by %k's lightning gun."
         FemaleSuicide="%o violated the laws of space-time and sniped herself."
         MaleSuicide="%o violated the laws of space-time and sniped himself."
         bAlwaysSevers=True
         bSpecial=True
         bCauseConvulsions=True
         DamageOverlayMaterial=Shader'XGameShaders.PlayerShaders.LightningHit'
         DamageOverlayTime=0.900000
    }
    Hope this works!

    Comment


      #3
      Thanx Slip777 appreciate it

      I got it to work but used a differnet method, check this out:

      class DamTypecXTHeadShot extends WeaponDamageType
      abstract;

      #exec AUDIO IMPORT FILE=Sounds\HawkScreamLoud.wav NAME=Scream GROUP=Sounds

      var class<LocalMessage> killermessage;
      var sound HawkScreamLoud; // OBSOLETE
      var sound HeadHunter;
      static function IncrementKills(Controller Killer)
      {
      local xPlayerReplicationInfo xPRI;

      if ( PlayerController(Killer) == None )
      return;
      UnrealPlayer(Killer).ClientDelayedAnnouncement(Def ault.HawkScreamLoud,15); // HeadShot Sound (cXT)
      PlayerController(Killer).ReceiveLocalizedMessage( Default.KillerMessage, 0, Killer.PlayerReplicationInfo, None, None );
      xPRI = xPlayerReplicationInfo(Killer.PlayerReplicationInf o);
      if ( xPRI != None )
      {
      xPRI.headcount++;
      if ( (xPRI.headcount == 10) && (UnrealPlayer(Killer) != None) )
      UnrealPlayer(Killer).ClientDelayedAnnouncement(Def ault.HeadHunter,10);
      }
      }

      static function GetHitEffects(out class<xEmitter> HitEffects[4], int VictimHealth )
      {
      HitEffects[0] = class'HitSmoke';
      HitEffects[1] = class'HitFlameBig';
      }

      Defaultproperties

      {
      HawkScreamLoud=Sound'Scream'
      KillerMessage=class'SpecialKillMessage'
      WeaponClass=cXTRifle2k4_2.ZoomcXTRifle
      DeathString="%o's head was severed by %k's ripping bullets!"
      FemaleSuicide="%o shot herself while cleaning her weapon."
      MaleSuicide="%o shot himself while cleaning his weapon."
      bAlwaysSevers=True
      bSpecial=True
      bCauseConvulsions=True
      DamageOverlayMaterial=Shader'XGameShaders.PlayerSh aders.LightningHit'
      DamageOverlayTime=1.000000
      }

      Comment

      Working...
      X