Frictional Games Forum (read-only)

Full Version: ERR : Expected ";"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So currently i'm making a Amnesia CS. I wanted to put a jumpscare and something is wrong with my script and i've been trying to find the problem and I couldn't find it, can you please tell me the problem in my script?
And when I load the map it says:
ERR : Expected ";"
Here is my script:

////////////////////////////
// Run when entering map

void OnStart()
{
PlayMusic("introtheme.ogg", true, 0.9, 1.0, 1, true)
AddUseItemCallback("", "Key", "Door_2", "UseKeyOnDoor", true);
AddEntityCollideCallback("Player", "Walk_Quest_Area", "GetWalkQuest", true, 1);
AddEntityCollideCallback("Player", "Walk_Quest_Area2", "GetWalkQuest2", true, 1);
AddEntityCollideCallback("Player", "TeleportScript", "NailThatSucker", true, 1);
}

void NailThatSucker(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Jesus", true);
AddPropForce("Jesus", -10000, 0, 0, "world");
PlaySoundAtEntity("", "24_iron_maiden.snt", "Jesus", 0, false);
}

void GetWalkQuest2(string &in asParent, string &in asChild, int alState)
{
AddQuest("walkquest2", "WalkQuest2");
}

void GetWalkQuest(string &in asParent, string &in asChild, int alState)
{
AddQuest("walkquest", "WalkQuest");
}

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

void Message1(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "Popup1", 5); //This stands for ("Name of category", "Name of entry", time to be displayed on the screen);.
}

void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{
StopMusic(1 , 1);
}
PlayMusic is missing a ;

PlayMusic("introtheme.ogg", true, 0.9, 1.0, 1, true);

Replace it with this above.

And I can see on this script that this is a teleporting naked guy (or a Jesus as you prefere it). I wouldn't recommend using it.
I'm posting this with my mobile and I cant copy paste, but the commentary at the end has a ; that shouldnt be. (I think)
(06-01-2014, 02:42 PM)Zizilon Wrote: [ -> ]void OnStart()
{
PlayMusic("introtheme.ogg", true, 0.9, 1.0, 1, true)
AddUseItemCallback("", "Key", "Door_2", "UseKeyOnDoor", true);
AddEntityCollideCallback("Player", "Walk_Quest_Area", "GetWalkQuest", true, 1);
AddEntityCollideCallback("Player", "Walk_Quest_Area2", "GetWalkQuest2", true, 1);
AddEntityCollideCallback("Player", "TeleportScript", "NailThatSucker", true, 1);
}

As informed in the headline a ";" is expected, but at the end of PlayMusic you forgot to add one. so:
(06-01-2014, 02:42 PM)Zizilon/TheMug Wrote: [ -> ]PlayMusic("introtheme.ogg", true, 0.9, 1.0, 1, true);
programming 101: Always end a statement with a semi-colon. Depends on the language though.
(06-03-2014, 02:58 PM)eliasfrost Wrote: [ -> ]programming 101: Always end a statement with a semi-colon. Depends on the language though.

Not vb.net Tongue
"depends on language" Smile