![]() |
Hey! I'm new to scripting, need some help. - 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: Hey! I'm new to scripting, need some help. (/thread-15559.html) |
Hey! I'm new to scripting, need some help. - LinneaLuna - 05-22-2012 Hey guys! I'm a complete noob when it comes to making maps and scripting, and I've been struggling for hours for such a simple script, and I'm starting to feel stupid lol. The game crashes when I start my Custom Story, and I'm using this script: void OnStart() { if(ScriptDebugOn()) { AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true); AddEntityCollideCallback("Player", "ScriptArea_1", "ActivateMonster", true, 1); SetEntityConnectionStateChangeCallback("lever_simple01_1", "func_secret_1"); } void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("door_1", false, true); PlaySoundAtEntity("", "unlock_door.snt", "door_1", 0.0f, false); RemoveItem("key_1"); AddDebugMessage("KeyOnDoor", false); } void ActivateMonster(string &in asParent, string &in asChild, int alState) { SetEntityActive("servant_brutehot_1", true); AddEnemyPatrolNode("servant_brutehot_1", "PathNodeArea_1", 0, "Idle"); AddEnemyPatrolNode("servant_brutehot_1", "PathNodeArea_2", 0, "Idle"); } void func_secret_1(string &in asEntity, int alState) { if (alState == 1) { SetMoveObjectState("secret_1",1.0f); PlaySoundAtEntity("", "quest_completed.snt", "secret_1_move_1", 0, false); return; } void OnEnter() { } void OnLeave() { } Ok, so, please tell me the mistakes and how to improve, would be awesome. ^^ RE: Hey! I'm new to scripting, need some help. - Datguy5 - 05-22-2012 You could tell us what the crash report says.Would make this a bit easier. RE: Hey! I'm new to scripting, need some help. - i3670 - 05-22-2012 The only thing that points out for me is the beginning void OnStart() { if(ScriptDebugOn()) { AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true); AddEntityCollideCallback("Player", "ScriptArea_1", "ActivateMonster", true, 1); SetEntityConnectionStateChangeCallback("lever_simple01_1", "func_secret_1"); } You have 2 { and only 1 } RE: Hey! I'm new to scripting, need some help. - LinneaLuna - 05-22-2012 (05-22-2012, 04:36 PM)Datguy5 Wrote: You could tell us what the crash report says.Would make this a bit easier.Ah, yes of course. ^^ FATAL ERROR: Could not load script file 'Custom_stories/Claustrophobia/fart/claustrophobia.hps'! main (43,2) : ERR : Unexpected end of file (05-22-2012, 04:36 PM)i3670 Wrote: The only thing that points out for me is the beginningAh yes, I can see that. >.< Thanks! RE: Hey! I'm new to scripting, need some help. - i3670 - 05-22-2012 Hope it worked out and no problems. |