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
Setting a message when interacting with a door
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#1
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
Find
Dizturbed Offline
Member

Posts: 160
Threads: 39
Joined: Jun 2011
Reputation: 0
#2
RE: Setting a message when interacting with a door

SetEntityPlayerInteractCallback.

Then use Setmessage. =)

07-26-2011, 06:53 PM
Find
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#3
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
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#4
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
Website Find
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#5
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
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#6
RE: Setting a message when interacting with a door

Awww, you didn't write the entity's name.

07-26-2011, 07:01 PM
Website Find
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#7
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
Find
MrCookieh Offline
Member

Posts: 157
Threads: 8
Joined: Jul 2011
Reputation: 0
#8
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>

The Well: Descent - Take a look at it!
(This post was last modified: 07-26-2011, 07:05 PM by MrCookieh.)
07-26-2011, 07:05 PM
Find
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#9
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. Smile
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
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#10
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
Website Find




Users browsing this thread: 4 Guest(s)