![]() |
What means unexpected identifier? - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: What means unexpected identifier? (/thread-15164.html) |
What means unexpected identifier? - Shives - 04-29-2012 The title says everything, what does the error unexpected identifier mean? RE: What means unexpected identifier? - Your Computer - 04-29-2012 Over-simplified: The presence of a name is unexpected. RE: What means unexpected identifier? - FragdaddyXXL - 04-29-2012 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. RE: What means unexpected identifier? - Shives - 04-29-2012 I made a mistake, he doesn't says unexpected identifier, he says expected identifier. So what does this mean? RE: What means unexpected identifier? - FragdaddyXXL - 04-29-2012 (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 meanCan 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. RE: What means unexpected identifier? - Shives - 04-29-2012 My Script The Error says it is in line 112. The red line is line 112, I can't see a mistake there ![]() //////////////////////////// // 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() { } RE: What means unexpected identifier? - FragdaddyXXL - 04-29-2012 "out" is a reserved name. You just need to change "out" to something else, like "Out" or "PlayerOut". |