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
Show message when you try to open a locked door?
cheztheguy Offline
Junior Member

Posts: 12
Threads: 7
Joined: Jun 2011
Reputation: 0
#1
Show message when you try to open a locked door?

Hi, I'm working on my map again and I'm trying to make a message show on the screen when the player tries to open a door and it is locked.

Here's my whole script...
Spoiler below!

void OnStart()
{
GiveSanityDamage(25.0f, true);
AddEntityCollideCallback("Player", "False", "FalseChase", true, 0);
SetPlayerLampOil(0.0f);
}

void FalseChase(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
GiveSanityDamage(25.0f, true);
StartEffectFlash(1.0f, 1.0f, 1.0f);
AddTimer("FalseChaseTimer", 1.0f, "FalseChaseTimed");
}

void FalseChaseTimed(string &in asTimer)
{
SetPlayerActive(true);
SetEntityActive("servant_grunt_1", true);
StartPlayerLookAt("servant_grunt_1", 7, 50, "");
SetEnemyIsHallucination("servant_grunt_1", true);
ShowEnemyPlayerPosition("servant_grunt_1");
AddTimer("FalseChaseEnd", 0.5f, "StopLookAtEnemy");
}

void StopLookAtEnemy(string &in asTimer)
{
StopPlayerLookAt();
}

void InteractClosedDoor(string &in asEntity)
{
AddTimer("Door", 0.5f, "DoorLockedMessage");
}

void DoorLockedMessage(string &in asTimer)
{
SetMessage("LockedDoor-Brute", "BruteDoorLocked", 7.0f);
}



Here is my whole extra_english.lang file...

Spoiler below!

<LANGUAGE>
<RESOURCES>
</RESOURCES>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">Good luck.</Entry>
</CATEGORY>
<CATEGORY Name="Inventory">
<Entry Name="ItemName_DungeonKeyOne">DungeonKey</Entry>
<Entry Name="ItemDesc_DungeonKeyOne">A key that leads to the dungeon below.</Entry>
</CATEGORY>
<CATEGORY Name="Journal">
<Entry Name="Note_AlphaOne_Name">Operation Alpha I</Entry>
<Entry Name="Note_AlphaOne_Text">It seems that no one has found the purpose of the glowing rocks. They will lead us to our
doom.[br][br]The only way to get the Light is to pursue the Darkness.</Entry>
</CATEGORY>
<CATEGORY Name ="Message">
<Entry Name="BruteDoorLocked">Firmly locked, looks like no human could open it.</Entry>
</CATEGORY>
</LANGUAGE>


Is this correct? Because I try to open the door in the game and nothing shows up on screen.

In the Level Editor, when I click on the door to show the message when it's locked, here are the fields in the Entity tab...

(checked)CastShadows
(unchecked)StaticPhysics
(unchecked)IsAffectedByDecal

CallbackFunc (blank)
ConnectedProps (blank)
ConnectionStateChangeCallback (blank)

(checked)FullGameSave

PlayerLookAtCallback (blank)

(unchecked)PlayerLookAtCallbackAutoRemo...

PlayerInteractCallback "InteractClosedDoor"

(unchecked)PlayerInteractCallbackAutoRemo...
(checked)Locked
OpenAmount - 0
(unchecked)DisableBreakable

Thanks!
(This post was last modified: 08-27-2011, 08:59 AM by cheztheguy.)
08-27-2011, 08:39 AM
Find
Kurton Offline
Senior Member

Posts: 533
Threads: 8
Joined: Oct 2010
Reputation: 16
#2
RE: Show message when you try to open a locked door?

I think, try changing

SetMessage("LockedDoor-Brute", "BruteDoorLocked", 7.0f);

to

SetMessage("Message", "BruteDoorLocked", 7.0f);

Seeing as "Message" is the category BruteDoorLocked is in, not LockedDoor-Brute

08-27-2011, 09:06 AM
Find
cheztheguy Offline
Junior Member

Posts: 12
Threads: 7
Joined: Jun 2011
Reputation: 0
#3
RE: Show message when you try to open a locked door?

(08-27-2011, 09:06 AM)Kurton Wrote: I think, try changing

SetMessage("LockedDoor-Brute", "BruteDoorLocked", 7.0f);

to

SetMessage("Message", "BruteDoorLocked", 7.0f);

Seeing as "Message" is the category BruteDoorLocked is in, not LockedDoor-Brute

Ohhh. Okay. Thanks! Gah, sometimes I just don't know what's wrong.
08-27-2011, 09:10 AM
Find
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#4
RE: Show message when you try to open a locked door?

That happens to all scripters, even to experienced ones Smile

The Interrogation
Chapter 1

My tutorials
08-27-2011, 10:53 AM
Find
MegaScience Offline
Member

Posts: 213
Threads: 1
Joined: Aug 2011
Reputation: 2
#5
RE: Show message when you try to open a locked door?

Also, why are you putting the message on a timer exactly? Wouldn't it be easier to put it right in the Interact command? Huh
08-28-2011, 12:55 PM
Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#6
RE: Show message when you try to open a locked door?

Correction:
The category is "Messages."

A small "S" can make it still not show up Smile

If your still having trouble, do that.

Also, Why do you have a timer? Just use an interact command.

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

08-28-2011, 03:15 PM
Website Find




Users browsing this thread: 1 Guest(s)