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
Identifier error! Help!
X5KillerKlownzX Offline
Junior Member

Posts: 6
Threads: 2
Joined: Apr 2013
Reputation: 0
#1
Identifier error! Help!

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!
04-14-2013, 11:21 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#2
RE: Identifier error! 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:
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

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 04-15-2013, 01:38 AM by Romulator.)
04-15-2013, 01:33 AM
Find
X5KillerKlownzX Offline
Junior Member

Posts: 6
Threads: 2
Joined: Apr 2013
Reputation: 0
#3
RE: Identifier error! Help!

(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:
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:
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)
(This post was last modified: 04-15-2013, 03:36 AM by X5KillerKlownzX.)
04-15-2013, 03:28 AM
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#4
RE: Identifier error! Help!

You'll need a lower case 'B'.

AddEntityCollideCallback

In Ruins [WIP]
04-15-2013, 03:53 AM
Find
X5KillerKlownzX Offline
Junior Member

Posts: 6
Threads: 2
Joined: Apr 2013
Reputation: 0
#5
RE: Identifier error! Help!

(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
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#6
RE: Identifier error! Help!

(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.

In Ruins [WIP]
04-15-2013, 08:58 AM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#7
RE: Identifier error! Help!

(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!

Discord: Romulator#0001
[Image: 3f6f01a904.png]
04-15-2013, 10:30 AM
Find




Users browsing this thread: 1 Guest(s)