OnPlayerSpotted??? - 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: OnPlayerSpotted??? (/thread-13954.html) |
OnPlayerSpotted??? - FlawlessHappiness - 03-12-2012 Is there a script for something like OnPlayerSpotted("Monster", false) { } So when it is not searching anymore something triggers? RE: OnPlayerSpotted??? - Your Computer - 03-12-2012 Nope. RE: OnPlayerSpotted??? - Apjjm - 03-12-2012 If you want to test if the enemy has de-spawned you might be able to do that with a large script area covering your map and a timer which performs a collision test between the enemy and the script area. Testing if the player is seen by the monster isn't going to be possible in the general case, but there may be a hack/solution for your specific scenario if you could elaborate. RE: OnPlayerSpotted??? - FlawlessHappiness - 03-12-2012 I just want the monster to, when it's not searching, go back to where it came from. Is it possible? EDIT: and stay there EDIT: Does it work if i make a pathnode? Then i guess it will return to the pathnode, and then get deactivated. Then when i interact with the door, it will activate again. RE: OnPlayerSpotted??? - SilentStriker - 03-12-2012 The game works that when the Monster isn't chasing you he goes back to the last Path node he walked to. I think RE: OnPlayerSpotted??? - Your Computer - 03-12-2012 When the monster gives up searching for the player, it returns back to where it started and continues on its path (set by path nodes). The monster will get deactivated if the player is out of the monster's activation distance and if the player isn't staring at it. Reactivating the monster after it's been deactivated depends on whether or not it killed the player (though my memory on this is a bit lacking). RE: OnPlayerSpotted??? - FlawlessHappiness - 03-12-2012 Nice! I did it Here is my script if anyone wants it! What happens is that when i touch the door, the monster gets active, and when i walk in the door it gets player position, but only if the monster is in that room. void OnStart() { SetEntityPlayerInteractCallback("door_teacher", "OnInteract", false); AddEntityCollideCallback("player", "playercollide1", "IfMonsterCollide", true, 1); } void IfMonsterCollide(string &in asParent, string &in asChild, int alState) { GetEntitiesCollide("monsterteacher1", "monstercollide1"); if(true) { ShowEnemyPlayerPosition("monsterteacher1"); } } void OnInteract(string &in asEntity) { SetEntityActive("monster_teacher1", true); AddEnemyPatrolNode("monster_teacher1", "PathNodeArea_1", 2, ""); } |