Frictional Games Forum (read-only)

Full Version: Message on locked doors
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello!
What should I do, when I want to show to player a message, like "The door is closed. I must find a key", when he tries to open a locked door? I tried to solve this problem by these tips, but the message does not show up.

http://wiki.frictionalgames.com/hpl2/tut...cked_doors

Examples of a scripts are welcome Big Grin
Do you have a .lang file? A separate file from .hps files.
It should be beside the custom_story_settings.cfg file
Yes, I have. I did everything step by step, as it is in the tutorial, but it doesn't works. I have no idea where it could be a mistake...
Show us your script and .lang file Smile
Script:

void Messagedoor(string &in entity)


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

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

}
}

.lang file:

<CATEGORY Name="Messages">
<Entry Name =“zamkniete”>To glowne drzwi do sierocinca. Sa zamkniete. Musze znalezc inne wyjscie.</Entry>
</CATEGORY>
And where did you place this: "Messagedoor"
In the level editor, or in the script file?
In the lever editor ("PlayerEntityCallback" in this door where message should be).
And in script file (Here's all script. I used bold to show the script message)

////////////////////////////
// Run when starting map
void OnStart()
{
AddUseItemCallback("", "basementkey_1", "basement_1", "KeyOnDoor", true);
AddUseItemCallback("", "corridorkey", "corridor_1", "KeyOnDoor_2", true);
AddEntityCollideCallback("Player", "tp_1", "DeadOne", true, 1);
AddEntityCollideCallback("Player", "tp_2", "ColinBody", true, 1);
SetEntityCallbackFunc("corridorkey", "OnPickup");
AddEntityCollideCallback("stevie_1", "fade_1", "fade1", true, 1);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("basement_1", false, true);
PlaySoundAtEntity("", "unlock_door", "basement_1", 0, false);
}




void DeadOne(string &in asParent, string &in asChild, int alStates)
{
SetEntityActive("GhostOne", true);
AddPropForce("GhostOne", 0, 0, -100000, "world");
PlaySoundAtEntity("", "24_iron_maiden.snt", "GhostOne", 0, false);
}




void ColinBody(string&in asParent, string &in asChild, int alStates)
{
SetEntityActive("ColinBody", true);
AddPropForce("ColinBody", 0, 0, 0, "world");
PlaySoundAtEntity("", "24_burn.snt", "ColinBody", 0, false);
}




void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("stevie_1", true);
AddEnemyPatrolNode("stevie_1", "PathNodeArea_1", 0.1, "");
AddEnemyPatrolNode("stevie_1", "PathNodeArea_2", 0.1, "");
AddEnemyPatrolNode("stevie_1", "PathNodeArea_3", 0.1, "");
AddEnemyPatrolNode("stevie_1", "PathNodeArea_4", 0.1, "");
AddEnemyPatrolNode("stevie_1", "PathNodeArea_5", 0.1, "");
}




void fade1(string &in asParent, string &in asChild, int alState)
{
FadeEnemyToSmoke("stevie_1", true);
}




void KeyOnDoor_2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("corridor_1", false, true);
PlaySoundAtEntity("", "unlock_door", "corridor_1", 0, false);
}



void Messagedoor(string &in entity)


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

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

}
}
Looks fine. Check if names are correct. Capitals and such are very important.

Does you .lang file work? Does any other text show up?
I checked the names, brackets and capitals many times. Everything fits, and the messages still do not see. Yes, everything else in .lang file show up.
Oh, yes the syntax.
You wrote: (string &in entity)
When it should be: (string &in asEntity)
Pages: 1 2