Frictional Games Forum

Full Version: Text on locked Swing-Door [Solved]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey i'm new on this platform but i'm despairing, because a problem i have with my custom story.

I want to show text, when i'm trying to open a locked mansionbase door (not a leveldoor). I followed these instructions (http://wiki.frictionalgames.com/hpl2/tut...ked_doors) and i used the same prefixes as in the tutorial but it doesnt work. After i asked some guys, who can script really good they dont know how to solve it. Here is our currently progress.

extra_english.lang file; Just pay attention on the ///Message/// category, the rest is working fine:

<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">You are returning from your education and you are looking forward to have a cozy evening with your family.[br][br]But wait...[br][br][br]You get a strange feeling as you behold the estate of your family.</Entry>
</CATEGORY>


//////////////////////JOURNAL//////////////////////

<CATEGORY Name="Journal">
<Entry Name="Note_NoteTraum1_Name">Enter Text here.</Entry>
<Entry Name="Note_NoteTraum1_Text">Your now reading the test text.</Entry>
</CATEGORY>


//////////////////////INVENTORY//////////////////////

<CATEGORY Name="Inventory">
<Entry Name="ItemName_KeyDesc">Desk-Key</Entry>
<Entry Name="ItemDesc_KeyDesc">It's for unlocking the desk door.</Entry>
</CATEGORY>


//////////////////////DEATHHINT//////////////////////

<CATEGORY Name="DeathHint">
<Entry Name="Entry1">You have to carry on...</Entry>
</CATEGORY>


//////////////////////MESSAGES//////////////////////

<CATEGORY Name=“Messages”>
<Entry Name =“msgname”>It's dark outside. I should take my lantern.</Entry>
</CATEGORY>
</LANGUAGE>



map.hps; just the script for the message:

//Text on locked door
void DoorLockedPlayer(string &in entity)


{
if(GetSwingDoorLocked(entity) == true)
{

SetMessage("Messages", "msgname", 3);

}
}


//we also tried this but it wont work too

//Text on locked door
void DoorLockedPlayer(string &in entity)


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

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

}
}


The Door Name in the mapeditor is "EXAMPLE_DOOR" and the PlayerInteractCallback is "DoorLockedPlayer"

Hope anyone can help me, thanks Smile
(04-20-2014, 06:08 PM)ShipinShen Wrote: [ -> ]Hey i'm new on this platform but i'm despairing, because a problem i have with my custom story.

I want to show text, when i'm trying to open a locked mansionbase door (not a leveldoor). I followed these instructions (http://wiki.frictionalgames.com/hpl2/tut...ked_doors) and i used the same prefixes as in the tutorial but it doesnt work. After i asked some guys, who can script really good they dont know how to solve it. Here is our currently progress.

extra_english.lang file; Just pay attention on the ///Message/// category, the rest is working fine:

<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">You are returning from your education and you are looking forward to have a cozy evening with your family.[br][br]But wait...[br][br][br]You get a strange feeling as you behold the estate of your family.</Entry>
</CATEGORY>


//////////////////////JOURNAL//////////////////////

<CATEGORY Name="Journal">
<Entry Name="Note_NoteTraum1_Name">Enter Text here.</Entry>
<Entry Name="Note_NoteTraum1_Text">Your now reading the test text.</Entry>
</CATEGORY>


//////////////////////INVENTORY//////////////////////

<CATEGORY Name="Inventory">
<Entry Name="ItemName_KeyDesc">Desk-Key</Entry>
<Entry Name="ItemDesc_KeyDesc">It's for unlocking the desk door.</Entry>
</CATEGORY>


//////////////////////DEATHHINT//////////////////////

<CATEGORY Name="DeathHint">
<Entry Name="Entry1">You have to carry on...</Entry>
</CATEGORY>


//////////////////////MESSAGES//////////////////////

<CATEGORY Name=“Messages”>
<Entry Name =“msgname”>It's dark outside. I should take my lantern.</Entry>
</CATEGORY>
</LANGUAGE>



map.hps; just the script for the message:

//Text on locked door
void DoorLockedPlayer(string &in entity)


{
if(GetSwingDoorLocked(entity) == true)
{

SetMessage("Messages", "msgname", 3);

}
}


//we also tried this but it wont work too

//Text on locked door
void DoorLockedPlayer(string &in entity)


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

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

}
}


The Door Name in the mapeditor is "EXAMPLE_DOOR" and the PlayerInteractCallback is "DoorLockedPlayer"

Hope anyone can help me, thanks Smile

Hey I don't know if it's just me but in your .lang file the category messages quotes look inverted, try deleting them and putting correct quotes in Smile
in your lang file you have a space between Name and the = sign, which isn't supposed to be their
(04-20-2014, 06:20 PM)Wafflychicken Wrote: [ -> ]
(04-20-2014, 06:08 PM)ShipinShen Wrote: [ -> ]Hey i'm new on this platform but i'm despairing, because a problem i have with my custom story.

I want to show text, when i'm trying to open a locked mansionbase door (not a leveldoor). I followed these instructions (http://wiki.frictionalgames.com/hpl2/tut...ked_doors) and i used the same prefixes as in the tutorial but it doesnt work. After i asked some guys, who can script really good they dont know how to solve it. Here is our currently progress.

extra_english.lang file; Just pay attention on the ///Message/// category, the rest is working fine:

