Frictional Games Forum (read-only)
Help with Enemies - 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: Help with Enemies (/thread-12195.html)



Help with Enemies - Randomguy9900 - 12-30-2011

So I have two problems, one of which I really have no idea how to fix.
In the main story of Amnesia, you hide when the monster is looking for you, and he eventually goes away. How do you get him to go away after he loses you after he finds you?
Also, is there a way to make him spawn when a certain thing happens, but make no noise?

Thank you.



RE: Help with Enemies - Statyk - 12-30-2011

To have a monster de-spawn, you can do a few things.

1) You could set a path for the monster to follow and put a script area in the path. Then run a script so that when the MONSTER collides with the SCRIPT AREA, it runs "SetEntityActive("MONSTERNAME", false);".... This will set him inactive, or in other words, remove him from the game.

2) Have him roam or follow a path like normal and run a timer for him to de-spawn, such as, when activated, in the same function he is activated, you can put in: AddTimer("despawnmonster", TIME *FLOAT*, "CALLBACKFUNCTION");
and in the callback function, SetEntityActive("MONSTERNAME", false); .... This does the same as above, but both have different requirements. Your choice, TIMED de-spawn? Or when he reaches an area, he despawns...


As for not making any noise, you would have to open him in the ModelEditor, go to Edit > User Defined Variables and scroll down to where it says "EnabledSound" and make it empty. Then save it in your "entities" folder (AS A NEW ENTITY, DO NOT OVERWRITE), AS WELL AS your Custom Story folder. The "EnabledSound" is the noise the monster makes upon being spawned. without it, he makes no noises upon activation... ALSO, If you need it, the "ActivationDistance" in the User Defined Variables tells the game how far the player must be before it de-spawns. if you are within the distance, the monster does not go away, however, when you are at a greater distance, the monster will de-spawn automatically. Tweak it if needed.

It's 1:30AM here and I was going to leave, but I figured I'd help one last time. XD Hope this helps!