Jump to content
The Dark Mod Forums

"Silently" Add a New Objective Or Make One Visible


Wellingtoncrab

Recommended Posts

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 =

Link to comment
Share on other sites

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

                                                                                                  A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Link to comment
Share on other sites

  • 3 months later...

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

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

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 0 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...