Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Don't need to use the key on door?
Author Message
CapnJimmy Offline
Junior Member

Posts: 9
Joined: Jan 2011
Reputation: 0
Post: #1
Don't need to use the key on door?
Hi, just encountered something odd.

Once I pick up the key the door unlocks without using the key on it.

Here's how the script is laid out:

void OnStart()
{
AddUseItemCallback("", "Key1", "Door_1", "KeyOnDoor", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Door_1", 0.0f, true);
}

The Item entities are:

Key_1:-
CallbackFunc:
KeyOnDoor

ConnectedProps:
Door1

and Door_1:-
CallbackFunc:
KeyOnDoor

ConnectedProps:
Key1
(This post was last modified: 01-26-2011 06:18 PM by CapnJimmy.)
01-25-2011 06:17 PM
Find all posts by this user Quote this message in a reply
CapnJimmy Offline
Junior Member

Posts: 9
Joined: Jan 2011
Reputation: 0
Post: #2
RE: Don't need to use the key on door?
Anyone able to help?
01-26-2011 06:17 PM
Find all posts by this user Quote this message in a reply
Frontcannon Offline
Senior Member

Posts: 538
Joined: Jul 2010
Reputation: 0
Post: #3
RE: Don't need to use the key on door?
discarded bullshit I've written earlier

The CallbackFunc is used for something different entirely. It's immediately called once you interact wth the entity, so what happens is:

you pick up the key
KeyOnDoor is called, door unlocks
you are confused

The CallbackFunc of the door is just redundant now and will do nothing anymore, as for the AddUseItemCallback.
What ConnectedProp does is still new terrain to me either. Just delete everything what you've written in the callback and connectedporp boxes, your script is fine as is Big Grin


╔═════════════════╗
☺ Smoke weed everyday ☺
╚═════════════════╝
(This post was last modified: 01-26-2011 06:38 PM by Frontcannon.)
01-26-2011 06:35 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)