Frictional Games Forum (read-only)
death message - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: death message (/thread-10173.html)



death message - good871 - 09-05-2011

Hi , how to edit message after player die.

Blush



RE: death message - Apjjm - 09-05-2011

There are two methods:

1) Checkpoints:
Code:
CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);

2) SetDeathHint
Code:
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/tutorials/script/howtomakenotes

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:
Code:
<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):
Code:
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");
}



RE: death message - good871 - 09-05-2011

thank you, i'm going try this.