Jump to content
The Dark Mod Forums

Recommended Posts

Posted

I want to have some customized messages appear for certain objectives and was curious if there was a way to prevent the hard coded gui messages for objective complete or new objective from appearing. I was able to suppress the objective complete message by inserting a frame delay between the objective being completed and making it visible, but of course this results in the "new objective" message popping up even if the objective had been visible before.

I didn't see anything, but anyone aware of a method to "silently" make an objective visible so custom gui messages and sound effects could appear?

  • Like 1

-=  IRIS  =-    ♦    = SLL =

Posted

Can confirm that both completing an objective and making an objective visible are hardcoded to show those messages:

Spoiler
	// Only this objective is complete, not the entire mission
	// Ongoing objectives don't play the sound or mark off in the GUI as complete during mission
	// greebo: Don't play sound or display message for invisible objectives
	if (!obj.m_bOngoing && obj.m_bVisible)
	{
		player->StartSound("snd_objective_complete", SND_CHANNEL_ANY, 0, false, NULL);

		// greebo: Notify the player
		player->SendHUDMessage( "#str_02453" ); // "Objective complete"

		player->UpdateObjectivesGUI();
	}

 

Spoiler

void CMissionData::Event_NewObjective()
{
    DM_LOG(LC_OBJECTIVES,LT_DEBUG)LOGSTRING("Objectives: NEW OBJECTIVE. \r");
    gameLocal.Printf("NEW OBJECTIVE\n");

    idPlayer* player = gameLocal.GetLocalPlayer();
    if (player == NULL) return;

    player->StartSound("snd_new_objective", SND_CHANNEL_ANY, 0, false, NULL);

    // greebo: notify the player
    player->SendHUDMessage( "#str_02455" ); // "New Objective"

    player->UpdateObjectivesGUI();
}

Maybe string 02453 can be changed temporarily. Otherwise those functions would need to be modified to check some new variable, which is rather late in the 2.10 cycle.

  • Thanks 1
Posted

Something to add to the wishlist for 2.11 perhaps.

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                The Wizard's Treasure                             A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

  • 3 months later...
Posted

Oi. I couldn't find a bugtracker entry for this, so I created one (#5967) and was so free to provide a solution (revision 9925).

 

I have added a script function on the player that allows to turn the notifications on and off. The function has no return value.

//turn the notification (sound + text) off, using a nonzero value turns them on again
$player1.setObjectiveNotification(0);

This works for "objective completed", "objective failed" and "new objective". Hope that's what you are looking for.

  • Like 2
  • Thanks 1

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

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

    • JackFarmer

      "The Year of the Rat." 
      😄

      Al Stewart must be proud of you!
      Happy testing!
      @MirceaKitsune
      · 1 reply
    • datiswous

      I posted about it before, but I think the default tdm logo video looks outdated. For a (i.m.o.) better looking version, you can download the pk4 attached to this post and plonk it in your tdm root folder. Every mission that starts with the tdm logo then starts with the better looking one. Try for example mission COS1 Pearls and Swine.
      tdm_logo_video.pk4
      · 2 replies
    • JackFarmer

      Kill the bots! (see the "Who is online" bar)
      · 3 replies
    • STiFU

      I finished DOOM - The Dark Ages the other day. It is a decent shooter, but not as great as its predecessors, especially because of the soundtrack.
      · 5 replies
    • JackFarmer

      What do you know about a 40 degree day?
      @demagogue
      · 4 replies
×
×
  • Create New...