Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release Hit sounds
#1
Another old thing, better sounds when hiting, but badass and sometimes unrealistic, OMA . Save as _damagefeedback.gsc and paste it inside gametypes folder

Code:
init()
{
    precacheShader("damage_feedback");
    precacheShader("damage_feedback_j");
    precacheShader("damage_feedback_endgame");
    precacheShader("scavenger_pickup");

    level thread onPlayerConnect();
}

onPlayerConnect()
{
    for(;;)
    {
        level waittill("connected", player);

        player.hud_damagefeedback = newClientHudElem(player);
        player.hud_damagefeedback.horzAlign = "center";
        player.hud_damagefeedback.vertAlign = "middle";
        player.hud_damagefeedback.x = -12;
        player.hud_damagefeedback.y = -12;
        player.hud_damagefeedback.alpha = 0;
        player.hud_damagefeedback.archived = true;
        player.hud_damagefeedback setShader("damage_feedback", 24, 48);
    }
}

updateDamageFeedback( typeHit )
{
    if ( !isPlayer( self ) )
        return;
    
    x = -12;
    y = -12;

    if ( getDvarInt( "camera_thirdPerson" ) )
        yOffset = self GetThirdPersonCrosshairOffset() * 240;
    else
        yOffset = getdvarfloat( "cg_crosshairVerticalOffset" ) * 240;
    
    if ( level.splitscreen )    
        yOffset *= 0.5;

    feedbackDurationOverride = 0;
    startAlpha = 1;
    
    if ( typeHit == "hitBodyArmor" )
    {
        self.hud_damagefeedback setShader("damage_feedback_j", 24, 48);
        self playlocalsound("generic_death_russian_2"); // TODO: change sound?
    }
    else if ( typeHit == "hitEndGame" )
    {
        self.hud_damagefeedback setShader("damage_feedback_endgame", 24, 48);
        self playlocalsound("generic_death_russian_2");
    }
    else if ( typeHit == "stun" )
    {
        return;    
    }
    else if ( typeHit == "none" )
    {
        return;    
    }
    else if ( typeHit == "scavenger" && !level.hardcoreMode )
    {
        x = -36;
        y = 32;
        self.hud_damagefeedback setShader("scavenger_pickup", 64, 32);
        feedbackDurationOverride = 2.5;
    }
    else
    {
        self.hud_damagefeedback setShader("damage_feedback", 24, 48);
        self playlocalsound("generic_death_russian_2");
    }
    
    self.hud_damagefeedback.alpha = startAlpha;
    if ( feedBackDurationOverride != 0 )
        self.hud_damagefeedback fadeOverTime(feedbackDurationOverride);
    else    
        self.hud_damagefeedback fadeOverTime(1);
    
    self.hud_damagefeedback.alpha = 0;

    // only update hudelem positioning when necessary
    if ( self.hud_damagefeedback.x != x )
        self.hud_damagefeedback.x = x;    

    y = y - int( yOffset );
    if ( self.hud_damagefeedback.y != y )
        self.hud_damagefeedback.y = y;    
}
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Release] CS addon for MW2(Sounds,show damage) Fl0w_.JACKDAN 1 4,690 09-29-2013, 19:46
Last Post: Nekochan
  Help Playing sounds ingame? Some 2 3,387 09-10-2013, 10:42
Last Post: Yamato
  [Release] Modern Warfare 3 Fast File Sounds master131 5 18,313 05-21-2013, 16:46
Last Post: ZURA.
  [Release] Modern Warfare 2 Fast File Sounds master131 3 15,796 11-13-2012, 07:19
Last Post: DidUknowiPwn
  [Tutorial] Adding sounds to SP weapons (in multiplayer) Nukem 54 36,061 11-09-2012, 18:59
Last Post: The Tronuo
  Importing Gun sounds epiccheese9 4 3,940 10-10-2012, 19:47
Last Post: epiccheese9
  Bo adding sounds need help! Will thank SamuelGrund 0 2,440 08-30-2012, 14:54
Last Post: SamuelGrund
  SnD bg sounds project paok-atak 8 4,944 05-22-2012, 18:08
Last Post: JariZ
  SP sounds never work (included my sound test mod here) Xzite 7 4,811 04-05-2012, 17:47
Last Post: Xzite
  reload sounds + weapon sounds Xzite 3 2,689 03-17-2012, 00:30
Last Post: Xzite

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.