08-27-2011, 08:39 AM
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...
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...
<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!
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!