Script problems - 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: Script problems (/thread-19359.html) |
Script problems - justin - 11-26-2012 Hello, (first im german,so my english is very bad ) I maked a custom story, but if I start it, there appears a message: FATAL ERROR :Could not load script file "custom_stories/Die Flucht/maps/Die Flucht.hps"! main (98.2): ERR :Unexpected end of file.... thats my hps file: The error is in the last line after the } pls help .thanks void OnStart() { AddUseItemCallback("", "key_tomb_1", "mansion_1", "UsedKeyOnDoor", true); AddEntityCollideCallback("Player", "event", "event1", true, 1); SetEntityCallbackFunc("schraube", "OnPickup"); AddEntityCollideCallback("Player", "infa", "startinf", true, 1); AddEntityCollideCallback("inf", "infent", "entinf", true, 1); AddUseItemCallback("", "key2", "tuer2", "UsedKeyOnDoor2", true); AddEntityCollideCallback("stuhl,wandbrechen,brech, true, 1); AddEntityCollideCallback("player", "vatera", "vaterevent", true, 1); } void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("mansion_1", false, false); PlaySoundAtEntity("", "unlock_door.snt", "mansion_1", 0, false); RemoveItem("key_tomb_1"); } void event1(string &in asParent, string &in asChild, int alState) { PlaySoundAtEntity("", "amb_idle.snt", "Player", 0, false); GiveSanityDamage(5.0f, true); SetPlayerActive(false); SetMessage("Message", "intro1", 3); StartPlayerLookAt("abc", 2, 2, ""); AddTimer("", 3.5f, "gerausch"); } void gerausch(string &in asTimer) { StopPlayerLookAt(); SetPlayerActive(true); } void OnPickup(string &in asEntity, string &in type) { SetMessage("Message", "schraubea", 3); GiveSanityBoostSmall(); } void startinf(string &in asParent, string &in asChild, int alState) { SetEntityActive("inf", "true"); AddEnemyPatrolNode("inf", "PathNodeArea_1", 5, ""); AddEnemyPatrolNode("inf", "PathNodeArea_2", 0.001, ""); AddEnemyPatrolNode("inf", "PathNodeArea_3", 0.001, ""); AddEnemyPatrolNode("inf", "PathNodeArea_4", 0.001, ""); AddEnemyPatrolNode("inf", "PathNodeArea_5", 0.001, ""); AddEnemyPatrolNode("inf", "PathNodeArea_6", 0.001, ""); AddEnemyPatrolNode("inf", "PathNodeArea_7", 0.001, ""); AddEnemyPatrolNode("inf", "PathNodeArea_8", 0.001, ""); AddEnemyPatrolNode("inf", "PathNodeArea_9", 0.001, ""); AddEnemyPatrolNode("inf", "PathNodeArea_10", 0.001, ""); AddEnemyPatrolNode("inf", "PathNodeArea_11", 0.001, ""); AddEnemyPatrolNode("inf", "PathNodeArea_12", 0.001, ""); AddEnemyPatrolNode("inf", "PathNodeArea_13", 0.001, ""); AddEnemyPatrolNode("inf", "PathNodeArea_14", 0.001, ""); AddEnemyPatrolNode("inf", "PathNodeArea_15", 0.001, ""); SetMessage("Message", "versteck", 3); } void entinf(string &in asParent, string &in asChild, int alState) { SetEntityActive("inf", false); PlaySoundAtEntity("", "quest_completed.snt", "Player", 0, false); SetMessage("Message", "weg", 2); } void UsedKeyOnDoor2(string &in asItem, string &in asEntity) { SetSwingDoorLocked("tuer2", false, false); PlaySoundAtEntity("", "unlock_door.snt", "mansion_1", 0, false); RemoveItem("key2"); } void brech(string &in asParent, string &in asChild, int alState) { SetMessage("Message", "geschafft", 3); PlaySoundAtEntity("", "break_wood_metal.snt", "Player", 0, false); PlaySoundAtEntity("", "quest_completed.snt", "Player", 0, false); GiveSanityBoostSmall(); SetEntityActive("zu", false); SetEntityActive("offen", true); StartScreenShake(0.01,0,0,2.9); } void vaterevent(string &in asParent, string &in asChild, int alState) { StartPlayerLookAt("vater", 3, 3, ""); AddTimer("", 2.0f, "vaterend"); SetMessage("Message", "vateraa", 3); } void vaterend(string &in asTimer) { StopPlayerLookAt(); } Here is the error...... RE: Script problems - FlawlessHappiness - 11-26-2012 The error "Unexpected end of file" means that somewhere you placed 1 " or ( or { where there actually should be 2 like this: "" or () or {} I found a line where you forgot them. Try placing it the right way. Here is the line: AddEntityCollideCallback("stuhl,wandbrechen,brech, true, 1); You forgot it at the end of "stuhl" and on both sides of "wandbrechen", and "brech" RE: Script problems - The chaser - 11-26-2012 void OnStart() { AddUseItemCallback("", "key_tomb_1", "mansion_1", "UsedKeyOnDoor", true); AddEntityCollideCallback("Player", "event", "event1", true, 1); SetEntityCallbackFunc("schraube", "OnPickup"); AddEntityCollideCallback("Player", "infa", "startinf", true, 1); AddEntityCollideCallback("inf", "infent", "entinf", true, 1); AddUseItemCallback("", "key2", "tuer2", "UsedKeyOnDoor2", true); AddEntityCollideCallback("stuhl,wandbrechen,brech, true, 1); AddEntityCollideCallback("player", "vatera", "vaterevent", true, 1); } You have that without ""'s. It should be (I think so): AddEntityCollideCallback("stuhl","wandbrechen","brech", true, 1); Edit: Ninja'd by beecake RE: Script problems - FlawlessHappiness - 11-26-2012 Again haha Sorry RE: Script problems - justin - 11-27-2012 thanks it works |