Expected Scriptline? - 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 Scriptline? (/thread-15234.html) |
Expected Scriptline? - P44RTHURN4X - 05-03-2012 Hey all, I started a new custom story project last week and in the 1st map was this: FATAL ERROR:Could not load script file '...'! main (29,1): ERR :Expected ';' my .hps file: //////////////////////////// //Run first time starting map void OnStart() { PlayMusic("race_menu.ogg", true, 1.0f, 0.5f, 0, true); SetPlayerActive(false); SetInventoryDisabled(true); SetPlayerCrouchDisabled(true); StartPlayerLookAt("enemy2_1", 10.0f, 8.7f, ""); AddTimer("lookat_timer", 4.0f, "sla1"); SetEnemyDisableTriggers("enemy2_1", true); SetEnemyDisableTriggers("enemy2_2", true); SetEnemyDisableTriggers("enemy2_3", true); AddEnemyPatrolNode("enemy2_1", "PathNodeArea_1", 20, "idle.anm"); AddEnemyPatrolNode("enemy2_1", "PathNodeArea_4", 0, "attack_run.anm"); AddEnemyPatrolNode("enemy2_2", "PathNodeArea_2", 20, "idle.anm"); AddEnemyPatrolNode("enemy2_2", "PathNodeArea_5", 0, "attack_run.anm"); AddEnemyPatrolNode("enemy2_3", "PathNodeArea_3", 20, "idle.anm"); AddEnemyPatrolNode("enemy2_3", "PathNodeArea_6", 0, "attack_run.anm"); AddEntityCollideCallback("Player", "end_scf", "EndP", true, 1); AddEntityCollideCallback("enemy2_1", "end_scf", "EndE", true, 1); AddEntityCollideCallback("enemy2_2", "end_scf", "EndE", true, 1); AddEntityCollideCallback("enemy2_3", "end_scf", "EndE", true, 1); AddEntityCollideCallback("Player", "speed_one", "SpeedUp_1", true, 1); AddEntityCollideCallback("enemy2_1", "speed_one", "SwitchEntity_1", true, 1); AddEntityCollideCallback("enemy2_2", "speed_one", "SwitchEntity_2", true, 1); AddEntityCollideCallback("enemy2_3", "speed_one", "SwitchEntity_3", true, 1); AddEntityCollideCallback("Player", "speed_one_1", "SpeedUp_2", true, 1) *THIS IS LINE 29* AddEntityCollideCallback("enemy2_1_2", "speed_one_1", "SwitchEntity_1_2", true, 1); AddEntityCollideCallback("enemy2_2_2", "speed_one_1", "SwitchEntity_2_2", true, 1); AddEntityCollideCallback("enemy2_3_2", "speed_one_1", "SwitchEntity_3_2", true, 1); } void sla1(string &in asTimer) { StopPlayerLookAt(); StartPlayerLookAt("enemy2_2", 12.0f, 10.0f, ""); AddTimer("lookat_timer", 3.0f, "sla2"); } void sla2(string &in asTimer) { StopPlayerLookAt(); StartPlayerLookAt("enemy2_3", 3.0f, 1.0f, ""); AddTimer("lookat_timer", 2.2f, "sla3"); } void sla3(string &in asTimer) { StopPlayerLookAt(); StartPlayerLookAt("PathNodeArea_2", 7.0f, 7.0f, ""); AddTimer("lookat_timer", 2.34f, "sla4"); } void sla4(string &in asTimer) { PlayMusic("race_start.ogg", true, 1.0f, 1.0f, 0, true); StopPlayerLookAt(); AddTimer("lookat_timer", 1.0f, "start"); } void start(string &in asTimer) { StopMusic(1.0f, 0); SetPlayerActive(true); SetPlayerMoveSpeedMul(1000); SetPlayerRunSpeedMul(99999); } void EndP(string &in asParent, string &in asChild, int alState) { SetPlayerActive(true); StopMusic(1.0f, 0); PlayMusic("race_win.ogg", true, 1.0f, 1.0f, 0, true); StartEffectFlash(0.0f, 0.6f, 0.3f); } void EndE(string &in asEntity) { SetEnemyDisableTriggers("enemy2_1", false); SetEnemyDisableTriggers("enemy2_2", false); SetEnemyDisableTriggers("enemy2_3", false); ShowEnemyPlayerPosition("enemy2_1"); ShowEnemyPlayerPosition("enemy2_2"); ShowEnemyPlayerPosition("enemy2_3"); SetPlayerActive(false); StopMusic(1.0f, 0); PlayMusic("race_lose.ogg", true, 1.0f, 1.0f, 0, true); StartEffectFlash(0.0f, 0.6f, 0.3f); } void SpeedUp_1(string &in asParent, string &in asChild, int alState) { SetPlayerMoveSpeedMul(50); SetPlayerRunSpeedMul(100); } void SwitchEntity_1(string &in asEntity) { SetEntityActive("enemy2_1", false); SetEntityActive("enemy2_1_2", true); AddEnemyPatrolNode("enemy2_1_2", "PathNodeArea_4", 0, "attack_run.anm"); } void SwitchEntity_2(string &in asEntity) { SetEntityActive("enemy2_2", false); SetEntityActive("enemy2_2_2", true); AddEnemyPatrolNode("enemy2_2_2", "PathNodeArea_5", 0, "attack_run.anm"); } void SwitchEntity_3(string &in asEntity) { SetEntityActive("enemy2_3", false); SetEntityActive("enemy2_3_2", true); AddEnemyPatrolNode("enemy2_3_2", "PathNodeArea_6", 0, "attack_run.anm"); } void SpeedUp_2(string &in asParent, string &in asChild, int alState) { SetPlayerMoveSpeedMul(250); SetPlayerRunSpeedMul(500); } void SwitchEntity_1_2(string &in asEntity) { SetEntityActive("enemy2_1", false); SetEntityActive("enemy2_1_3", true); AddEnemyPatrolNode("enemy2_1_3", "PathNodeArea_4", 0, "attack_run.anm"); } void SwitchEntity_2_2(string &in asEntity) { SetEntityActive("enemy2_2", false); SetEntityActive("enemy2_2_3", true); AddEnemyPatrolNode("enemy2_2_3", "PathNodeArea_5", 0, "attack_run.anm"); } void SwitchEntity_3_2(string &in asEntity) { SetEntityActive("enemy2_3", false); SetEntityActive("enemy2_3_3", true); AddEnemyPatrolNode("enemy2_3_3", "PathNodeArea_6", 0, "attack_run.anm"); } I cannot find a fail at line 29, and I don't know what's wrong with the ; Did you find it? RE: Expected Scriptline? - Oscar House - 05-03-2012 Simply, you forgot a ; from the end of one of the AddEntityCollideCallBacks, the one right above line 29. RE: Expected Scriptline? - Elven - 05-04-2012 I also want to add that to for yourself: If you get error like this: main (29,1): ERR :Expected ';' Then the (x, y) i the place, around where error is. 29 is line and 1 is the symbol number. In that case you had error on 29th line and the problem was most likely that you were missing ; symbol, as above poster stated ! |