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
Hold item on entity = text?
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#3
RE: Hold item on entity = text?

(07-07-2013, 06:47 PM)GoranGaming Wrote: That's i,possible, if I'm right, unless you fiddle with the source code...

You can do it, but not when you double click the key in the inventory.

Example 1, in this case, the message shows up when you interact with the door:

void OnStart()
{
SetEntityPlayerInteractCallback("Door", "InteractDoor", false);
}

void InteractDoor(string &in asEntity)
{
if(HasItem("Door_Key_1") == true){
SetMessage("Category", "MessageThatSaysUseKeyOnDoor");
}
else
{
//Do nothing
}
}

Example 2, in this case the message shows up if the player has the key and approaches the door:

void OnStart()
{
AddEntityCollideCallback("Player", "CollideDoorArea", "CollideDoor", 0, 1);
}

void CollideDoor(string &in asParent, string &in asChild, int alState)
{
if(HasItem("Door_Key_1") == true){
SetMessage("Category", "MessageThatSaysUseKeyOnDoor");
}
else
{

}
}

Ok I will try the second example. Ty Smile

07-07-2013, 10:12 PM
Find


Messages In This Thread
Hold item on entity = text? - by Storfigge - 07-07-2013, 04:30 PM
RE: Hold item on entity = text? - by GoranGaming - 07-07-2013, 06:47 PM
RE: Hold item on entity = text? - by Storfigge - 07-07-2013, 10:12 PM



Users browsing this thread: 1 Guest(s)