Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 82 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Death sounds
liightniing
General Member
Since: Mar 31, 2012
Posts: 55
Last: Oct 14, 2017
[view latest posts]
Level 3
Category: CoD4 Scripting
Posted: Friday, Aug. 7, 2015 02:48 am
I'm interested in adding death sounds to my mod. I know a few mods have them, but is there a file I need to add them to my mod as well?
Share |
SPi
General Member
Since: Jul 4, 2012
Posts: 531
Last: Nov 9, 2019
[view latest posts]
Level 6
Category: CoD4 Scripting
Posted: Sunday, Aug. 9, 2015 09:48 pm
MP or SP?

if SP in raw/sound/voiceovers/generic there are all the files you want to change.
Add your own death sounds in your mod iwd with the same names and directories with the ones you want to change:

For exapmle. You want to make your own raw/sounds/voiceovers/generic/RU1/ru1_death_01.wav
Death sound?
Rename the file to ru1_death_01.wav (make sure its a wav format)
and then in your mod iwd make a folder with the same path (but not raw)
That will be :
sounds/voiceovers/generic/RU1/ru1_death_01.wav

That should work.

Im not sure if MP is using the same death sounds but if it does its the same way.
Share |
liightniing
General Member
Since: Mar 31, 2012
Posts: 55
Last: Oct 14, 2017
[view latest posts]
Level 3
Category: CoD4 Scripting
Posted: Monday, Aug. 10, 2015 02:06 am
ah, thanks, but I don't even know how to get mp deathsounds to work at all. By default the player dies without even making a sound in mp, but I want to hear screams of agony (kind of sadistic, I know).
Share |
SPi
General Member
Since: Jul 4, 2012
Posts: 531
Last: Nov 9, 2019
[view latest posts]
Level 6
Category: CoD4 Scripting
Posted: Monday, Aug. 10, 2015 12:16 pm
The Stock death sounds are sadistic enough i believe.
So you want it for MP right?
I thought it was using the same deathsound system but anyway.
Idk what to do if MP does not use any death sounds [ohwell]

edited on Aug. 10, 2015 05:17 am by SPi
Share |
DrBiggzz
General Member
Since: Apr 9, 2007
Posts: 98
Last: Sep 24, 2022
[view latest posts]
Level 3
Forum Moderator
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Tuesday, Aug. 11, 2015 11:15 am
Would just have to add a script that plays a sound on player death. When i get home from work ill post one up.
Share |
liightniing
General Member
Since: Mar 31, 2012
Posts: 55
Last: Oct 14, 2017
[view latest posts]
Level 3
Category: CoD4 Scripting
Posted: Thursday, Aug. 13, 2015 12:38 am
Alright, thanks. I've been trying to mess with the openwarfare .gsc file that plays the sound on death but I can't quite get it to work.
Share |
DrBiggzz
General Member
Since: Apr 9, 2007
Posts: 98
Last: Sep 24, 2022
[view latest posts]
Level 3
Forum Moderator
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Friday, Aug. 21, 2015 10:04 am
Been very busy with work, any way you can upload the .gsc file for me to look at. Will be able to help out more if so.
Share |
liightniing
General Member
Since: Mar 31, 2012
Posts: 55
Last: Oct 14, 2017
[view latest posts]
Level 3
Category: CoD4 Scripting
Posted: Saturday, Aug. 22, 2015 09:16 pm
No worries, I'm working on something else right now too. This script here should have worked just fine, but I'm not sure where I went wrong.


#include openwarfare\_eventmanager;
#include openwarfare\_utils;

init()
{
// Get the main module's dvars
level.scr_health_hurt_sound = getdvarx( "scr_health_hurt_sound", "int", 1, 0, 1 );
level.scr_health_pain_sound = getdvarx( "scr_health_pain_sound", "int", 0, 0, 10 );
level.scr_health_death_sound = getdvarx( "scr_health_death_sound", "int", 0, 0, 1 );

if ( level.scr_health_hurt_sound == 0 && level.scr_health_pain_sound == 0 && level.scr_health_death_sound == 0 )
return;

level.healthOverlayCutoff = 0.55;

level thread addNewEvent( "onPlayerConnected", ::onPlayerConnected );
}

