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
Need help to make key react when use for door.
ZxBrad Offline
Member

Posts: 140
Threads: 29
Joined: Mar 2011
Reputation: 0
#1
Need help to make key react when use for door.

Hey i just made a really small script a key to door script and i got the key item name and description working and all i need is just having it work on the door and i got the script done. But the door just doesnt want to work with the door heres my script

Quote:////////////////////////////
// Run first time starting map
void OnStart()
{
SetMessage("Journal", "start", 8.0f);
AddUseItemCallback("", "doorkey_1", "castle_1", "UsedKeyOnDoor", true);
}
void UsedKeyOnCabinet(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_1", false, true);
PlaySoundAtEntity("", "unlock_door", "castle_1", 0, false);
RemoveItem("doorkey_1");
}

plz and thx for some replys.

WARNING: Noob Doesn't Know How To Script.
[Image: xcn384.gif]

04-06-2011, 11:08 PM
Find
Linus Ågren Offline
Senior Member

Posts: 309
Threads: 58
Joined: Jan 2011
Reputation: 5
#2
RE: Need help to make key react when use for door.

In your Callback, you named the func UseKeyOnDoor, but you named it UseKeyOnCabinet in your actual func. :>

Creator of The Dark Treasure.
04-07-2011, 06:50 AM
Website Find
ZxBrad Offline
Member

Posts: 140
Threads: 29
Joined: Mar 2011
Reputation: 0
#3
RE: Need help to make key react when use for door.

(04-07-2011, 06:50 AM)junkfood2121 Wrote: In your Callback, you named the func UseKeyOnDoor, but you named it UseKeyOnCabinet in your actual func. :>

It did say that, but i changed it to Door before i tried it on the game.

WARNING: Noob Doesn't Know How To Script.
[Image: xcn384.gif]

04-07-2011, 10:35 AM
Find
Austums Offline
Member

Posts: 60
Threads: 11
Joined: Mar 2011
Reputation: 0
#4
RE: Need help to make key react when use for door.

Make sure your CustomSubItemTypeName is named the same as your entity. If you don't know what the CustomSub is, click the key or door and click on the entity tab. Scroll to the bottom and name it doorkey_1

Should work! I remember I had the same problem as well. xP
(This post was last modified: 04-07-2011, 12:31 PM by Austums.)
04-07-2011, 12:31 PM
Find




Users browsing this thread: 1 Guest(s)