Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What means unexpected identifier?
Author Message
Shives Offline
Member

Posts: 154
Joined: Jan 2012
Reputation: 1
Post: #1
What means unexpected identifier?

The title says everything, what does the error unexpected identifier mean?

My Custom Story
http://www.frictionalgames.com/forum/thread-12587.html

Sorry for bad English


04-29-2012 09:42 AM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,474
Joined: Jul 2011
Reputation: 234
Post: #2
RE: What means unexpected identifier?

Over-simplified: The presence of a name is unexpected.

Tutorials: From Noob to Pro
04-29-2012 09:54 AM
Visit this user's website Find all posts by this user Quote this message in a reply
FragdaddyXXL Offline
Member

Posts: 136
Joined: Apr 2012
Reputation: 7
Post: #3
RE: What means unexpected identifier?

Less-simplified: you are trying to use a variable that does not exist. Either it's a typo, or you forgot to declare a variable before you used it. I think same goes for functions calls, but not sure.

EDIT:
You probably have a typo somewhere. Check and make sure your curly brackets are all closed off "{}" and same goes for parenthesis.

Dark Seclusion Here
(This post was last modified: 04-29-2012 10:12 AM by FragdaddyXXL.)
04-29-2012 10:08 AM
Find all posts by this user Quote this message in a reply
Shives Offline
Member

Posts: 154
Joined: Jan 2012
Reputation: 1
Post: #4
RE: What means unexpected identifier?

I made a mistake, he doesn't says unexpected identifier, he says expected identifier. So what does this mean?

My Custom Story
http://www.frictionalgames.com/forum/thread-12587.html

Sorry for bad English


04-29-2012 10:55 AM
Find all posts by this user Quote this message in a reply
FragdaddyXXL Offline
Member

Posts: 136
Joined: Apr 2012
Reputation: 7
Post: #5
RE: What means unexpected identifier?

(04-29-2012 10:55 AM)Shives Wrote:  I made a mistake, he doesn't says unexpected identifier, he says expected identifier. So what does this mean
Can you tell us if the error says something about where the problem is?

Usually something like: main(12, 4), ERR.
In my example, 12 is the line in which that the error occurs. If you have Notepad++, you should be able to see where, for example, line 12 is.

Dark Seclusion Here
04-29-2012 11:32 AM
Find all posts by this user Quote this message in a reply
Shives Offline
Member

Posts: 154
Joined: Jan 2012
Reputation: 1
Post: #6
RE: What means unexpected identifier?

My Script

The Error says it is in line 112.

The red line is line 112, I can't see a mistake there Huh

