Frictional Games Forum (read-only)

Full Version: Locked Door Message not Working, Help Needed. (Awarding Virtual Cookie)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Hello,

In my extra_english.lang file, I already have a code for a message on one of my notes to appear. It works perfectly fine and there is no problem with that whatsoever.

However.

I am trying to make a message appear to the player when they try to open a locked door, this guide told me the following:

First of all, open up your extra_english.lang file, and add this:

TYPE MESSAGE HERE




I followed those instructions perfectly, editing the certain sections to put my own messages in etc. I also followed the instructions he told me for the mapname.hps file.
When I edited the extra_english.lang, I put the new code underneath of the first one. When I went in the game, now neither of the codes worked, the message didn't appear and the note was blank. Was me putting this code in the same file as the note code causing this problem?


Anyone know what's going on?


Thank you
Hm... your file seems to be lacking in some parts. Here's how it should be written.

<LANGUAGE>
<CATEGORY Name="Messages">
<Entry Name="lockeddoor1">This door is locked.
</CATEGORY>
</LANGUAGE>

You also need the appropriate coding. For instance, let's presume that the name of a door is "mansion_1", and you want it to display the callback. You'll need to type this.

void OnStart()
{
SetEntityPlayerInteractCallback("mansion_1", "DoorLockedMsg", true);
}

void DoorLockedMsg(string &in entity)
{
SetMessage("Messages", "lockeddoor1", 0);
}

It helps if you can explain the coding like it would be in a conversation. What this code says is that when the map starts, it will add a callback for interacting with the door named "mansion_1". That callback asks the category "Messages" in the file "extra_english.lang", to display the entry "lockeddoor1" for a predetermined amount of time.

This should work. Also, if the coding is correct, check for typos in your extra_english.lang file. I often forget to put quotes or the </Entry> after I finish an entry.

Hope this helps.
Also Those quotes aren't any good Just use " and " instead of
“ and ”
I used your technique Zaffre, it didn't seem to work for me, I tried some others they didn't work either.

This is what I have in my extra_english.lang file:






<LANGUAGE>
<CATEGORY Name=“Messages”>
<Entry Name =“lockeddoor1”>The door is locked from the outside, maybe there's another way out of here.</Entry>
</CATEGORY>
</LANGUAGE>




This is what I have in the hps file:


void DoorLockedPlayer(string &in entity)


{
if(GetSwingDoorLocked("WAITING_ROOM_JONATHAN") == true)
{

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

}
}


I also set the name of the door and etc in the level editor

Do you happen to see the problem?
(09-03-2012, 02:26 AM)Frodos Wrote: [ -> ]I used your technique Zaffre, it didn't seem to work for me, I tried some others they didn't work either.

This is what I have in my extra_english.lang file:






<LANGUAGE>
<CATEGORY Name=“Messages”>
<Entry Name =“lockeddoor1”>The door is locked from the outside, maybe there's another way out of here.</Entry>
</CATEGORY>
</LANGUAGE>




This is what I have in the hps file:


void DoorLockedPlayer(string &in entity)


{
if(GetSwingDoorLocked("WAITING_ROOM_JONATHAN") == true)
{

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

}
}


I also set the name of the door and etc in the level editor

Do you happen to see the problem?
Yes. In the entry name, you have a space between the word "name" and the quotations. It should be like this. Also, I've bolded the part with the error.

<LANGUAGE>
<CATEGORY Name=“Messages”>
<Entry Name=“lockeddoor1”>The door is locked from the outside, maybe there's another way out of here.</Entry>
</CATEGORY>
</LANGUAGE>
Don't skip over post three.
I've done everything you guys have suggested, I fixed all the quotations and I fixed the Entry Name section, although it still does not work.

extra_english.lang:


<LANGUAGE>
<CATEGORY Name="Messages">
<Entry Name="lockeddoor">The door is locked from the outside, maybe there is another way out of here.</Entry>
</CATEGORY>
</LANGUAGE>

hps file:



void DoorLockedPlayer(string &in entity)


{
if(GetSwingDoorLocked("roomone") == true)
{

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

}
}


Also note that in the hps file, that is ALL I have. That's the only thing in the hps file, nothing else, is there something else that should be in there? Is that my problem?
Yes, the .hps file is botched. I could explain it but I have a bad headache and I need to get some sleep. If it isn't resolved by tomorrow, I'll try and help you.
(09-03-2012, 04:22 AM)Zaffre Wrote: [ -> ]Yes, the .hps file is botched. I could explain it but I have a bad headache and I need to get some sleep. If it isn't resolved by tomorrow, I'll try and help you.
Okay, that's no problem, sounds good, I can wait a day, especially after all the help you've given me!

(you too YouComputer and Harthex!)

Though, if anyone is still here and willing to help, I should be online for 1 - 2 more hours.
make sure you have the hps and the map file in a folder in the custom story folder named "maps" or whatever your custom story settings have it set to.
Pages: 1 2 3