Expected " ; " - 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: Expected " ; " (/thread-14196.html) |
Expected " ; " - Shives - 03-24-2012 Hi Problem: Error Expected " ; " Expected " ; " I think I've done everything right,but it looks like there are missing 2 ";" //////////////////////////// // Run first time starting map void OnStart() { SetLocalVarInt("Var01", 0); SetLightVisible("PointLight_3", false); AddEntityCollideCallback("Player", "ScriptArea_4", "Sound", true, 1); AddEntityCollideCallback("Player", "ScriptArea_3", "Wind", true, 1); SetEntityCallbackFunc("crowbar_1", "picker"); AddEntityCollideCallback("Player", "ScriptArea_6", "Soundz", true, 1); AddEntityCollideCallback("Player", "ScriptArea_9", "Heartbeat", true, 1); AddEntityCollideCallback("Player", "ScriptArea_10", "StopHeart", true, 1); SetEntityPlayerInteractCallback("chest_small_1", "Spieluhr", true); AddEntityCollideCallback("Player", "ScriptArea_11", "Shadow", true, 1); AddEntityCollideCallback("Player", "ScriptArea_5", "Monster", true, 1); AddEntityCollideCallback("Player", "ScriptArea_8", "closet", true, 1); } void Sound(string &in asParent, string &in asChild, int alState) { PlaySoundAtEntity("", "guardian_distant1.snt", "Player", 0, false); } void picker(string &in asEntity, string &in type) { SetEntityActive("ScriptArea_3", true); SetEntityActive("ScriptArea_11", true); } void Wind(string &in asParent, string &in asChild, int alState) { AddPropImpulse("chandelier_simple_short_1", 0, 0, 3, "world"); DestroyParticleSystem("ParticleSystem_2"); DestroyParticleSystem("ParticleSystem_1"); SetLightVisible("PointLight_1", false); SetLightVisible("PointLight_2", false); GiveSanityDamage(1.0f, true); CreateParticleSystemAtEntity("", "ps_dust_push_15.ps", "ScriptArea_1", false); CreateParticleSystemAtEntity("", "ps_dust_push_15.ps", "ScriptArea_2", false); PlaySoundAtEntity("", "scare_wind.snt", "Player", 0, false); SetLampLit("chandelier_simple_short_1", false, true); } void Heartbeat(string &in asParent, string &in asChild, int alState) { PlaySoundAtEntity("Heartbeat", "Heart.snt", "chest_small_1", 0, false); StartPlayerLookAt("chest_small_1", 2, 1, "StopPlayerLookAt"); GiveSanityDamage(1.0f, true); SetLightVisible("PointLight_3", true); } void StopHeart(string &in asParent, string &in asChild, int alState) { SetLightVisible("PointLight_3", false); StopSound("Heartbeat", 2); } void Spieluhr(string &in asEntity) { AddTimer("", 2, "Musik"); } void Musik(string &in asTimer) { SetEntityActive("ScriptArea_8", true); SetEntityActive("ScriptArea_5", true); PlaySoundAtEntity("", "Spieluhr.snt", "chest_small_1", 0, false); } void Shadow(string &in asParent, string &in asChild, int alState) { AddTimer("", 1, "weg"); AddPropImpulse("grunt", 0, 0, 10, "world"); SetEntityActive("grunt", true); GiveSanityDamage(1.0f, true); } void weg(string &in asTimer) { SetEntityActive("grunt", false); } void Soundz(string &in asParent, string &in asChild, int alState) { PlaySoundAtEntity("", "amb_idle_whimp.snt", "Player", 0, false); } void Monster(string &in asParent, string &in asChild, int alState) { SetEntityActive("servant_grunt_1", true); AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, ""); AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, ""); AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, ""); AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, ""); } void closet(string &in asParent, string &in asChild, int alState) { if(GetLocalVarInt("Var01") == 0) { AddTimer("", 20, "gruntawayer"); AddEntityCollideCallback("Player", "ScriptArea_14", "gruntaway", false, 1); } } void gruntawayer(string &in asTimer) { AddLocalVarInt("Var01", 1); SetEntityActive("ScriptArea_12", true); AddEntityCollideCallback("Player", "ScriptArea_12", "gw", false, 1); "gruntaway"(); } void gw(string &in asParent, string &in asChild, int alState) { AddEntityCollideCallback("Player", "ScriptArea_13", "gruntaway", false, 1); SetEntityActive("ScriptArea_13", true); AddLocalVarInt("Var01", 1); "gruntaway"(); } void gruntaway(string &in asParent, string &in asChild, int alState) { if (GetLocalVarInt("Var01") == 2) { FadeEnemyToSmoke("servant_grunt_1", true); } else { SetLocalVarInt("Var01", 0); AddEntityCollideCallback("Player", "ScriptArea_8", "closet", false, 1); } } //////////////////////////// // Run when entering map void OnEnter() { } //////////////////////////// // Run when leaving map void OnLeave() { } RE: Expected " ; " - SilentStriker - 03-24-2012 It may be the gruntaway script, because I don't think it's supposed to have "" RE: Expected " ; " - Shives - 03-24-2012 What should have no "" I don't know RE: Expected " ; " - SilentStriker - 03-24-2012 "gruntaway"(); But where does the error say the error is? like 127,3 expected ";" or something like that? RE: Expected " ; " - Shives - 03-24-2012 Yes it says something like this Now I removed the "" at both Gruntaways New Problem No matching signatures to 'gruntaway()' RE: Expected " ; " - SilentStriker - 03-24-2012 change so you have gruntaway(); and then change void gruntaway to void gruntaway() { if (GetLocalVarInt("Var01") == 2) { FadeEnemyToSmoke("servant_grunt_1", true); } else { SetLocalVarInt("Var01", 0); AddEntityCollideCallback("Player", "ScriptArea_8", "closet", false, 1); } |