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
.Lang File Help Need help displaying door is locked on non-exit doors.
julianprokop Offline
Junior Member

Posts: 19
Threads: 7
Joined: Nov 2011
Reputation: 0
#1
Need help displaying door is locked on non-exit doors.

How do you make a custom message appear when I interact with door entities that aren't exit doors?
The Exit doors have options for .lang files but there must be a way to create a object orientated category in the .lang file for any entity. Any ideas on how I could do so? The tutorials I've found aren't answering what I need.



02-12-2012, 10:53 AM
Find
Linus Ågren Offline
Senior Member

Posts: 309
Threads: 58
Joined: Jan 2011
Reputation: 5
#2
RE: Need help displaying door is locked on non-exit doors.

You need to make an interact callback
PHP Code: (Select All)
SetEntityPlayerInteractCallback(stringasNamestringasCallbackbool abRemoveOnInteraction); 
And then use
PHP Code: (Select All)
SetMessage(stringasTextCategorystringasTextEntryfloat afTime); 
to display the message you want to appear.

Example:

Quote:void OnStart()
{
SetEntityPlayerInteractCallback("DOORNAME", "CALLBACK", RUN_CODE_EACH_TIME_YOU_INTERACT);
}

void CALLBACK(string &in asEntity)
{
SetMessage("Messages", "DoorLocked", 3.0f);
}

Creator of The Dark Treasure.
02-12-2012, 12:28 PM
Website Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#3
RE: Need help displaying door is locked on non-exit doors.

I did that once, problem is that you still have it after you unlock it :/

(This post was last modified: 02-12-2012, 01:14 PM by flamez3.)
02-12-2012, 01:14 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#4
RE: Need help displaying door is locked on non-exit doors.

To have it not show text when it's unlocked you need to use local variables

(This post was last modified: 02-12-2012, 01:16 PM by SilentStriker.)
02-12-2012, 01:16 PM
Find
Juby Away
Senior Member

Posts: 290
Threads: 2
Joined: May 2011
Reputation: 5
#5
RE: Need help displaying door is locked on non-exit doors.

In the callback use:
if(GetSwingDoorLocked("Door")==false) SetMessage("TxtCat", "TxtEnt", 3);

if you want to not have the message appear after the door is unlocked.

Insanity. Static.
02-12-2012, 01:22 PM
Find
julianprokop Offline
Junior Member

Posts: 19
Threads: 7
Joined: Nov 2011
Reputation: 0
#6
RE: Need help displaying door is locked on non-exit doors.

ill try that out
could you give me an example of how I would include that in my call back? My project is getting pretty huge with lots of code going on so and {} brackets are usually the death of me.
(This post was last modified: 02-12-2012, 01:42 PM by julianprokop.)
02-12-2012, 01:25 PM
Find
julianprokop Offline
Junior Member

Posts: 19
Threads: 7
Joined: Nov 2011
Reputation: 0
#7
RE: Need help displaying door is locked on non-exit doors.

could you give me an example of how I would include that in my call back? My project is getting pretty huge with lots of code going on so and {} brackets are usually the death of me.
02-12-2012, 11:28 PM
Find
Juby Away
Senior Member

Posts: 290
Threads: 2
Joined: May 2011
Reputation: 5
#8
RE: Need help displaying door is locked on non-exit doors.

Do exactly as junkfood2121 said, but replace the SetMessage("Messages", "DoorLocked", 3.0f); with the command I said.

Insanity. Static.
02-13-2012, 12:39 AM
Find
julianprokop Offline
Junior Member

Posts: 19
Threads: 7
Joined: Nov 2011
Reputation: 0
#9
RE: Need help displaying door is locked on non-exit doors.

Still isn't working. This is what I have,
///CALLBACK
{
SetEntityPlayerInteractCallback("locked_door", "door_message", true);

}

///FUNCTION

void door_message(string &in asEntity)
{
if(GetSwingDoorLocked("Door")==false)
{
SetMessage("Doors", "door", 3);
}
}



02-13-2012, 12:56 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#10
RE: Need help displaying door is locked on non-exit doors.

Can we see your .lang file and have you named everything exactly?

02-13-2012, 03:48 AM
Find




Users browsing this thread: 1 Guest(s)