Enemy Trigger 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: Enemy Trigger problems (/thread-12251.html) |
Enemy Trigger problems - omiwrench8k - 01-01-2012 So what I'm trying to do is to make an enemy active and patrolling when I pick up a key, pretty standard stuff. I can't get it to work though, so if any of you could tell me what I'm doing you'll have my eternal gratitude. void OnStart( ) { //Item & Interaction Callbacks SetEntityCallbackFunc("key_tomb_1", "StartGrunt_1"); void StartGrunt_1(string &in asEntity) { SetEntityActive("servant_grunt_1", true); SetSwingDoorLocked("mansion_2", true, false); SetEntityActive("BoxLight_2", false); SetMessage("Message", "RunMonster", 6); AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, ""); Then some path nodes, etc... RE: Enemy Trigger problems - Statyk - 01-01-2012 You're not closing the parameters of your functions. You need BOTH "{" and "}" this at the end of the function. for example: void OnStart( ) { //Item & Interaction Callbacks SetEntityCallbackFunc("key_tomb_1", "StartGrunt_1"); } RE: Enemy Trigger problems - omiwrench8k - 01-01-2012 Oh haha, I have those, just forgot to copy them. It actually looks like this: void OnStart( ) { //Item & Interaction Callbacks AddUseItemCallback(" ", "key_tower_1", "child_door","UsedKeyOnDoor1", true); SetEntityCallbackFunc("key_tomb_1", "StartGrunt_1"); SetEntityPlayerInteractCallback("LockedDoor1", "DoorLocked1", true); SetEntityPlayerInteractCallback("child_door", "DoorLocked3", true); SetEntityPlayerInteractCallback("hell_door", "DoorLocked2", true); //CollideCallbacks AddEntityCollideCallback("Player", "SeeBlood_1", "DiscoverBlood", true, 1); } void StartGrunt_1(string &in asEntity) { SetEntityActive("servant_grunt_1", true); SetSwingDoorLocked("mansion_2", true, false); SetEntityActive("BoxLight_2", false); SetMessage("Message", "RunMonster", 6); AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, ""); AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, ""); AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, ""); AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, ""); AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, ""); AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, ""); AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, ""); AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, ""); AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, ""); AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 0, ""); AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0, ""); AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 0, ""); AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, ""); AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 0, ""); AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 0, ""); AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_16", 0, ""); AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_17", 0, ""); AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_18", 4, ""); } I just thought I'd copy the important parts. RE: Enemy Trigger problems - Your Computer - 01-01-2012 You've got the syntax for the callback wrong. You're missing the second parameter. RE: Enemy Trigger problems - omiwrench8k - 01-01-2012 Sorry, I'm a noob. Simplify? RE: Enemy Trigger problems - Your Computer - 01-01-2012 You have PHP Code: void StartGrunt_1(string &in asEntity) You need PHP Code: void StartGrunt_1(string &in asEntity, string &in asType) RE: Enemy Trigger problems - omiwrench8k - 01-01-2012 Thanks! That did it! |