Jump to content

Home

Detrmining whether to play Jaden male or female sounds


Teancum

Recommended Posts

I've been looking through the icarus scripts and have noticed that all of the cutscene scripts and have noticed that every one of Jaden's lines is drawn from /jaden_male. What I'm wondering is how the game determines how to use the female sounds, and thus if there's a way to use the new voice packs so each race has a unique sound.

 

Oh ya, I know about the sex m/f cvar

Link to comment
Share on other sites

Well, the sounds work in MP. Pain sounds work, all that stuff. I tried working with the sex m/f variable and that seems to be what changes the voice overs in SP. I'm going to try to set custom genders in sounds.cfg and see if that works. Just for fun I tried sex r (for rodian) and had no voice over. Now I'm changing the sounds.cfg to see if that helps. *edit* no luck. Looks like to get custom voice overs to work in SP we'll have to add new cvars for each race. Is it possible to have more than once character for a value in a cvar? For instance, 'kdm' for Kel Dor male or just 'k'?

 

I also pulled this from the source of cg_players.c -- I don't know if this helps at all or not. I can't find anything in the icarus scripts. It's obviously a cvar thing, but I thought this might help:

 

*edit* looks like the part bolded is searching for whether the player is female -- maybe this will give us some leads

 

#define DEFAULT_FEMALE_SOUNDPATH "chars/mp_generic_female/misc"//"chars/tavion/misc"
#define DEFAULT_MALE_SOUNDPATH "chars/mp_generic_male/misc"//"chars/kyle/misc"
void CG_LoadCISounds(clientInfo_t *ci, qboolean modelloaded)
{
fileHandle_t f;
qboolean	isFemale = qfalse;
int			i = 0;
int			fLen = 0;
const char	*dir;
char		soundpath[MAX_QPATH];
char		soundName[1024];
const char	*s;

dir = ci->modelName;

if ( !ci->skinName || !Q_stricmp( "default", ci->skinName ) )
{//try default sounds.cfg first
	fLen = trap_FS_FOpenFile(va("models/players/%s/sounds.cfg", dir), &f, FS_READ);
	if ( !f ) 
	{//no?  Look for _default sounds.cfg
		fLen = trap_FS_FOpenFile(va("models/players/%s/sounds_default.cfg", dir), &f, FS_READ);
	}
}
else
{//use the .skin associated with this skin
	fLen = trap_FS_FOpenFile(va("models/players/%s/sounds_%s.cfg", dir, ci->skinName), &f, FS_READ);
	[b]if ( !f ) 
	{//fall back to default sounds
		fLen = trap_FS_FOpenFile(va("models/players/%s/sounds.cfg", dir), &f, FS_READ);
	}
}

soundpath[0] = 0;

if (f)
{
	trap_FS_Read(soundpath, fLen, f);
	soundpath[fLen] = 0;

	i = fLen;

	while (i >= 0 && soundpath[i] != '\n')
	{
		if (soundpath[i] == 'f')
		{
			isFemale = qtrue;
			soundpath[i] = 0;
		}

		i--;
	}

	i = 0;

	while (soundpath[i] && soundpath[i] != '\r' && soundpath[i] != '\n')
	{
		i++;
	}
	soundpath[i] = 0;

	trap_FS_FCloseFile(f);
}

if (isFemale)
{
	ci->gender = GENDER_FEMALE;
}
else
{
	ci->gender = GENDER_MALE;
}
[/b]
trap_S_ShutUp(qtrue);

for ( i = 0 ; i < MAX_CUSTOM_SOUNDS ; i++ )
{
	s = cg_customSoundNames[i];
	if ( !s ) {
		break;
	}

	Com_sprintf(soundName, sizeof(soundName), "%s", s+1);
	COM_StripExtension(soundName, soundName);
	//strip the extension because we might want .mp3's

	ci->sounds[i] = 0;
	// if the model didn't load use the sounds of the default model
	if (soundpath[0])
	{
		ci->sounds[i] = trap_S_RegisterSound( va("sound/chars/%s/misc/%s", soundpath, soundName) );
	}
	else
	{
		if (modelloaded)
		{
			ci->sounds[i] = trap_S_RegisterSound( va("sound/chars/%s/misc/%s", dir, soundName) );
		}
	}

	if (!ci->sounds[i])
	{ //failed the load, try one out of the generic path
		if (isFemale)
		{
			ci->sounds[i] = trap_S_RegisterSound( va("sound/%s/%s", DEFAULT_FEMALE_SOUNDPATH, soundName) );
		}
		else
		{
			ci->sounds[i] = trap_S_RegisterSound( va("sound/%s/%s", DEFAULT_MALE_SOUNDPATH, soundName) );
		}
	}
}

Link to comment
Share on other sites

  • 1 month later...
Originally posted by Azrael666

Where would it draw the play sex from anyway? Sex is recorded in .npc files, but the player jedi doesnt have one.

 

the player does have an npc file for the cutscenes, named player, which has CLASS_PLAYER set as a NPC class.

 

whenever you spawn this you'll get a npc that has no default AI(BS_cinematic perhaps?)and looks exactly like the player character you chose when you started up the game. It could be that you're character settings(among them the sex of the character) are saved somewhere and read by the CLASS_PLAYER npc class. Then the npc would have sex set in the npc file.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...