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
TheGreatCthulhu Offline
Member

Posts: 213
Threads: 10
Joined: Oct 2010
Reputation: 32
#7
RE: Fatal Error on this script

True. Also make sure to go to the line that caused the error and inspect the code yourself
The error comes from an "orphaned" method body (the stuff beteen { and } )
Bellow is your original code - the reason for the error is in red:

////////////////////////////
// Run when entering map
void OnStart()
{
AddUseItemCallback("", "BasementKey_1", "mansion_1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("BasementKey_1");
}
{
AddUseItemCallback("", "startkey", "cabinet_1", "UsedKeyOnDoor", true);
}


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

////////////////////////////
// Run when leaving map
void OnLeave()
{
}

You have to take the AddUseItemCallback(...) call out of there, and delete the invalid {} block.
08-16-2012, 07:21 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
RE: Fatal Error on this script - by TheGreatCthulhu - 08-16-2012, 07:21 PM



Users browsing this thread: 1 Guest(s)