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

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • 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
×
×
  • Create New...