Sound Activation - 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) +--- Thread: Sound Activation (/thread-53579.html) |
Sound Activation - XeOnTricks - 02-14-2017 i was creating a custom story and i ran into a problem being fairly new. idk how to activate a sound upon walking through a scripted area, also what would be the Script for activating a sound? RE: Sound Activation - Mudbill - 02-14-2017 First off, you place a ScriptArea into your level at the point where you want the player to walk to activate the sound. Hop into your script file for the level and add the collide callback between the player and your area. Check the wiki here for information on all the scripts you can use. PS: This callback should be within your OnStart() function, so like this: PHP Code: void OnStart() Keep in mind that if you already have an OnStart function, don't make another one; instead just add the callback inside the one you have. Next, you need the function you defined in argument #3: PHP Code: void MyCollideFunction(string &in asParent, string &in asChild, int alState) Feel free to delete my comments between /* and */. RE: Sound Activation - XeOnTricks - 02-15-2017 it may be a stupid request but could you show me an example script? RE: Sound Activation - FlawlessHappiness - 02-15-2017 PHP Code: void OnStart() PlaySoundAtEntity found here RE: Sound Activation - XeOnTricks - 02-15-2017 Thank you |