<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">You are returning from your education and you are looking forward to have a cozy evening with your family.[br][br]But wait...[br][br][br]You get a strange feeling as you behold the estate of your family.</Entry>
</CATEGORY>


//////////////////////JOURNAL//////////////////////

<CATEGORY Name="Journal">
<Entry Name="Note_NoteTraum1_Name">Enter Text here.</Entry>
<Entry Name="Note_NoteTraum1_Text">Your now reading the test text.</Entry>
</CATEGORY>


//////////////////////INVENTORY//////////////////////

<CATEGORY Name="Inventory">
<Entry Name="ItemName_KeyDesc">Desk-Key</Entry>
<Entry Name="ItemDesc_KeyDesc">It's for unlocking the desk door.</Entry>
</CATEGORY>


//////////////////////DEATHHINT//////////////////////

<CATEGORY Name="DeathHint">
<Entry Name="Entry1">You have to carry on...</Entry>
</CATEGORY>


//////////////////////MESSAGES//////////////////////

<CATEGORY Name=“Messages”>
<Entry Name =“msgname”>It's dark outside. I should take my lantern.</Entry>
</CATEGORY>
</LANGUAGE>



map.hps; just the script for the message:

//Text on locked door
void DoorLockedPlayer(string &in entity)


{
if(GetSwingDoorLocked(entity) == true)
{

SetMessage("Messages", "msgname", 3);

}
}


//we also tried this but it wont work too

//Text on locked door
void DoorLockedPlayer(string &in entity)


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

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

}
}


The Door Name in the mapeditor is "EXAMPLE_DOOR" and the PlayerInteractCallback is "DoorLockedPlayer"

Hope anyone can help me, thanks Smile

Hey I don't know if it's just me but in your .lang file the category messages quotes look inverted, try deleting them and putting correct quotes in Smile

There we GO !!!!! Thanks so much, i was trying to solve this problem for hours. Thanks man <3 !!

(04-20-2014, 06:23 PM)Lizard Wrote: [ -> ]in your lang file you have a space between Name and the = sign, which isn't supposed to be their

That's right, thanks, but the main problem was the quotes, they was inverted, because i copy&pasted it from the tutorial Smile
(04-20-2014, 06:29 PM)ShipinShen Wrote: [ -> ]
(04-20-2014, 06:20 PM)Wafflychicken Wrote: [ -> ]
(04-20-2014, 06:08 PM)ShipinShen Wrote: [ -> ]Hey i'm new on this platform but i'm despairing, because a problem i have with my custom story.

I want to show text, when i'm trying to open a locked mansionbase door (not a leveldoor). I followed these instructions (http://wiki.frictionalgames.com/hpl2/tut...ked_doors) and i used the same prefixes as in the tutorial but it doesnt work. After i asked some guys, who can script really good they dont know how to solve it. Here is our currently progress.

extra_english.lang file; Just pay attention on the ///Message/// category, the rest is working fine:

<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">You are returning from your education and you are looking forward to have a cozy evening with your family.[br][br]But wait...[br][br][br]You get a strange feeling as you behold the estate of your family.</Entry>
</CATEGORY>


//////////////////////JOURNAL//////////////////////

<CATEGORY Name="Journal">
<Entry Name="Note_NoteTraum1_Name">Enter Text here.</Entry>
<Entry Name="Note_NoteTraum1_Text">Your now reading the test text.</Entry>
</CATEGORY>


//////////////////////INVENTORY//////////////////////

<CATEGORY Name="Inventory">
<Entry Name="ItemName_KeyDesc">Desk-Key</Entry>
<Entry Name="ItemDesc_KeyDesc">It's for unlocking the desk door.</Entry>
</CATEGORY>


//////////////////////DEATHHINT//////////////////////

<CATEGORY Name="DeathHint">
<Entry Name="Entry1">You have to carry on...</Entry>
</CATEGORY>


//////////////////////MESSAGES//////////////////////

<CATEGORY Name=“Messages”>
<Entry Name =“msgname”>It's dark outside. I should take my lantern.</Entry>
</CATEGORY>
</LANGUAGE>



map.hps; just the script for the message:

//Text on locked door
void DoorLockedPlayer(string &in entity)


{
if(GetSwingDoorLocked(entity) == true)
{

SetMessage("Messages", "msgname", 3);

}
}


//we also tried this but it wont work too

//Text on locked door
void DoorLockedPlayer(string &in entity)


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

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

}
}


The Door Name in the mapeditor is "EXAMPLE_DOOR" and the PlayerInteractCallback is "DoorLockedPlayer"

Hope anyone can help me, thanks Smile

Hey I don't know if it's just me but in your .lang file the category messages quotes look inverted, try deleting them and putting correct quotes in Smile

There we GO !!!!! Thanks so much, i was trying to solve this problem for hours. Thanks man <3 !!

(04-20-2014, 06:23 PM)Lizard Wrote: [ -> ]in your lang file you have a space between Name and the = sign, which isn't supposed to be their

That's right, thanks, but the main problem was the quotes, they was inverted, because i copy&pasted it from the tutorial Smile

Haha the same thing happened to me spending hours on it then realising it was the brackets, just remember if there is an error within the custom story and no error message is being shown its most likely because there is a problem in the Lang file as it doesn't show errors even if there are -_-
(04-20-2014, 06:23 PM)Lizard Wrote: [ -> ]in your lang file you have a space between Name and the = sign, which isn't supposed to be their

That actually doesn't make anything wrong. You can even do that with the HPS. We just do that because it looked more neater.