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.17 (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
Script Help Message on door and StopPlayerLookAt
CreatAr Offline
Junior Member

Posts: 8
Threads: 2
Joined: Jul 2012
Reputation: 0
#1
Message on door and StopPlayerLookAt

Hi there, I'm currently working on my first custom story. I'm new to scripting and in need of some help. The 2 things that I need help with is, making a message appear when you try to open a locked door, and making the player to be able to look around freely again after using a PlayerLookAt script. Those 2 scripts are the ones not working. Here's my lang and hps files.


///////////////////////////
//Run first time starting map
void OnStart()
{
AddUseItemCallback("", "bigroomdoorkey_1", "bigroomdoor", "UsedKeyOnDoor", true);
}

void KeyFunc (string &in asEntity, string &in type)
{
SetEntityActive("servant_brute_1", true);
StartPlayerLookAt("servant_brute_1", 15, 15, "");
AddTimer("monstertimer", 2, "monstertimer");
ShowEnemyPlayerPosition("servant_brute_1");
}

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

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("bigroomdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "bigroomdoor", 0, false);
RemoveItem("bigroomdoorkey_1");
}

void DoorIsLocked(string &in asEntity)

{
if(GetSwingDoorLocked("bigroomdoor") == true)
{

SetMessage("Messages", "thedoorislocked", 0);

}
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

///////////////////////////
// Run when leaving map
void OnLeave()
{

}

___________________________________________________________________________






<LANGUAGE>
<RESOURCES>
</RESOURCES>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">You are Michael, you are nineteen years old and your parents have gone away for a vacation over the weekend.[br][br] When you wake up the first morning that you are alone you notice that there is something strange going on with your house.</Entry>
</CATEGORY>
<CATEGORY Name="Inventory">
<Entry Name="ItemName_bigroomdoorkey">Big Room Door Key</Entry>
<Entry Name="ItemDesc_bigroomdoorkey">Key to the door in the big room</Entry>
</CATEGORY>
<CATEGORY Name=“Messages”>
<Entry Name =“thedoorislocked”>The door is locked, I think the key should be around here somewhere</Entry>
</CATEGORY>
</LANGUAGE>
(This post was last modified: 07-13-2012, 12:48 PM by CreatAr.)
07-13-2012, 10:27 AM
Find


Messages In This Thread
Message on door and StopPlayerLookAt - by CreatAr - 07-13-2012, 10:27 AM



Users browsing this thread: 3 Guest(s)