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
Swing door message
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: Swing door message

The SetMessage script is the one you want to use to display the message. Combine that with a player interact callback, and you should get the result you want.

First, set the callback in OnStart()
PHP Code: (Select All)
SetEntityPlayerInteractCallback("Door""MyFuncName"false); 
Note: If you want this to happen only once, set the false to be true.

Next, set up the callback event:

PHP Code: (Select All)
void MyFuncName(string &in asEntity)
{
    
SetMessage("MessageCategory""MessageEntry", -1.0f);


Here, the MessageCategory refers to a category in your extra_english.lang file. The MessageEntry refers to an entry within that category. The last float number determines how long it should last (but I've set it to auto).

Lastly you need your lang file to respect this. If you haven't worked much with your lang file, this may be a bit tricky, but you need to add the category and entry you specified.

PHP Code: (Select All)
<CATEGORY Name="MessageCategory">
    <
Entry Name="MessageEntry">This door requires a key</Entry>
</
CATEGORY

03-01-2017, 09:23 AM
Find


Messages In This Thread
Swing door message - by XeOnTricks - 03-01-2017, 01:55 AM
RE: Swing door message - by Mudbill - 03-01-2017, 09:23 AM
RE: Swing door message - by XeOnTricks - 03-01-2017, 11:51 AM
RE: Swing door message - by FlawlessHappiness - 03-01-2017, 12:18 PM
RE: Swing door message - by Traggey - 03-03-2017, 03:53 PM



Users browsing this thread: 1 Guest(s)