Frictional Games Forum (read-only)

Full Version: Show message when interacting with a door?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Try:

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


void showdoortext1(string &in asEntity)
{
    if(GetSwingDoorLocked("wifesroom") == true)
    {
        SetMessage("Message", "doortext1", 0);
    }
}
Still doesn't work.


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





void showdoortext1(string &in asEntity)

{
if(GetSwingDoorLocked("wifesroom")== true)
{
SetMessage("Message", "doortext1", 0);
}
}
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/tut...cked_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.
Ok, I changed the .lang file and got rid of the SetEntityPlayerInteractCallback, still no luck.
I followed the tutorial you gave me, no luck.
(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/tut...cked_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>
I changed it to </LANGUAGE>, does nothing.
(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.
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?
<Entry Name="Description"> descriptionhere

</Entry>



Try to:


<Entry Name="Description">Description Here</Entry>
Nope. Nothing.
Pages: 1 2 3