onPlayerConnected()
{
self thread addNewEvent( "onPlayerSpawned", ::onPlayerSpawned );
self thread addNewEvent( "onPlayerKilled", ::onPlayerKilled );
}

onPlayerSpawned()
{
// Set which kind of voice this player is going to do when dying
switch ( self.pers["team"] ) {
case "allies":
switch ( game["allies"] ) {
case "sas":
self.myDeathSound = "generic_death_british_";
self.myPainSound = "generic_pain_british_";
break;
case "marines":
default:
self.myDeathSound = "generic_death_american_";
self.myPainSound = "generic_pain_american_";
break;
}
break;
case "axis":
switch ( game["axis"] ) {
case "russian":
self.myDeathSound = "generic_death_russian_";
self.myPainSound = "generic_pain_russian_";
break;
case "arab":
case "opfor":
default:
self.myDeathSound = "generic_death_arab_";
self.myPainSound = "generic_pain_arab_";
break;
}
break;
default:
self.myDeathSound = "generic_death_american_";
self.myPainSound = "generic_pain_american_";
break;
}
// Assign a random number between 1 and 8 (sound aliases for go from 1 to 8).
self.myDeathSound = self.myDeathSound + randomIntRange(1, 9);
self.myPainSound = self.myPainSound + randomIntRange(1, 9);

// Initialize the threads that will handle the sound for us
self thread playerBreathingSound( self.maxhealth );
self thread playerPainSound();
}


onPlayerKilled()
{
// Make the death sound for this player
if ( level.scr_health_death_sound == 1 && ( !isDefined( self.sMeansOfDeath ) || self.sMeansOfDeath != "MOD_HEAD_SHOT" ) ) {
self playSound( self.myDeathSound );
}
}


playerBreathingSound( maxHealth )
{
self endon("disconnect");
self endon("death");
level endon( "game_ended" );

// Are pain sounds enabled? If bleeding is enabled then let that routine handle the sounds instead
if ( level.scr_health_hurt_sound == 0 || ( level.scr_healthsystem_bleeding_enable && level.scr_healthregen_method == 0 ) )
return;

player = self;

// We'll use this variable to control which kind of sound we should make
healthCap = maxHealth * level.healthOverlayCutoff;

veryHurt = false;

for (;;)
{
wait (0.05);

// Player is dead.
if ( !isDefined( player ) || player.health <= 0 ) {
return;
}

// Player has more than 99% of the health restored... We shouldn't make any more sounds.
if ( player.health >= ( maxHealth * 0.99 ) ) {
if ( !veryHurt ) {
continue;
} else {
veryHurt = false;
}
}

// Check which sound we should play
if ( player.health < healthCap ) {
playSound = "breathing_hurt";
veryHurt = true;
} else {
playSound = "breathing_better";
}

// Play the sound and wait some standard amount of time between each one
if ( level.gametype != "ftag" || !self.freezeTag["frozen"] )
player playLocalSound( playSound );

wait 0.784;
wait ( 0.5 + randomfloat( 0.8 ) );
}
}


playerPainSound()
{
self endon("disconnect");
self endon("death");
level endon( "game_ended" );

if ( level.scr_health_pain_sound == 0 )
return;

for (;;)
{
self waittill("damage_taken", eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime );

// Make sure the player was damaged
if ( iDamage > 0 ) {
playPainSound = randomIntRange(1, level.scr_health_pain_sound + 1 );

// We only play the sound when the random value is 1
if ( playPainSound == 1 ) {
self playSound( self.myPainSound );
}
}
}
}

Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»