[SCRIPT] Weeping Angel 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: [SCRIPT] Weeping Angel enemies (/thread-21864.html) |
Weeping Angel enemies - lizardrock17 - 06-19-2013 Hello peoplez i am fairly new to scripting with amnesia, but i would like to create enemies like the weeping angels from doctor who (weeping angels are enemies that cant move when you see them but move when you dont even if your looking at them in the dark and just roam around if they cant find you like if your behind a door). I figured out what engine scripts to use but dont know how to use the script areas for this reason. I was thinking about putting script areas inside of script areas but i dont know if that would would work. I would appreciate some ideas/solutions on how to accomplish this task. ------------------------------ ........... ...................__ ............./´¯/'...'/´¯¯`·¸ ........../'/.../..../......./¨¯\ ........('(...´...´.... ¯~/'...') .........\.................'...../ ..........''...\.......... _.·´ ............\..............( BROFIST ........... RE: Weeping Angel enemies - Tomato Cat - 06-19-2013 You might try using this particular function: PHP Code: void SetEntityPlayerLookAtCallback(string& asName, string& asCallback, bool abRemoveWhenLookedAt); The actual implementation might be a bit more complex, but I'll leave that up to you. RE: Weeping Angel enemies - lizardrock17 - 06-19-2013 (06-19-2013, 05:22 AM)Tomato Cat Wrote: You might try using this particular function: thanx for the reply but i had that much figured out already RE: Weeping Angel enemies - CarnivorousJelly - 06-19-2013 (06-19-2013, 04:30 AM)lizardrock17 Wrote: Hello people; I am fairly new to scripting with Amnesia but I would like to create enemies like the Weeping Angels from Doctor Who (Weeping Angels are enemies that can't move when you see them but move when you don't even if your looking at them in the dark and just roam around if they cant find you like if your behind a door). I figured out what engine scripts to use but don't know how to use the script areas for this reason. I was thinking about putting script areas inside of script areas but i don't know if that would would work. I would appreciate some ideas/solutions on how to accomplish this task. Weeping Angels were terrifying! Traggey might know how to do this (I believe he was working on a Dr Who CS a looooooong time ago). Also, if you need a TARDIS, check out this one! There was a custom story a little while ago that did something similar with the Brute, but I think they were referencing Schrodinger's Cat. I'm not sure which custom story it was, but Cry definitely played it a while ago, so if you want to check his videos, find it, download the game, and check the script to figure out what they did, that would probably be the best way to go. I'm not going to do that for you because I'm just really tired and really busy :p Anyways, the script should look something like this for yours: PHP Code: void OnStart() You can find the majority of scripts on the Engine Scripts page of the wiki. Of course, they can be a little confusing sometimes, so don't be afraid to ask for help! I'm not sure how you would ensure that the angels appear closer to the player (unless you're using a hallway) or how you would ensure that the angel actually causes harm to/kills the player. I'm not a strong scripter at all, so you might want verification on this :) Also, since you seem new to this (please don't hurt me for possibly being incorrect): you might want to download and use either Geany or Notepad++ instead of Notepad for scripting if you haven't already downloaded a decent program. Once that's done, change the language to C++. In Notepad++, this can be done by going under the languages tab in the top menu bar. This will cause strings to appear grey, floats and integers to appear orange, side-notes to appear green, and bools to appear blue. This is helpful for when you get the annoying "Unexpected End of File" error because you'll see a colour that doesn't match up (usually). Either way, good luck! RE: Weeping Angel enemies - DeAngelo - 06-19-2013 I was planning on doing something like this with the armor statue, but I gave up since I'm trying to finish my CS as soon as possible. My plan was to modify a grunt with the mesh of the statue, use a looping "show player position" callback to make sure he chases you no matter what, then make a lookat callback so that when I'm looking at him a custom entity (which would basically be a box of blockboxes to trap him where he was so he couldn't move) would be created where he was (Dunno if that would have worked since I think you can only create entities at script areas) then destroyed when you looked away. I decided against it for 2 reasons: 1, Was having trouble getting it to work and I'm trying to finish up my CS, and 2, the whole "statue that chases you only when you're not looking" has been done in a lot of horror games and I want to try to do some unique stuff with my CS. RE: Weeping Angel enemies - Adrianis - 06-19-2013 Kiandra's method is a good place to start - if you can get that working, you'll notice a few problems. First and foremost is the detection for looking at something is based on where the center of your view is, not just what you can see. You could therefore get into the situation where the statue moves while you can actually see it. The solution to this problem is going to be pretty damn complex, to the point where it's going to take a lot of experimentation on your part to get it right. Honestly, if you're new to scripting, i'd leave this problem till you've got a little more experience using script areas & callbacks in other ways (ways that are better explained in tutorials & with more examples etc) But hard problems are fun, so here's some advice I gave to the last guy asking about weeping angels (there's been quite a few)... Quote: ... you can use the function SetEntityPlayerLookAtCallback to detect when the player is looking at an area.http://www.frictionalgames.com/forum/thread-21670.html EDIT: I should probably add that the steps above would be important to get a 'dynamic' weeping angel style enemy, meaning it could follow you back & forth & all over the level indefinately. If you want to just include a weeping angel style enemy for a particular moment (i.e. just a scare event) you could cut the problem down significantly, which would also IMO make it significantly less interesting RE: Weeping Angel enemies - lizardrock17 - 06-19-2013 (06-19-2013, 03:08 PM)Adrianis Wrote: Kiandra's method is a good place to start - if you can get that working, you'll notice a few problems. I found those other threads and none of them really helped but thanx for the info about the detection. This would be so much easier if amnesia didnt have script areas and each monster had there own AI. (06-19-2013, 05:54 AM)Kiandra Wrote:(06-19-2013, 04:30 AM)lizardrock17 Wrote: Hello people; I am fairly new to scripting with Amnesia but I would like to create enemies like the Weeping Angels from Doctor Who (Weeping Angels are enemies that can't move when you see them but move when you don't even if your looking at them in the dark and just roam around if they cant find you like if your behind a door). I figured out what engine scripts to use but don't know how to use the script areas for this reason. I was thinking about putting script areas inside of script areas but i don't know if that would would work. I would appreciate some ideas/solutions on how to accomplish this task. Thanx for this it has really helped. Still figuring a few kinks out. RE: Weeping Angel enemies - Adrianis - 06-19-2013 Quote: I found those other threads and none of them really helped but thanx forIt does have an AI system, it just doesn't suit you're needs particularly well. Script areas aren't tied to enemies either, they have a very broad purpose, and you'll find them in all sorts of engines (albeit under different names). It's a perfectly solvable problem, but like many cool features is difficult to implement What you're doing in solving this problem is defining AI behavior, it's just being done in a very roundabout way not using the best tools available, but it's still rudimentary AI code. Someone's gotta write it RE: Weeping Angel enemies - lizardrock17 - 06-19-2013 From what you guys told me I have compiled this: (I havent tried it yet because if i encounter any problems i dont want to spend hours on the internet trying to find out my script is wrong) void OnStart() { SetEntityPlayerLookAtCallback("angel_statue_1", "WeepingAngel_1", false); } //"angel_statue_1" is the name of the statue in the level editor //"WeepingAngel" is the name of your script that will be called when the player is looking/not looking //true means the script won't be called again after the player looks at //the angel once. I'm using this one because you're probably going to //have to use multiple statues with angel_statue_1 being your first statue void WeepingAngel_1(string &in asEntity, int alState) { if(alState == 1) //1 means looking { //Your angles don't do anything when you're looking at them, so leave this blank } else if(alState == -1)//-1 means not looking { void ShowEnemyPlayerPosition(string& "angel_statue_1);\\Makes angel follows player } } Would this work? RE: Weeping Angel enemies - OriginalUsername - 06-19-2013 You'll have the chase music whenever you don't look at him though. Keep that in mind. |