[SOLVED] How to use areas to kill monsters/poof them? - 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: [SOLVED] How to use areas to kill monsters/poof them? (/thread-13108.html) |
[SOLVED] How to use areas to kill monsters/poof them? - Strembitsky - 02-04-2012 Second post, woo! In my custom story, you start with a monster chasing you, with the text "Run and hide!". I want the player to hide in a closet, and when they do, the monster disappears after about 1-2 seconds. All help is appreciated. RE: How to use areas to kill monsters/poof them? - Elven - 02-04-2012 Make area. Use this: Code: void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates); Code: void SetEnemyIsHallucination(string& asName, bool abX); RE: How to use areas to kill monsters/poof them? - Strembitsky - 02-04-2012 (02-04-2012, 11:01 PM)Elven Wrote: Make area. Use this:Thanks. I am somewhat familiar with scripting, but I am unsure what I am supposed to copy and paste in your lines of code, and what I am supposed to change. Do I only copy and paste what you have given me? RE: How to use areas to kill monsters/poof them? - Elven - 02-04-2012 You have to change some info too. Below it gives info what u need to change into what. Only thing what u cant change is that part: Callback syntax: void MyFunc(string &in asParent, string &in asChild, int alState) Well, u can change MyFunc, but what is AFTER THAT... RE: How to use areas to kill monsters/poof them? - Strembitsky - 02-04-2012 (02-04-2012, 11:12 PM)Elven Wrote: You have to change some info too. Below it gives info what u need to change into what.Okay, thank you. One last question that I could eventually figure out but I am too lazy to mess with the editor: Where do I put that code? Into the "lookat_callback" thing, or the other one? RE: How to use areas to kill monsters/poof them? - Elven - 02-04-2012 Welcome to the world of scripting: http://wiki.frictionalgames.com/hpl2/tutorials/scripting/article RE: How to use areas to kill monsters/poof them? - Rokotain - 02-06-2012 What you could do is make and area and name it "Area_1" inside the closet and add this to the onStart thing: AddEntityCollideCallback("Player", "Area_1", "MonsterDisappear") then: void MonsterDisappear(string &in asParent, string &in asChild, int alState) { AddTimer("TimerMonsterGone", 2); } void TimerMonsterGone(string &in asTimer) { SetEntityActive("Monster_1", false); } Now, to learn something from this. Read the article the other poster sendt you :] and study this script. I'm sure your brain will make the logical connection. Also I'm far from good myself, and I probably made some errors in the script ^ above, so please correct me if I'm wrong! Hope it helped : p! |