titles.txt Last edited 2 years ago2022-03-20 17:39:18 UTC

titles.txt is a text file used to define preset text messages that can be displayed to the player. These messages are displayed using an env_message entity.

Because this file is a generic file placed in the mod folder (e.g. half-life/valve), editing this file is discouraged unless you are using it in a custom mod. Otherwise, if you were to distribute this file with your maps, players would need to replace their existing titles.txt, which they may be unwilling to do if they have edited that file themselves. If you want to show text messages to the player outside of a custom mod, you should use a game_text entity.

Usage

Parameters

The file uses a set of parameters that, once defined, will be active upon all the messages listed afterwards until they are redefined. These parameters are:

Messages

The messages themselves are defined in a simple layout. The layout should be as follows:
Message_Name
{
Message contents, that can span
multiple lines if necessary.
Messages with multiple lines will use
centered formatting.
}

Example

Here is a sample section of a titles.txt file as an example.
$position -1 0.7
$effect 2
$color 100 100 100
$color2 240 110 0
$fadein 0.5
$fxtime 0.1
$holdtime 2
$fadeout 2

Test_Message
{
What a mess.
}

$position -1 0.8
$effect 1

Test_Message_2
{
Who'll clean this up?
Not me.
}
Test_Message will be a typewriter-style message, appearing near the bottom-middle of the screen. The letters will appear as orange for a split second before before changing to a basic grey text. The letters will appear fairly slowly.
Test_Message_2 will appear slightly lower than Test_Message did, and will use the flickery effect rather than the typewriter-style.

Notes

2 Comments

Commented 5 months ago2024-06-29 07:36:26 UTC Comment #106222
Has anyone ever get their non-english titles.txt to work properly?

I tested the Korean version. Its titles.txt comes in UTF16LE encoding, but it looks like the engine fails to parse this encoding, so all env_messages just displays their message names instead of the message's contents. And of course it all uses default values for the $ settings.
Commented 1 week ago2024-12-14 11:52:42 UTC Comment #106558
Has anyone ever get their non-english titles.txt to work properly?
Non-english work on ANSI

You must log in to post a comment. You can login or register a new account.