Frictional Games Forum (read-only)

Full Version: Identifier error! Help!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Im creating a custom story and I am getting an error that says:
main (13,26) : ERR : Expected identifier

I dont understand what went wrong. my Script looks like this:

void OnStart()
{
AddEntityCollideCallback("Player", "TeleportScript", "NailThatSucker", true, 1);
}

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

AddEntityCollideCallBack("Player", "PlayerCollide", "MonsterFunction", true, 1);

void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Badguy", true);
}

void OnEnter()
{

}

void OnLeave()
{

}

Jesus is an entity that flies at someone, and Badguy is a Grunt.
Please Help!
Where your issue is:
Spoiler below!

(04-14-2013, 11:21 PM)X5KillerKlownzX Wrote: [ -> ]void OnStart()
{
AddEntityCollideCallback("Player", "TeleportScript", "NailThatSucker", true, 1);
}

void NailThatSucker(string &in asParent, string &in asChild, int alStates)

{
SetEntityActive("Jesus", true);
AddPropForce("Jesus",10000, 0, 0, "world");
PlaySoundAtEntity("", "24_iron_maiden.snt", "Jesus", 0, false);
}

AddEntityCollideCallBack("Player", "PlayerCollide", "MonsterFunction", true, 1);

void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Badguy", true);
}

void OnEnter()
{

}

void OnLeave()

{

}

AddEntityCollideCallBack("Player", "PlayerCollide", "MonsterFunction", true, 1);
Is your problem. It is has to be declared when something else happens or when you start the map. Change your code to this:
Code:
void OnStart()

{  

    AddEntityCollideCallback("Player", "TeleportScript", "NailThatSucker", true, 1);
    AddEntityCollideCallBack("Player", "PlayerCollide", "MonsterFunction", true, 1);

}



void NailThatSucker(string &in asParent, string &in asChild, int alStates)

{

    SetEntityActive("Jesus", true);

    AddPropForce("Jesus",10000, 0, 0, "world");

    PlaySoundAtEntity("", "24_iron_maiden.snt", "Jesus", 0, false);

}


void MonsterFunction(string &in asParent, string &in asChild, int alState)

{

    SetEntityActive("Badguy", true);

}



void OnEnter()

{



}



void OnLeave()

{



}
Now that we are adding the callback when the map loads up, it should work fine Smile
(04-15-2013, 01:33 AM)ROMul8r Wrote: [ -> ]Where your issue is:
Spoiler below!

(04-14-2013, 11:21 PM)X5KillerKlownzX Wrote: [ -> ]void OnStart()
{
AddEntityCollideCallback("Player", "TeleportScript", "NailThatSucker", true, 1);
}

void NailThatSucker(string &in asParent, string &in asChild, int alStates)

{
SetEntityActive("Jesus", true);
AddPropForce("Jesus",10000, 0, 0, "world");
PlaySoundAtEntity("", "24_iron_maiden.snt", "Jesus", 0, false);
}

AddEntityCollideCallBack("Player", "PlayerCollide", "MonsterFunction", true, 1);

void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Badguy", true);
}

void OnEnter()
{

}

void OnLeave()

{

}

AddEntityCollideCallBack("Player", "PlayerCollide", "MonsterFunction", true, 1);
Is your problem. It is has to be declared when something else happens or when you start the map. Change your code to this:
Code:
void OnStart()

{  

    AddEntityCollideCallback("Player", "TeleportScript", "NailThatSucker", true, 1);
    AddEntityCollideCallBack("Player", "PlayerCollide", "MonsterFunction", true, 1);

}



void NailThatSucker(string &in asParent, string &in asChild, int alStates)

{

    SetEntityActive("Jesus", true);

    AddPropForce("Jesus",10000, 0, 0, "world");

    PlaySoundAtEntity("", "24_iron_maiden.snt", "Jesus", 0, false);

}


void MonsterFunction(string &in asParent, string &in asChild, int alState)

{

    SetEntityActive("Badguy", true);

}