////////////////////////////
// Run first time starting map
void OnStart()
{
SetEntityCallbackFunc("Caution", "Note");
AddUseItemCallback("", "Key_1", "Door_1", "Schlussel", true);
AddUseItemCallback("", "Key_2", "Door_2", "Keyratsel", true);
AddEntityCollideCallback("Player", "Area_2", "VaseofTerror", true, 1);
AddEntityCollideCallback("Player", "Area_3", "Grunt", true, 1);
AddEntityCollideCallback("Player", "Area_1", "Bild", true, 1);
AddEntityCollideCallback("Player", "Area_5", "R", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_1", "Quitsch", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "Boom", true, 1);
AddEntityCollideCallback("Player", "Area_4", "Roar", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_11", "out", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_14", "guardia", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "noise", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "feet", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_7", "piano", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_6", "idle", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_5", "runta", true, 1);
AddEntityCollideCallback("vase02_1", "ScriptArea_16", "sanity", true, 1);
}
void Note(string &in asEntity, string &in type)
{
SetEntityActive("Area_4", true);
}
void Schlussel(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "Door_1", 0, false);
RemoveItem("Key_1");
}
void Keyratsel(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door_2", false, true);
PlaySoundAtEntity("", "unlock_door", "Door_2", 0, false);
RemoveItem("Key_2");
}
void VaseofTerror(string &in asParent, string &in asChild, int alState)
{
AddPropImpulse("Vase", -5, 0, -8, "world");
GiveSanityDamage(9.0f, true);
}
void Grunt(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Grunt_1", true);
ShowEnemyPlayerPosition("Grunt_1");
}
void Bild(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ScriptArea_7", true);
SetEntityActive("piano_1", false);
GiveSanityDamage(9.0f, true);
SetEntityActive("piano_1", false);
SetEntityActive("Pot", false);
PlaySoundAtEntity("", "guardian_distant1.snt", "Player", 0, false);
StartScreenShake(0.2f, 3, 0.3f, 0.2f);
SetEntityActive("S_1", true);
SetEntityActive("S_2", true);
SetEntityActive("S_3", true);
SetEntityActive("S_4", true);
SetEntityActive("S_5", true);
SetEntityActive("S_6", true);
SetEntityActive("S_7", true);
SetEntityActive("S_8", true);
SetEntityActive("S_9", true);
}
void R(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("armour_nice_complete_1", true);
SetEntityActive("armour_nice_complete_2", true);
SetEntityActive("armour_nice_complete_3", true);
SetEntityActive("armour_nice_complete_4", true);
SetEntityActive("armour_nice_complete_5", true);
SetEntityActive("armour_nice_complete_6", true);
SetEntityActive("armour_nice_complete_7", true);
GiveSanityDamage(100.0f, true);
}
void Quitsch(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage( 4, true);
SetSwingDoorDisableAutoClose("mansion_2", true);
SetSwingDoorClosed("mansion_2",false, true);
AddPropForce("mansion_2", 0, 0, 900, "world");
PlaySoundAtEntity("", "Door.snt", "Player", 0, false);
}
void Boom(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage( 4, true);
CreateParticleSystemAtEntity("", "ps_door_damage_wood.ps", "particle_1", false);
CreateParticleSystemAtEntity("", "ps_dust_impact_vert.ps", "particle_1", false);
AddPropForce("Door_2", 0, 0, 1000, "world");
PlaySoundAtEntity("", "hit_wood.snt", "Player", 0, false);
AddTimer("", 1, "Boom_2");
}
void Boom_2(string &in asTimer)
{
GiveSanityDamage( 4, true);
CreateParticleSystemAtEntity("", "ps_door_damage_wood.ps", "particle_1", false);
CreateParticleSystemAtEntity("", "ps_dust_impact_vert.ps", "particle_1", false);
AddPropForce("Door_2", 0, 0, 1000, "world");
PlaySoundAtEntity("", "hit_wood.snt", "Player", 0, false);
}
void Roar(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "Monster.snt", "Player", 0, false);
StartScreenShake(0.4f, 4, 0.3f, 0.5f);
CreateParticleSystemAtEntity("", "ps_dust_break_25.ps", "particle_1", false);
GiveSanityDamage( 1.0f, true);
}
void out(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "11_owl.snt", "ScriptArea_13", 0, false);
GiveSanityDamage( 1.0f, true);
}
void guardia(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "11_forest_minor.snt", "ScriptArea_15", 0, false);
GiveSanityDamage( 1.0f, true);
}
void noise(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "guardian_distant2.snt", "ScriptArea_9", 0, false);
GiveSanityDamage( 1.0f, true);
}
void feet(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "04_big_feet.snt", "ScriptArea_10", 0, false);
}
void piano(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "general_piano02.snt", "Player", 0, false);
}
void idle(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "amb_idle_whimp.snt", "ScriptArea_8", 0, false);
}
void runta(string &in asParent, string &in asChild, int alState)
{
AddPropImpulse("vase02_1", 0, 0, 2, "world");
}
void sanity(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage( 1.0f, true);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
PlayMusic("16_amb.ogg", true, 0.7, 3, 0, true);
FadeOut(0);
FadeIn(8);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

My Custom Story
http://www.frictionalgames.com/forum/thread-12587.html

Sorry for bad English


04-29-2012 11:39 AM
Find all posts by this user Quote this message in a reply
FragdaddyXXL Offline
Member

Posts: 136
Joined: Apr 2012
Reputation: 7
Post: #7
RE: What means unexpected identifier?

"out" is a reserved name. You just need to change "out" to something else, like "Out" or "PlayerOut".

Dark Seclusion Here
04-29-2012 11:44 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: