Jump to content

Mission objective text ingame [solved]


Recommended Posts

I am looking for a way to let text appear during a mission like here (from GDI Mission 9):


I went through the code and couldn't find anything related.
I did find the sound that is played when that message appears. It's "TDR_SFC_BLEEP2.WAV" in the "SFX3D.MEG".
It is found twice in "AUDIO.CPP" but not referenced anywhere to be played.

Any input would be nice ^^

Edited by yuri624
Solved, solution included.
  • Upvote 1
Link to comment
Share on other sites

While searching for something else (new thread) I randomly stumbled across exactly what I was looking for:

extern void On_Message(const char* message, float timeout_seconds, long long message_id);

First the function needs to be declared in whatever file you are going to use it.

int text_id = TXT_NONE;
char const * text = "1. Find a way to sabotage GDI's power.\n2. Gain access to the old Soviet helipads.\n3. Overwhelm GDI and re-capture our radar station.";
if (text != NULL) { On_Message(text, 35.0f, text_id); }

Above code will output exactly what's shown in the screenshot.
The border will be green regardless of playing GDI or NOD. Best results are with text_id = TXT_NONE. As seen, \n produces a new line for multi-line messages. This message will stay 35 seconds.

posted image

  • Upvote 1
Link to comment
Share on other sites

  • yuri624 changed the title to Mission objective text ingame [solved]

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...