Pathnodes 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: Pathnodes help! (/thread-14086.html) |
Pathnodes help! - johan116360 - 03-18-2012 Hi, im working on a custom story but im trying to do pathnodes but it never works. plz help and heres the code: void OnStart() { AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1); SetEntityCallbackFunc("key1", "OnPickup"); AddUseItemCallback("", "key1", "mansion_1", "UsedKeyOnDoor", true); SetEntityCallbackFunc("crowbar_1", "OnPickups"); AddEntityCollideCallback("Player", "ScriptArea_1", "MonsterFunction", true, 1); { void MonsterFunction(string &in asParent, string &in asChild, int alState) { SetEntityActive("monster_a", true); AddEnemyPatrolNode("monster_a", "PathNodeArea_1", 2, ""); AddEnemyPatrolNode("monster_a", "PathNodeArea_2", 0, ""); AddEnemyPatrolNode("monster_a", "PathNodeArea_4", 0, ""); AddEnemyPatrolNode("monster_a", "PathNodeArea_5", 0, ""); AddEnemyPatrolNode("monster_a", "PathNodeArea_6", 4, ""); } void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("mansion_1", false, true); PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false); RemoveItem("key1"); } void OnPickup(string &in asEntity, string &in type) { SetEntityActive("servant_grunt_1", true); ShowEnemyPlayerPosition("servant_grunt_1"); } void func_slam(string &in asParent, string &in asChild, int alState) { SetPropHealth("door1", 0.0f); PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false); PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false); GiveSanityDamage(5.0f, true); } void OnLeave() { } RE: Pathnodes help! - Adny - 03-18-2012 If that is the exact copy of the script, it'd be worth mentioning that the " {" at the bottom of your onStart() is backwards, it should be "}" . If that doesn't have any effect, try adding: ClearEnemyPatrolNodes(string& asEnemyName); right in between setting the entity active, and adding the nodes. Hope that helps RE: Pathnodes help! - johan116360 - 03-19-2012 TY buth befor you posted that i saw that the { was wrong but thanks for relpying. |