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
Noob in trouble!
DRedshot Offline
Senior Member

Posts: 374
Threads: 23
Joined: Jun 2011
Reputation: 11
#20
RE: Noob in trouble!

This is a long-shot, but try it anyways:

void OnStart()
{
AddUseItemCallback("", "key_1", "mansion_3", "UsedKeyOnDoor", true);
SetEntityCallbackFunc("key_1", "OnPickup");
}

void UsedKeyOnDoor(string &in item, string &in entity)
{
SetSwingDoorLocked(entity, false, true);
PlaySoundAtEntity("", "unlock_door.snt", entity, 0, false);
RemoveItem(item);
AddDebugMessage("Key has been used, is door unlocked?" , false);
}

Check if the debug message shows up when you unlock the door. If it doesn't, there is a problem with the AddUseItemCallback, if it does, the problem is related to the SetSwingDoorLocked function.
Also, make sure you are hitting enter when you type the entity name in the Level Editor. It sounds like an obvious thing to say, but so many times I have had these mysterious problems because I forgot to hit enter and the entities name doesn't register.

(This post was last modified: 04-14-2012, 06:47 PM by DRedshot.)
04-14-2012, 06:46 PM
Find


Messages In This Thread
Noob in trouble! - by Macetrow - 04-13-2012, 07:06 PM
RE: Noob in trouble! - by Putmalk - 04-13-2012, 07:35 PM
RE: Noob in trouble! - by Macetrow - 04-13-2012, 07:43 PM
RE: Noob in trouble! - by Putmalk - 04-13-2012, 10:59 PM
RE: Noob in trouble! - by Macetrow - 04-13-2012, 11:01 PM
RE: Noob in trouble! - by Putmalk - 04-13-2012, 11:03 PM
RE: Noob in trouble! - by Macetrow - 04-13-2012, 11:09 PM
RE: Noob in trouble! - by Putmalk - 04-13-2012, 11:14 PM
RE: Noob in trouble! - by Macetrow - 04-13-2012, 11:20 PM
RE: Noob in trouble! - by zombiehacker595 - 04-14-2012, 01:37 AM
RE: Noob in trouble! - by Macetrow - 04-14-2012, 09:41 AM
RE: Noob in trouble! - by zombiehacker595 - 04-14-2012, 10:18 AM
RE: Noob in trouble! - by Datguy5 - 04-14-2012, 11:54 AM
RE: Noob in trouble! - by Macetrow - 04-14-2012, 03:55 PM
RE: Noob in trouble! - by Datguy5 - 04-14-2012, 04:09 PM
RE: Noob in trouble! - by Macetrow - 04-14-2012, 04:12 PM
RE: Noob in trouble! - by Datguy5 - 04-14-2012, 05:15 PM
RE: Noob in trouble! - by Macetrow - 04-14-2012, 05:51 PM
RE: Noob in trouble! - by Datguy5 - 04-14-2012, 06:01 PM
RE: Noob in trouble! - by DRedshot - 04-14-2012, 06:46 PM
RE: Noob in trouble! - by Macetrow - 04-14-2012, 07:31 PM
RE: Noob in trouble! - by DRedshot - 04-14-2012, 08:27 PM
RE: Noob in trouble! - by JenniferOrange - 04-14-2012, 09:47 PM
RE: Noob in trouble! - by Macetrow - 04-14-2012, 09:49 PM
RE: Noob in trouble! - by DRedshot - 04-14-2012, 10:06 PM
RE: Noob in trouble! - by SilentStriker - 04-14-2012, 10:21 PM
RE: Noob in trouble! - by Macetrow - 04-14-2012, 11:08 PM
RE: Noob in trouble! - by SilentStriker - 04-14-2012, 11:13 PM
RE: Noob in trouble! - by Macetrow - 04-14-2012, 11:16 PM
RE: Noob in trouble! - by SilentStriker - 04-14-2012, 11:17 PM
RE: Noob in trouble! - by Macetrow - 04-15-2012, 12:43 AM
RE: Noob in trouble! - by SilentStriker - 04-15-2012, 01:08 AM



Users browsing this thread: 1 Guest(s)