Frictional Games Forum (read-only)
Show message when interacting with a door? - 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: Show message when interacting with a door? (/thread-18557.html)

Pages: 1 2 3


RE: Show message when interacting with a door? - Statyk - 09-29-2012

Try:

Code:
void OnStart()
{
    SetEntityPlayerInteractCallback("wifesroom", "showdoortext1", true);
}


void showdoortext1(string &in asEntity)
{
    if(GetSwingDoorLocked("wifesroom") == true)
    {
        SetMessage("Message", "doortext1", 0);
    }
}



RE: Show message when interacting with a door? - srobb - 09-30-2012

Still doesn't work.


SetEntityPlayerInteractCallback("wifesroom", "showdoortext1", true);





void showdoortext1(string &in asEntity)

{
if(GetSwingDoorLocked("wifesroom")== true)
{
SetMessage("Message", "doortext1", 0);
}
}


RE: Show message when interacting with a door? - The chaser - 09-30-2012

Hmm... as same as "journal" it could be possible that you had to put just "messages". So, this tutorial is a very good one to add messages to a locked door. Wink

http://wiki.frictionalgames.com/hpl2/tutorials/script/adding_messages_to_locked_doors

And the .lang file should be like this:

<LANGUAGE>

<CATEGORY Name="CustomStoryMain">

<Entry Name="Description"> descriptionhere

</Entry>

</CATEGORY>



<CATEGORY Name="Levels">



<Entry Name="level_hub_1">...</Entry>



</CATEGORY>



<CATEGORY Name="Messages">

<Entry Name="doortext1">Hmm... My wife's room... I wonder why it's locked.</Entry>

</CATEGORY>

<LANGUAGE>

And your .hps like this:

void showdoortext1(string &in asEntity)



{

if(GetSwingDoorLocked("wifesroom")== true)

{

SetMessage("Messages", "doortext1", 0);

}

}


You don't actually need the SetEntityPlayerInteractCallback.
Also, when the .lang file doesn't work, you can see it even before playing the story. If the description doesn't appear, that means to be that your .lang file is wrong. A single error and all will be gone.


RE: Show message when interacting with a door? - srobb - 09-30-2012

Ok, I changed the .lang file and got rid of the SetEntityPlayerInteractCallback, still no luck.
I followed the tutorial you gave me, no luck.


RE: Show message when interacting with a door? - Steve - 09-30-2012

(09-30-2012, 01:00 PM)The chaser Wrote: Hmm... as same as "journal" it could be possible that you had to put just "messages". So, this tutorial is a very good one to add messages to a locked door. Wink

http://wiki.frictionalgames.com/hpl2/tutorials/script/adding_messages_to_locked_doors

And the .lang file should be like this:

<LANGUAGE>

<CATEGORY Name="CustomStoryMain">

<Entry Name="Description"> descriptionhere

</Entry>

</CATEGORY>



<CATEGORY Name="Levels">



<Entry Name="level_hub_1">...</Entry>



</CATEGORY>



<CATEGORY Name="Messages">

<Entry Name="doortext1">Hmm... My wife's room... I wonder why it's locked.</Entry>

</CATEGORY>

<LANGUAGE>

And your .hps like this:

void showdoortext1(string &in asEntity)



{

if(GetSwingDoorLocked("wifesroom")== true)

{

SetMessage("Messages", "doortext1", 0);

}

}


You don't actually need the SetEntityPlayerInteractCallback.
Also, when the .lang file doesn't work, you can see it even before playing the story. If the description doesn't appear, that means to be that your .lang file is wrong. A single error and all will be gone.
Angel
</LANGUAGE>

you forgot this you have double

<LANGUAGE>


RE: Show message when interacting with a door? - srobb - 09-30-2012

I changed it to </LANGUAGE>, does nothing.


RE: Show message when interacting with a door? - Robby - 09-30-2012

(09-30-2012, 01:55 PM)srobb Wrote: I changed it to , does nothing.
It may seem stupid, but try restarting Amnesia.

Also, post your lang. file again. Use "code" tags for that.

And in the Level Editor, select the door, click its "entity" tab, go to "PlayerInteractCallback", write the name of the function you used in the script file.


RE: Show message when interacting with a door? - srobb - 09-30-2012

I tried restarting Amnesia, no luck.

<LANGUAGE>

<CATEGORY Name="CustomStoryMain">

<Entry Name="Description"> descriptionhere

</Entry>

</CATEGORY>


<CATEGORY Name="Levels">


<Entry Name="level_hub_1">...</Entry>


</CATEGORY>


</CATEGORY>

<CATEGORY Name="Messages">

<Entry Name="wifesroomtext1">Hmm... My wife's room... I wonder why it's locked.</Entry>

</CATEGORY>

</LANGUAGE>


In the PlayerInteractCallback bar, I wrote "wifesroom". Is this right?


RE: Show message when interacting with a door? - Robby - 09-30-2012

<Entry Name="Description"> descriptionhere

</Entry>



Try to:


<Entry Name="Description">Description Here</Entry>


RE: Show message when interacting with a door? - srobb - 09-30-2012

Nope. Nothing.