void OnEnter()

{



}



void OnLeave()

{



}
Now that we are adding the callback when the map loads up, it should work fine Smile

I copied and pasted it but i got an error saying, "main (6,6) :ERR : No matching signatures to 'AddEntityCollideCallBack(string@&, string@&, string@&, const bool, const uint)' "

(04-15-2013, 03:28 AM)X5KillerKlownzX Wrote: [ -> ]
(04-15-2013, 01:33 AM)ROMul8r Wrote: [ -> ]Where your issue is:
Spoiler below!

(04-14-2013, 11:21 PM)X5KillerKlownzX Wrote: [ -> ]void OnStart()
{
AddEntityCollideCallback("Player", "TeleportScript", "NailThatSucker", true, 1);
}

void NailThatSucker(string &in asParent, string &in asChild, int alStates)

{
SetEntityActive("Jesus", true);
AddPropForce("Jesus",10000, 0, 0, "world");
PlaySoundAtEntity("", "24_iron_maiden.snt", "Jesus", 0, false);
}

AddEntityCollideCallBack("Player", "PlayerCollide", "MonsterFunction", true, 1);

void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Badguy", true);
}

void OnEnter()
{

}

void OnLeave()

{

}

AddEntityCollideCallBack("Player", "PlayerCollide", "MonsterFunction", true, 1);
Is your problem. It is has to be declared when something else happens or when you start the map. Change your code to this:
Code:
void OnStart()

{  

    AddEntityCollideCallback("Player", "TeleportScript", "NailThatSucker", true, 1);
    AddEntityCollideCallBack("Player", "PlayerCollide", "MonsterFunction", true, 1);

}



void NailThatSucker(string &in asParent, string &in asChild, int alStates)

{

    SetEntityActive("Jesus", true);

    AddPropForce("Jesus",10000, 0, 0, "world");

    PlaySoundAtEntity("", "24_iron_maiden.snt", "Jesus", 0, false);

}


void MonsterFunction(string &in asParent, string &in asChild, int alState)

{

    SetEntityActive("Badguy", true);

}



void OnEnter()

{



}



void OnLeave()

{



}
Now that we are adding the callback when the map loads up, it should work fine Smile

I copied and pasted it but i got an error saying, "main (6,6) :ERR : No matching signatures to 'AddEntityCollideCallBack(string@&, string@&, string@&, const bool, const uint)' "

I mean (6,5)
You'll need a lower case 'B'.

AddEntityCollideCallback
(04-15-2013, 03:53 AM)NaxEla Wrote: [ -> ]You'll need a lower case 'B'.

AddEntityCollideCallback

Thats it? that is the only problem? I feel so dumb that i missed that as well! I completely forgot about that! Thank you so much, You both majorly helped! I will make sure to send you a copy of the map when Im done if that's fine! Thanks Wink
(04-15-2013, 04:21 AM)X5KillerKlownzX Wrote: [ -> ]
(04-15-2013, 03:53 AM)NaxEla Wrote: [ -> ]You'll need a lower case 'B'.

AddEntityCollideCallback

Thats it? that is the only problem? I feel so dumb that i missed that as well! I completely forgot about that! Thank you so much, You both majorly helped! I will make sure to send you a copy of the map when Im done if that's fine! Thanks Wink

Yup! Those little mistakes can be easy to miss.
(04-15-2013, 08:58 AM)NaxEla Wrote: [ -> ]
(04-15-2013, 04:21 AM)X5KillerKlownzX Wrote: [ -> ]
(04-15-2013, 03:53 AM)NaxEla Wrote: [ -> ]You'll need a lower case 'B'.

AddEntityCollideCallback

Thats it? that is the only problem? I feel so dumb that i missed that as well! I completely forgot about that! Thank you so much, You both majorly helped! I will make sure to send you a copy of the map when Im done if that's fine! Thanks Wink

Yup! Those little mistakes can be easy to miss.

Just like how I did, even though I pointed out that there was a problem where it was to begin with!