Jump to content
The Dark Mod Forums

Subtitles in intro


ajotatxe

Recommended Posts

this is the routine in snd_world.cpp that displays the drawSound position and distance name

 

 

/*
==================
idSoundWorldLocal::ForegroundUpdate
==================
*/
void idSoundWorldLocal::ForegroundUpdate( int current44kHzTime ) {
int j, k;
idSoundEmitterLocal *def;

if ( !soundSystemLocal.isInitialized ) {
return;
}

Sys_EnterCriticalSection();

// if we are recording an AVI demo, don't use hardware time
if ( fpa[0] ) {
current44kHzTime = lastAVI44kHz;
}

//
// check to see if each sound is visible or not
// speed up by checking maxdistance to origin
// although the sound may still need to play if it has
// just become occluded so it can ramp down to 0
//
for ( j = 1; j < emitters.Num(); j++ ) {
def = emitters[j];

if ( def->removeStatus >= REMOVE_STATUS_SAMPLEFINISHED ) {
continue;
}

// see if our last channel just finished
def->CheckForCompletion( current44kHzTime );

if ( !def->playing ) {
continue;
}

// update virtual origin / distance, etc
def->Spatialize( listenerPos, listenerArea, rw );

// per-sound debug options
if ( idSoundSystemLocal::s_drawSounds.GetInteger() && rw ) {
if ( def->distance < def->maxDistance || idSoundSystemLocal::s_drawSounds.GetInteger() > 1 ) {
idBounds ref;
ref.Clear();
ref.AddPoint( idVec3( -10, -10, -10 ) );
ref.AddPoint( idVec3( 10, 10, 10 ) );
float vis = (1.0f - (def->distance / def->maxDistance));

// draw a box
rw->DebugBounds( idVec4( vis, 0.25f, vis, vis ), ref, def->origin );

// draw an arrow to the audible position, possible a portal center
if ( def->origin != def->spatializedOrigin ) {
rw->DebugArrow( colorRed, def->origin, def->spatializedOrigin, 4 );
}

// draw the index
idVec3 textPos = def->origin;
textPos[2] -= 8;
rw->DrawText( va("%i", def->index), textPos, 0.1f, idVec4(1,0,0,1), listenerAxis );
textPos[2] += 8;

// run through all the channels
for ( k = 0; k < SOUND_MAX_CHANNELS ; k++ ) {
idSoundChannel *chan = &def->channels[k];

// see if we have a sound triggered on this channel
if ( !chan->triggerState ) {
continue;
}

char text[1024];
float min = chan->parms.minDistance;
float max = chan->parms.maxDistance;
const char *defaulted = chan->leadinSample->defaultSound ? "(DEFAULTED)" : "";
sprintf( text, "%s (%i/%i %i/%i)%s", chan->soundShader->GetName(), (int)def->distance,
(int)def->realDistance, (int)min, (int)max, defaulted );
rw->DrawText( text, textPos, 0.1f, idVec4(1,0,0,1), listenerAxis );
textPos[2] += 8;
}
}
}
}

Sys_LeaveCriticalSection();

//
// the sound meter
//
if ( idSoundSystemLocal::s_showLevelMeter.GetInteger() ) {
const idMaterial *gui = declManager->FindMaterial( "guis/assets/soundmeter/audiobg", false );
if ( gui ) {
const shaderStage_t *foo = gui->GetStage(0);
if ( !foo->texture.cinematic ) {
((shaderStage_t *)foo)->texture.cinematic = new idSndWindow;
}
}
}

//
// optionally dump out the generated sound
//
if ( fpa[0] ) {
AVIUpdate();
}
}

 

 

all that would be needed is a map.script access to

 

GetName

distance (distance through a visportal)

realDistance (distance if using noclip)

min (its in meters) sound min radius

max (its in meters) sound max radius

 

as you can already get player position with $player1.getWorldOrigin() or maybe with the entity name get entity name World Origin.

 

sprintf( text, "%s (%i/%i %i/%i)%s", chan->soundShader->GetName(), (int)def->distance,
(int)def->realDistance, (int)min, (int)max, defaulted );

 

without having to turn on the debugging s_drawSound cvar.

 

be along lines of measure distance between player and sound being played if its a vocal sound and within range say 10 meters (about 35 feet) write subtitle text to gui based on language of l18m, along the lines of if there aren't any polish vocal then you could write the polish text for what the vocal is.

Edited by stumpy
  • Like 1
Link to comment
Share on other sites

In the doom 3 [cc] they seem to have overly complicated how it should work, as they seem to have used the #str_00000 system in adding there names to the credits gui but seem to have missed that they could use the same system for different languages, without having to add code for people to select their language.

  • Like 1
Link to comment
Share on other sites

I'm sorry for asking a common question. I have just registered in the forum and couldn't see the search dialog so far.

 

Search diaglog is at the top right of the main page.

I have an eclectic YouTube channel making videos on a variety of games. Come and have look here:

https://www.youtube.com/c/NeonsStyleHD

 

Dark Mod Missions: Briarwood Manor - available here or in game

http://forums.thedarkmod.com/topic/18980-fan-mission-briarwood-manor-by-neonsstyle-first-mission-6082017-update-16/

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
    • The Black Arrow

      Hope everyone has the blessing of undying motivation for "The Dark Mod 15th Anniversary Contest". Can't wait to see the many magnificent missions you all may have planned. Good luck, with an Ace!
      · 0 replies
×
×
  • Create New...