Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Message on locked doors
giacomo9 Offline
Junior Member

Posts: 37
Threads: 11
Joined: Nov 2012
Reputation: 0
#1
Message on locked doors

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
11-21-2012, 06:44 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
RE: Message on locked doors

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

Trying is the first step to success.
(This post was last modified: 11-21-2012, 07:04 PM by FlawlessHappiness.)
11-21-2012, 07:03 PM
Find
giacomo9 Offline
Junior Member

Posts: 37
Threads: 11
Joined: Nov 2012
Reputation: 0
#3
RE: Message on locked doors

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...
11-21-2012, 07:07 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#4
RE: Message on locked doors

Show us your script and .lang file Smile

Trying is the first step to success.
(This post was last modified: 11-21-2012, 07:22 PM by FlawlessHappiness.)
11-21-2012, 07:21 PM
Find
giacomo9 Offline
Junior Member

Posts: 37
Threads: 11
Joined: Nov 2012
Reputation: 0
#5
RE: Message on locked doors

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>
11-21-2012, 07:40 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#6
RE: Message on locked doors

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

Trying is the first step to success.
(This post was last modified: 11-21-2012, 07:52 PM by FlawlessHappiness.)
11-21-2012, 07:52 PM
Find
giacomo9 Offline
Junior Member

Posts: 37
Threads: 11
Joined: Nov 2012
Reputation: 0
#7
RE: Message on locked doors

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

}
}
11-21-2012, 08:10 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#8
RE: Message on locked doors

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

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

Trying is the first step to success.
11-21-2012, 08:34 PM
Find
giacomo9 Offline
Junior Member

Posts: 37
Threads: 11
Joined: Nov 2012
Reputation: 0
#9
RE: Message on locked doors

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.
11-21-2012, 08:49 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#10
RE: Message on locked doors

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

Trying is the first step to success.
11-21-2012, 08:52 PM
Find




Users browsing this thread: 5 Guest(s)