JenniferOrange
Senior Member
Posts: 424
Threads: 43
Joined: Jun 2011
Reputation:
33
|
Setting a message when interacting with a door
I know that there's a script function thing for level doors, but I'm talking about swing doors. You go up to the door and try and open it, and a message displays. (saying something like "I'm locked down here.")
I've already tried using AddEntityCollideCallback so when the Player collides with the door the message is displayed, but it didn't work.. any help?
Ba-da bing, ba-da boom.
|
|
07-26-2011, 06:51 PM |
|
Dizturbed
Member
Posts: 160
Threads: 39
Joined: Jun 2011
Reputation:
0
|
RE: Setting a message when interacting with a door
SetEntityPlayerInteractCallback.
Then use Setmessage. =)
|
|
07-26-2011, 06:53 PM |
|
JenniferOrange
Senior Member
Posts: 424
Threads: 43
Joined: Jun 2011
Reputation:
33
|
RE: Setting a message when interacting with a door
I just tried that, and it didn't work. -.-
I looks like this:
{
SetEntityPlayerInteractCallback("", "Locked", true);
}
void Locked(string &in asParent, string &in asChild, int alState)
{
SetMessage("Messages", "locked", 0);
}
anything wrong?
EDIT: Just noticed I didn't change (string &in asParent, string &in asChild, int alState) to (string &in asEntity). Lol, oops.
Ba-da bing, ba-da boom.
(This post was last modified: 07-26-2011, 06:58 PM by JenniferOrange.)
|
|
07-26-2011, 06:56 PM |
|
Tanshaydar
From Beyond
Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation:
67
|
RE: Setting a message when interacting with a door
(string &in asParent, string &in asChild, int alState)
is wrong. It should be: (string &in entity)
void Locked(string &in entity)
(This post was last modified: 07-26-2011, 06:59 PM by Tanshaydar.)
|
|
07-26-2011, 06:58 PM |
|
JenniferOrange
Senior Member
Posts: 424
Threads: 43
Joined: Jun 2011
Reputation:
33
|
RE: Setting a message when interacting with a door
But it still doesn't work. >:c
Ba-da bing, ba-da boom.
|
|
07-26-2011, 07:00 PM |
|
Tanshaydar
From Beyond
Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation:
67
|
RE: Setting a message when interacting with a door
Awww, you didn't write the entity's name.
|
|
07-26-2011, 07:01 PM |
|
JenniferOrange
Senior Member
Posts: 424
Threads: 43
Joined: Jun 2011
Reputation:
33
|
RE: Setting a message when interacting with a door
where do I put that..? xD
SetEntityPlayerInteractCallback("cellar_1", "Locked", true); ?
Ba-da bing, ba-da boom.
|
|
07-26-2011, 07:03 PM |
|
MrCookieh
Member
Posts: 157
Threads: 8
Joined: Jul 2011
Reputation:
0
|
RE: Setting a message when interacting with a door
void OnStart(){
SetEntityPlayerInteractCallback("door", "showlockedmessage", false);
}
void showlockedmessage(string &in asEntity){
SetMessage("Message", "door", 0);
}
in your .lang file:
<CATEGORY Name="Message">
<Entry Name="door">The door is locked</Entry>
</CATEGORY>
(This post was last modified: 07-26-2011, 07:05 PM by MrCookieh.)
|
|
07-26-2011, 07:05 PM |
|
JenniferOrange
Senior Member
Posts: 424
Threads: 43
Joined: Jun 2011
Reputation:
33
|
RE: Setting a message when interacting with a door
Thanks MrCookieh.
I found a thing under the Entity tab of my door that said PlayerInteractCallback and wrote the name of my function (Locked) under there and it worked.
btw- how do you delete a thread you've made..? xD
Ba-da bing, ba-da boom.
(This post was last modified: 07-26-2011, 07:10 PM by JenniferOrange.)
|
|
07-26-2011, 07:09 PM |
|
Tanshaydar
From Beyond
Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation:
67
|
RE: Setting a message when interacting with a door
(07-26-2011, 07:03 PM)JenniferOrange Wrote: where do I put that..? xD
SetEntityPlayerInteractCallback("cellar_1", "Locked", true); ?
Yes, and what MrCookieh said. But it should be
<CATEGORY Name="Messages">
<Entry Name="locked">The door is locked</Entry>
</CATEGORY>
--
Anyway it's solved.
However, if you set in LevelEditor it will be there for default in map start. You might wanna add it later so scripting it might be better in some occasions.
(This post was last modified: 07-26-2011, 07:12 PM by Tanshaydar.)
|
|
07-26-2011, 07:10 PM |
|
|