Frictional Games Forum (read-only)
Message on locked doors - 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: Message on locked doors (/thread-19304.html)

Pages: 1 2


Message on locked doors - giacomo9 - 11-21-2012

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/tutorials/script/adding_messages_to_locked_doors

Examples of a scripts are welcome Big Grin


RE: Message on locked doors - FlawlessHappiness - 11-21-2012

Do you have a .lang file? A separate file from .hps files.
It should be beside the custom_story_settings.cfg file


RE: Message on locked doors - giacomo9 - 11-21-2012

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...


RE: Message on locked doors - FlawlessHappiness - 11-21-2012

Show us your script and .lang file Smile


RE: Message on locked doors - giacomo9 - 11-21-2012

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>


RE: Message on locked doors - FlawlessHappiness - 11-21-2012

And where did you place this: "Messagedoor"
In the level editor, or in the script file?


RE: Message on locked doors - giacomo9 - 11-21-2012

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);

}
}



RE: Message on locked doors - FlawlessHappiness - 11-21-2012

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

Does you .lang file work? Does any other text show up?


RE: Message on locked doors - giacomo9 - 11-21-2012

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.


RE: Message on locked doors - FlawlessHappiness - 11-21-2012

Oh, yes the syntax.
You wrote: (string &in entity)
When it should be: (string &in asEntity)