There are two methods:
1) Checkpoints:
CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);
2) SetDeathHint
SetDeathHint(string& asTextCategory, string& asTextEntry);
According to the
script functions wiki page both of these do the trick. The parameters you want in both cases the one referencing a "Category" and an "Entry" - these correspond to your language file. Note that you will need to add an entry to your language file containing the message - the category and entry parameters specify which entry of to show. For more information on language files see
here.
There are also some video tutorials here:
http://wiki.frictionalgames.com/hpl2/tut...omakenotes
Whilst these show notes and journal entries the same principle applies - You make your category and entry, but this time you are just referencing the entries through script to set the death hint.
Edit:
Quick example.
Language file:
<LANGUAGE>
<CATEGORY Name="DeadMessages">
<Entry Name="DiedInWater">Don't get eaten by splashy!</Entry>
</CATEGORY>
</LANGUAGE>
Using both of the above approaches (you only need to use 1):
void xyzHappens()
{
//Do this BEFORE the player could die when you want to show the hint (use areas or something)
CheckPoint ("RandomCheckpoint","PlayerStartArea_1","","DeadMessages","DiedInWater");
SetDeathHint("DeadMessages","DiedInWater");
}