The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.15 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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


Messages In This Thread
Show message when you try to open a locked door? - by cheztheguy - 08-27-2011, 08:39 AM



Users browsing this thread: 1 Guest(s)