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


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help to make key react when use for door.
Author Message
ZxBrad Offline
Member

Posts: 140
Joined: Mar 2011
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Linus Ă…gren Offline
Senior Member

Posts: 309
Joined: Jan 2011
Reputation: 5
Post: #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
Visit this user's website Find all posts by this user Quote this message in a reply
ZxBrad Offline
Member

Posts: 140
Joined: Mar 2011
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Austums Offline
Member

Posts: 60
Joined: Mar 2011
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Post Reply 




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