Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ERR : Expected ";"
Zizilon Offline
Junior Member

Posts: 7
Threads: 4
Joined: Jun 2012
Reputation: 0
#1
ERR : Expected ";"

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);
}
06-01-2014, 02:42 PM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#2
RE: ERR : Expected ";"

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.

Derp.
06-01-2014, 03:35 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#3
RE: ERR : Expected ";"

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)

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
06-02-2014, 07:40 PM
Find
WALP Offline
Posting Freak

Posts: 1,221
Threads: 34
Joined: Aug 2012
Reputation: 45
#4
RE: ERR : Expected ";"

(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);
06-03-2014, 02:48 PM
Find
eliasfrost Offline
Posting Freak

Posts: 1,769
Threads: 34
Joined: Mar 2007
Reputation: 39
#5
RE: ERR : Expected ";"

programming 101: Always end a statement with a semi-colon. Depends on the language though.

[Image: indiedb_88x31.png]
(This post was last modified: 06-03-2014, 02:58 PM by eliasfrost.)
06-03-2014, 02:58 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#6
RE: ERR : Expected ";"

(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

Discord: Romulator#0001
[Image: 3f6f01a904.png]
06-03-2014, 03:29 PM
Find
eliasfrost Offline
Posting Freak

Posts: 1,769
Threads: 34
Joined: Mar 2007
Reputation: 39
#7
RE: ERR : Expected ";"

"depends on language" Smile

[Image: indiedb_88x31.png]
06-03-2014, 03:38 PM
Find




Users browsing this thread: 1 Guest(s)