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 Fatal Error
7heDubz Offline
Posting Freak

Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation: 41
#8
RE: Script Fatal Error

http://wiki.frictionalgames.com/hpl2/tut...t_beginner
Read this please.

Okay
Spoiler below!

void FinishTheQuest(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("ahmetquest", "AhmetQuest");
}



{
AddUseItemCallback("", "TheKey_1", "door_1", "UsedKeyOnDoor", true);
}


the problem with this right here is that everytime you put void EVERYTHING you want to happen in it goes into ONE set of brackets
so
Spoiler below!

void FinishTheQuest(string &in asParent, string &in asChild, int alState)
{
EVERYTHING YOU WANT TO HAPPEN HERE HAS TO GO HERE INBETWEEN THESE BRACKETS.
}

Here's a rudimentary explanation
whats inside of the brackets define effect. the cause is written in above it. EX.
Spoiler below!

THE CAUSE
void OnStart()

THE EFFECT
{
AddUseItemCallback("", "TheKey_1", "door_1", "UsedKeyOnDoor", true);
}

You have some brackets just sitting there in your script randomly. (an effect without a cause) let me show you where exactly
Spoiler below!

void OnStart()
{
AddEntityCollideCallback("Player", "Ahmet_Quest_Area", "GetAhmetQuest", true, 1);
AddEntityCollideCallback("Player", "Ahmet_Complete_Area", "FinishAhmetQuest", true, 1);
}

void GetTheQuest(string &in asParent, string &in asChild, int alState)
{
AddQuest("ahmetquest", "AhmetQuest");
}

void FinishTheQuest(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("ahmetquest", "AhmetQuest");
}



{
AddUseItemCallback("", "TheKey_1", "door_1", "UsedKeyOnDoor", true);
}

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


THAT is why it is saying that "the { is unexpected because it has no cause so why is there an effect?"

(This post was last modified: 06-15-2013, 09:22 PM by 7heDubz.)
06-15-2013, 09:20 PM
Find


Messages In This Thread
Script Fatal Error - by SystemFail - 06-15-2013, 08:09 PM
RE: Script Fatal Error - by 7heDubz - 06-15-2013, 08:17 PM
RE: Script Fatal Error - by SystemFail - 06-15-2013, 08:39 PM
RE: Script Fatal Error - by 7heDubz - 06-15-2013, 08:42 PM
RE: Script Fatal Error - by SystemFail - 06-15-2013, 08:44 PM
RE: Script Fatal Error - by 7heDubz - 06-15-2013, 08:56 PM
RE: Script Fatal Error - by SystemFail - 06-15-2013, 09:05 PM
RE: Script Fatal Error - by 7heDubz - 06-15-2013, 09:20 PM
RE: Script Fatal Error - by SystemFail - 06-15-2013, 09:27 PM
RE: Script Fatal Error - by 7heDubz - 06-15-2013, 09:46 PM
RE: Script Fatal Error - by SystemFail - 06-15-2013, 09:56 PM
RE: Script Fatal Error - by 7heDubz - 06-15-2013, 10:11 PM
RE: Script Fatal Error - by SystemFail - 06-16-2013, 12:09 AM



Users browsing this thread: 1 Guest(s)