Jump to content
The Dark Mod Forums

"Silently" Add a New Objective Or Make One Visible


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
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.

{ 0 | 🞵 } = funk_tastic

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                                                                                  A House Call

                              

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.

 Share

  • Recent Status Updates

    • STiFU

      Anyone here clocking in some times in Neon Light?
      · 0 replies
    • JackFarmer

      Boris Johnson's resignation does not change the fact that Australia is home to 29 million kangaroos and Wales has a population of just over three million.

      If the Australian kangaroos were to invade Wales, one resident would have to fight almost ten kangaroos at a time.
      · 8 replies
    • peter_spy

      Deathloop – what a mess of a game. I'd love to see a post-mortem on it some day. I hope Arkane is doing okay though.
      · 27 replies
    • OrbWeaver

      I like house-cleaning and taking out the trash.
      · 3 replies
    • STiFU

      Be honest: Who of you have actually finished Cuphead? This game is freaking tough! It might even be harder than Sekiro. Dark Souls is a joke in comparison to Cuphead! :-D 
      · 8 replies
×
×
  • Create New...