Making a scream play when player enters a room? - 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 (https://www.frictionalgames.com/forum/forum-35.html) +--- Thread: Making a scream play when player enters a room? (/thread-6998.html) |
RE: Making a scream play when player enters a room? - MrBigzy - 03-23-2011 Add this to the start of your code, before everything: Code: void OnEnter() Pretty sure you need those for them to run. RE: Making a scream play when player enters a room? - Austums - 03-23-2011 Ok, so now I have this Code: void OnEnter() And yet still nothing happens. This scripting is like Greek to me :/ RE: Making a scream play when player enters a room? - MrBigzy - 03-23-2011 Sorry, I made another booboo. D: Put the Scream and Scream_1 back the way they were in the collide. That's the thing bout programming, one single, tiny thing can screw up everything! Edit: Oh wait, I just realized. Make them both Scream_1. Your area is also called Scream_1. D: Basically you had a function to an area that didn't exist, lol. RE: Making a scream play when player enters a room? - Austums - 03-23-2011 lol, perfect! It worked!! Thank you so much! My very first script ^_^ I'm not gonna lie, I'm still very confused as to how C++ works (This is my first day with it) but I'm glad there are helpful people to help me out! Now that that works, is there a script on the forums that shows me how to make the player whimper/startle? Like in Amnesia, when something frightens Daniel, he'll quietly whimper. RE: Making a scream play when player enters a room? - MrBigzy - 03-23-2011 Glad to help. :3 Just try to learn from that script as to what's being done; it'll make it much easier to script later on! If you have any questions about certain parts of the script, just ask. Edit: Uh, just use the same sound function you used for the scream, but make the entity Player and use the whimper sound file. RE: Making a scream play when player enters a room? - Austums - 03-23-2011 Okay, so I added the react sound all by myself and it works, but I realized Daniel won't stop looking at the door! I'm stumped as to what the problem is. I put the StopPlayerLookAt(); Code: void OnEnter() RE: Making a scream play when player enters a room? - MrBigzy - 03-23-2011 The function has the arguments for a collide, it should have the asTimer in it only. RE: Making a scream play when player enters a room? - Austums - 03-23-2011 Awesome, got it working! Yay, I can actually do a little scripting on my own, all thanks to you Let's say I wanted to have some breathing from the Player after the scream, and maybe start some ambient music. Same idea as the react and scream sounds? RE: Making a scream play when player enters a room? - Pandemoneus - 03-23-2011 That script language isn't C++, it's Angelscript (though it's pretty similiar to C++). RE: Making a scream play when player enters a room? - MrBigzy - 03-23-2011 Woot! Yep same thing, except for music, it's the function PlayMusic I think, just go to the function page in the wiki and do a search for "music", you'll find it. You should go through that page actually and look at the functions, most of them are self-explanatory. |