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
Unexpected "{" Expected "("
ironman0001 Offline
Member

Posts: 53
Threads: 8
Joined: Sep 2012
Reputation: 0
#1
Unexpected "{" Expected "("

Here's my script


void OnStart()
{
AddEntityCollideCallback("Player", "TeleportScript", "PoopedYaPants", true, 1);
SetMessage("Messages", "Popup1", 0);
AddUseItemCallback("", "Spooky", "Scared", "PopupHead", true);
SetEntityPlayerInteractCallback("Spooky", "lolz", true);
AddEntityCollideCallback("Player", "CreepySound", "wow", true, 1);
AddEntityCollideCallback("Player", "Beat_It", "OMG!!!", true, 1);
}

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

void Popup1()
{
AddEntityCollideCallback("Player", "Message_1", "Message1", true, 1);
}

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

void lolz(string &in item)
{
SetEntityActive("lolz_1", true);
PlaySoundAtEntity("", "21_screams.snt", "Player", 0, false);
}

void wow(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "29_amb_guard.snt", "CreepySound", 0, false);
}

{
SetEntityPlayerInteractCallback("door1", "func_slam", true);
}

void OMG!!!(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("door1", 0.0f);


PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);


PlaySoundAtEntity("", "react_scare", "Player", 0, false);


PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);


GiveSanityDamage(5.0f, true);
}
09-29-2012, 05:30 AM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: Unexpected "{" Expected "("

(09-29-2012, 05:30 AM)ironman0001 Wrote: Here's my script


void OnStart()
{
AddEntityCollideCallback("Player", "TeleportScript", "PoopedYaPants", true, 1);
SetMessage("Messages", "Popup1", 0);
AddUseItemCallback("", "Spooky", "Scared", "PopupHead", true);
SetEntityPlayerInteractCallback("Spooky", "lolz", true);
AddEntityCollideCallback("Player", "CreepySound", "wow", true, 1);
AddEntityCollideCallback("Player", "Beat_It", "OMG!!!", true, 1);
}

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

void Popup1()
{
AddEntityCollideCallback("Player", "Message_1", "Message1", true, 1);
}

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

void lolz(string &in item)
{
SetEntityActive("lolz_1", true);
PlaySoundAtEntity("", "21_screams.snt", "Player", 0, false);
}

void wow(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "29_amb_guard.snt", "CreepySound", 0, false);
}

{
SetEntityPlayerInteractCallback("door1", "func_slam", true);
}

void OMG!!!(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("door1", 0.0f);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
It's missing a callback, or it is outside of the parameters of the function listed above.

Your callbacks have the strangest names. "OMG!!!"
09-29-2012, 05:38 AM
Find
ironman0001 Offline
Member

Posts: 53
Threads: 8
Joined: Sep 2012
Reputation: 0
#3
RE: Unexpected "{" Expected "("

(09-29-2012, 05:38 AM)Statyk Wrote:
(09-29-2012, 05:30 AM)ironman0001 Wrote: Here's my script


void OnStart()
{
AddEntityCollideCallback("Player", "TeleportScript", "PoopedYaPants", true, 1);
SetMessage("Messages", "Popup1", 0);
AddUseItemCallback("", "Spooky", "Scared", "PopupHead", true);
SetEntityPlayerInteractCallback("Spooky", "lolz", true);
AddEntityCollideCallback("Player", "CreepySound", "wow", true, 1);
AddEntityCollideCallback("Player", "Beat_It", "OMG!!!", true, 1);
}

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

void Popup1()
{
AddEntityCollideCallback("Player", "Message_1", "Message1", true, 1);
}

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

void lolz(string &in item)
{
SetEntityActive("lolz_1", true);
PlaySoundAtEntity("", "21_screams.snt", "Player", 0, false);
}

void wow(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "29_amb_guard.snt", "CreepySound", 0, false);
}

{
SetEntityPlayerInteractCallback("door1", "func_slam", true);
}

void OMG!!!(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("door1", 0.0f);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
It's missing a callback, or it is outside of the parameters of the function listed above.

Your callbacks have the strangest names. "OMG!!!"
Now it says Expected "("



void OnStart()
{
AddEntityCollideCallback("Player", "TeleportScript", "PoopedYaPants", true, 1);
SetMessage("Messages", "Popup1", 0);
AddUseItemCallback("", "Spooky", "Scared", "PopupHead", true);
SetEntityPlayerInteractCallback("Spooky", "lolz", true);
AddEntityCollideCallback("Player", "CreepySound", "wow", true, 1);
AddEntityCollideCallback("Player", "Beat_It", "OMG!!!", true, 1);
}

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

void Popup1()
{
AddEntityCollideCallback("Player", "Message_1", "Message1", true, 1);
}

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

void lolz(string &in item)
{
SetEntityActive("lolz_1", true);
PlaySoundAtEntity("", "21_screams.snt", "Player", 0, false);
}

void wow(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "29_amb_guard.snt", "CreepySound", 0, false);
}

void OMG!!!(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("door1", 0.0f);


PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);


PlaySoundAtEntity("", "react_scare", "Player", 0, false);


PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);


GiveSanityDamage(5.0f, true);
}
09-29-2012, 05:49 AM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#4
RE: Unexpected "{" Expected "("

Can you please try to keep as minimum amount of thread creations for an error you're posting here? I deleted the other one.

As for the issue. What numbers come up in the error window? Should be something like "Expected "(" (52, 5)" or something like that.
(This post was last modified: 09-29-2012, 06:27 AM by Statyk.)
09-29-2012, 06:27 AM
Find
ironman0001 Offline
Member

Posts: 53
Threads: 8
Joined: Sep 2012
Reputation: 0
#5
RE: Unexpected "{" Expected "("

(09-29-2012, 06:27 AM)Statyk Wrote: Can you please try to keep as minimum amount of thread creations for an error you're posting here? I deleted the other one.

As for the issue. What numbers come up in the error window? Should be something like "Expected "(" (52, 5)" or something like that.
(43,9)
09-29-2012, 06:35 AM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#6
RE: Unexpected "{" Expected "("

Yeah, like I said, your callbacks have strange names. "!" is used in coding in C++. Change the callback 'OMG!!!" to "OMG"
09-29-2012, 06:48 AM
Find




Users browsing this thread: 1 Guest(s)