Shadowfied
Senior Member
Posts: 261
Threads: 34
Joined: Jul 2010
Reputation:
5
|
Remove a PlayerInteractCallback through script?
Another problem related to the other thread I posted about a static, non-colliding entity. Decided to make it a new thread though as people might look for this.
Alright so I have a door which is locked and unlocks automatically when the player picks up a note which is hanging on the door. I've made a PlayerInteractCallback function which adds a message saying "I should read the note first" if the player tries to use the door. I only want this to appear if the player has not picked up the note, so if the player picks up the note and then uses the door, which is the way I want players to do, and which is the way that most serious players would do, the message still appears. I've looked through the scripts on the HPL Engine wiki and can't find anything, and I've searched the forum but couldn't find anything about it.
So I thought that in the PlayerInteractCallback for the NOTE, which also unlocks the door, there could be some script removing the PlayerInteractCallback from the door.
So basically, I need a script like "RemovePlayerInteractCallback" which unfortunately does not exist.
Thanks in advance.
Edit: I do realize there are many alternatives way for THIS PARTICULAR problem, like changing the door entity to an identical one when the player picks up the note. I do have some alternative ways to fix it.
(This post was last modified: 02-09-2012, 12:28 PM by Shadowfied.)
|
|
02-09-2012, 12:25 PM |
|
palistov
Posting Freak
Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation:
57
|
RE: Remove a PlayerInteractCallback through script?
You can use a local variable. Set it to 1 if the conditions under which you do NOT want the interaction callback to occur are met, and simply check the variable when the player interacts with the door. If it is 1, do your stuffs. Otherwise, do nothing.
|
|
02-09-2012, 12:41 PM |
|
Shadowfied
Senior Member
Posts: 261
Threads: 34
Joined: Jul 2010
Reputation:
5
|
RE: Remove a PlayerInteractCallback through script?
(02-09-2012, 12:41 PM)palistov Wrote: You can use a local variable. Set it to 1 if the conditions under which you do NOT want the interaction callback to occur are met, and simply check the variable when the player interacts with the door. If it is 1, do your stuffs. Otherwise, do nothing. Nvm. Will try.
Yes, it worked! Thanks.
(This post was last modified: 02-09-2012, 12:59 PM by Shadowfied.)
|
|
02-09-2012, 12:43 PM |
|