![]() |
My custom level keeps crashing - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Technical Support (https://www.frictionalgames.com/forum/forum-57.html) +--- Forum: Technical Support - Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-31.html) +--- Thread: My custom level keeps crashing (/thread-7110.html) |
My custom level keeps crashing - Starkiller2000 - 03-30-2011 It keeps saying unexpected end of file, I am trying to make the brute patrol in front of the character patrol out of sight till he collides with a script thingy and then disappear. But it will not work, I need some help. //////////////////////////// // Run when entering map void OnEnter() { AddEnemyPatrolNode(servant_brute_1","PathNodeArea_1",0,""); { AddEnemyPatrolNode("servant_brute_1","PathNodeArea_2",4,""); { } } } void EnemyDisabled(string &in asEntity, string &in asType) { if(GetEntitiesCollide("servant_brute_1", "ScriptArea_1")) { SetPropActiveAndFade("servant_brute_1", true, 0.5f); } } //////////////////////////// // Run when leaving map void OnLeave() { } RE: My custom level keeps crashing - Tanshaydar - 03-30-2011 You have too many unnecessary {'s and }'s. These are to open and close function blocks. Not for fancy look. Code: //////////////////////////// RE: My custom level keeps crashing - Starkiller2000 - 03-30-2011 I tried that and it did not work, it said unexpected end of file. Here is the revised code. Also does it look right, as in everything like the monster disappearing should work? Also they were not their for fancy look, they were there because i saw a forum about monster patrolling and that is what the code looked like. //////////////////////////// // Run when entering map void OnEnter() { SetEntityActive("servant_grunt_1", true); AddUseItemCallback("", "key_tomb_rusty_1", "sewer_arched_1", "UsedKeyOnDoor", true); AddUseItemCallback("", "key_tomb_1", "hatch_ceiling_1", "UsedKeyOnDoor1", true); } void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("sewer_arched_1", false, true); PlaySoundAtEntity("", "unlock_door", "sewer_arched_1", 0, false); RemoveItem("key_tomb_rusty_1"); } void UsedKeyOnDoor1(string &in asItem, string &in asEntity) { SetSwingDoorLocked("hatch_ceiling_1", false, true); ChangeMap("level2.map", "PlayerStartArea_1", "", ""); } //////////////////////////// // Run when leaving map void OnLeave() { } RE: My custom level keeps crashing - Tanshaydar - 03-31-2011 If you are going to activate the grunt upon entering map, why not letting it already activated? I mean this is for the code just you wrote. Other code would not work, because you didn't call the function EnemyDisabled anywhere in your script. It's not an interaction function either. You should understand that one piece of code serves to the coder's intention. It's not to work under every circumstances. You need to look at wiki. RE: My custom level keeps crashing - Starkiller2000 - 03-31-2011 oh, well any suggestions? I have looked on the wiki and all over the internet and there are relatively resources for learning how to script for amnesia. RE: My custom level keeps crashing - Tanshaydar - 04-01-2011 http://wiki.frictionalgames.com/hpl2/tutorials/script/tutorial_1 This might be a good start. |