![]() |
PlaySound - 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: PlaySound (/thread-5722.html) |
PlaySound - nerdboyxxx - 12-14-2010 Hello, Below is the code I am using. I am trying to make a sound play when the player makes contact with a certain area. When the player makes contact with this area, the sound will play from the location of another entity (in this case another script area). Below is the code I am currently using. I have been reading through the tutorials and teaching myself as I go, so far it has gone well however I am stuck at the moment. I can't see where I am going wrong at all. Code: void OnStart() If you could help fix up my script and explain where I went wrong I would be very grateful. Thanks for all the help ![]() RE: PlaySound - Frontcannon - 12-14-2010 It seems alright, but the name of the sound file doesn't contain caps, I think. I don't know if that matters, though. How far away is the sound area from the player? Some sounds can't be heard over certain distances. RE: PlaySound - nerdboyxxx - 12-14-2010 I have it behind a wall, if that matters. It is right over the player. I will try and use the name without caps and see if that works though, because I think that might be the problem. EDIT: That is not the problem ![]() It should be running, but it isn't... :| RE: PlaySound - Frontcannon - 12-14-2010 Add this in Collide_Area and activate 'Show Debug Messages' in the debug menu (F1): Code: AddDebugMessage("this should be a sound", false); RE: PlaySound - nerdboyxxx - 12-15-2010 (12-14-2010, 11:34 PM)Frontcannon Wrote: Add this in Collide_Area and activate 'Show Debug Messages' in the debug menu (F1): Hmmm, no debug messages appeared when I collided with the Area... I'm stumped. Just in case it will help, I've posted my entire script below (don't worry, it isn't that long ![]() Code: //========================================= Hopefully there is a problem with my formatting so I can fix it quickly ![]() RE: PlaySound - nerdboyxxx - 12-15-2010 I found the problem; turns out that "Player" isn't "player"... Well, at least I got it working XD |