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 Help [SOLVED]
Spelos Away
Banned

Posts: 231
Threads: 19
Joined: Sep 2014
#2
RE: Message Help

If you want a message to appear when Player looks at something, you will need a PlayerLookAtCallback.

Frictional Games Wiki Wrote:void SetEntityPlayerLookAtCallback(string& asName, string& asCallback, bool abRemoveWhenLookedAt);

To use it, you will need:
  • Entity in the level editor
    Do remember the name of that entity! For example: MyDoor

How to use the callback:
  • Put it into the OnStart function and fill the parameters.
  • Use the void MyFunc(string &in asEntity, int alState) as your function to call.

What it should look like:
PHP Code: (Select All)
void OnStart()
{
    
AddUseItemCallback("""key1""door01""func"true);
    
AddUseItemCallback("""chip""door01""afunc"true);
    
SetPlayerLampOil(0);
    
SetMessage("Messages""start"4);
    
AddEntityCollideCallback("Player""act""actfunc"true1);

    
//"MyDoor" is the name of the entity to look at, "LookMessage" is the function to call, false - if the message should remove itself after the first time Player looks at it.
    
SetEntityPlayerLookAtCallback("MyDoor""LookMessage"false);
}

void LookMessage(string &in asEntityint alState
{
    
SetMessage("MessageCategory""MessageEntry"0); //Fill in the category and Entry
}

// \/ --- The rest of your code here --- \/ // 
(This post was last modified: 02-19-2016, 03:33 PM by Spelos.)
02-19-2016, 03:30 PM
Find


Messages In This Thread
Message Help [SOLVED] - by WarJenkins - 02-19-2016, 01:13 PM
RE: Message Help - by Spelos - 02-19-2016, 03:30 PM
RE: Message Help - by WarJenkins - 02-19-2016, 03:51 PM



Users browsing this thread: 1 Guest(s)