Frictional Games Forum (read-only)
Messages on the screen? - 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: Messages on the screen? (/thread-12466.html)



Messages on the screen? - rallelol - 01-08-2012

Hello, i'm working on a new customstory (already) Smile

For those who missed my first one it's right here: http://www.frictionalgames.com/forum/thread-12429-post-110091.html#pid110091

Anyway, how do you make a message appear on the screen when you touch a door or step into an area or something?

Example: When you touch a door and it's locked, i want a message on the screen like: Why is the door locked.

Thank you for helping! Smile



RE: Messages on the screen? - Statyk - 01-08-2012

Go to the locked door in the LevelEditor and go into its "Entity" tab. Find "PlayerInteractCallback" and fill in the entry box with "lockeddoor1". Then fill this in in the .hps anywhere but OnStart, OnEnter, or OnLeave:

void lockeddoor1(string &in asEntity)
{
SetMessage("ScreenMessages", "door1", 3);
}


Then go into the .lang and put this somewhere:

<CATEGORY Name="ScreenMessages">
<Entry Name="door1">Why is the door locked?</Entry>
</CATEGORY>


RE: Messages on the screen? - rallelol - 01-08-2012

(01-08-2012, 06:03 PM)Statyk Wrote: Go to the locked door in the LevelEditor and go into its "Entity" tab. Find "PlayerInteractCallback" and fill in the entry box with "lockeddoor1". Then fill this in in the .hps anywhere but OnStart, OnEnter, or OnLeave:

void lockeddoor1(string &in asEntity)
{
SetMessage("ScreenMessages", "door1", 3);
}


Then go into the .lang and put this somewhere:

<CATEGORY Name="ScreenMessages">
<Entry Name="door1">Why is the door locked?</Entry>
</CATEGORY>
Thank You very much!





RE: Messages on the screen? - Statyk - 01-08-2012

Also, If you only want it to come up once, make sure "PlayerInteractCallbackAutoRemove" is CHECKED on the door's Entity tab. This will only allow the function to run once.