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 Whoops, it's supposed to be StartPlayerLookAt, not the other way around. Also, You'll need to add a timer, and then a StopPlayerLookAt(); to stop him from looking, or else he'll look at it forever. RE: Making a scream play when player enters a room? - Austums - 03-23-2011 So does this all look good then? Code: void OnStart() Just got a new error. "main (16,31) : ERR: Expected ')' or ',' RE: Making a scream play when player enters a room? - MrBigzy - 03-23-2011 as Parent and as Child are one word. And you should add the timer into the Scream_Trigger function, then put the stoplook into that function. If you put the start and stoplook in the same function without a timer, he'll start looking, and then stop a millisecond later, so basically nothing will happen. I'd do a 2 second timer to the stoplook, or whatever suits you. RE: Making a scream play when player enters a room? - Austums - 03-23-2011 So liek this? Code: void OnStart() RE: Making a scream play when player enters a room? - MrBigzy - 03-23-2011 Nono, keep the timer you had before in Scream_1, put another one in Scream_Trigger, call another function with it, Scream_Trigger. Put the StopPlayerLookAt function in there. So basically, Scream_1 triggers a timer, after 2 seconds the sound plays, you look at the door, and another timer is called, then 2 seconds or more later, the player stops looking at the door. Code: void OnStart() It's all a consecutive thing, this way the timers just from function to function. RE: Making a scream play when player enters a room? - Austums - 03-23-2011 Okay, I think I get it. I put the script you just did in my .hps but when I go into the room where the scream and look is supposed to happen, nothing happens. Am I supposed to edit the Area Scripts in the Level Editor or just name them? I can post my level for you if you think that would help RE: Making a scream play when player enters a room? - MrBigzy - 03-23-2011 You just have to make sure the script areas are named Scream_1 and LookArea_1, and that Scream_1 is in a position that you'll run into it. If you post the map I'll look at it. RE: Making a scream play when player enters a room? - Austums - 03-23-2011 Everything is named correctly... Hmmm Anyways, here's the .map RE: Making a scream play when player enters a room? - MrBigzy - 03-23-2011 Just realized, change entity collide to this: AddEntityCollideCallback("Player", "Scream_1", "Scream", true, 1); The function and the script area were switched. Also, you should probably make the scream area go to the ground, just in case. RE: Making a scream play when player enters a room? - Austums - 03-23-2011 Changed it so the script is this Code: void OnStart() But it still does nothing when I walk through the door and wait. |