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
Script Help Fatal Error on this script
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: Fatal Error on this script

You must put all callbacks under void OnStart(), you can use void OnEnter() but that has more specific applications. You also can't have two functions with the exact same name (you used UseKeyOnDoor twice). Here's a cool trick you can do using asItem and asEntity that will fix your problem as well as reduce script clutter:


void OnStart()
{
AddUseItemCallback("", "BasementKey_1", "mansion_1", "UsedKeyOnDoor", true);
AddUseItemCallback("", "startkey", "cabinet_1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, false);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem(asItem);
}


Hope that helped

I rate it 3 memes.
08-15-2012, 04:19 PM
Find


Messages In This Thread
Fatal Error on this script - by jtylerg - 08-15-2012, 04:07 PM
RE: Fatal Error on this script - by Adny - 08-15-2012, 04:19 PM
RE: Fatal Error on this script - by Ongka - 08-15-2012, 04:19 PM
RE: Fatal Error on this script - by jtylerg - 08-16-2012, 06:44 PM
RE: Fatal Error on this script - by Ongka - 08-16-2012, 07:00 PM
RE: Fatal Error on this script - by jtylerg - 08-16-2012, 08:44 PM
RE: Fatal Error on this script - by Adny - 08-16-2012, 07:16 PM



Users browsing this thread: 1 Guest(s)