[SCRIPT] Triggering "stopmusic" - 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] Triggering "stopmusic" (/thread-29950.html) |
Triggering "stopmusic" - bestia455 - 05-25-2015 I would like to use a script_area to trigger one song to start, AND another song to end. I want to: Code: void OnEnter() and Code: { then STOP "Edgar.ogg" from playing. I am very new to this scripting stuff, so please forgive me if I completely overlooked the correct script on the wiki. RE: Triggering "stopmusic" - Mudbill - 05-25-2015 PlayMusic and StopMusic work together using a priority value. According to the script, the priority is defined at the second last argument: PHP Code: void PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume); What the priority does is tell the game which track to play (or stop). Only 1 track can play at a time, and that will be the one with the highest priority value. To stop a track, you input the exact same priority as defined in the track you want to stop. Your "Edgar.ogg" track has priority 1. Use StopMusic with that priority to stop it. PHP Code: void StopMusic(float afFadeTime, int alPrio); RE: Triggering "stopmusic" - bestia455 - 05-25-2015 Oh man, thank you so much. RE: Triggering "stopmusic" - Slanderous - 05-25-2015 (05-25-2015, 03:21 PM)bestia455 Wrote: Oh man, thank you so much. Are you from Poland? 'Cause your nick sounds like our word for "beast" RE: Triggering "stopmusic" - bestia455 - 05-25-2015 (05-25-2015, 06:33 PM)Lazzero Wrote:(05-25-2015, 03:21 PM)bestia455 Wrote: Oh man, thank you so much. No, years ago I played a playstation 2 game called Midnight club 2, and the game featured a car called the"1971 Bestia" which was a ripoff of a late 1960's Pontiac. An old Pontiac engine was a 455 cubic inch, around this time I owned a 1967 Pontiac, you can lookup the resemblance. RE: Triggering "stopmusic" - Slanderous - 05-25-2015 (05-25-2015, 08:12 PM)bestia455 Wrote:(05-25-2015, 06:33 PM)Lazzero Wrote:(05-25-2015, 03:21 PM)bestia455 Wrote: Oh man, thank you so much. Allrighty then. RE: Triggering "stopmusic" - Daemian - 05-25-2015 In Spanish bestia means beast too. It comes from Latin bestia or something. RE: Triggering "stopmusic" - Slanderous - 05-25-2015 (05-25-2015, 09:42 PM)Daemian Wrote: In Spanish bestia means beast too. It comes from Latin bestia or something. Probably yep. RE: Triggering "stopmusic" - Mudbill - 05-26-2015 (05-25-2015, 08:12 PM)bestia455 Wrote: No, years ago I played a playstation 2 game called Midnight club 2, and the game featured a car called the"1971 Bestia" which was a ripoff of a late 1960's Pontiac. An old Pontiac engine was a 455 cubic inch, around this time I owned a 1967 Pontiac, you can lookup the resemblance. That's a pretty funny and specific origin of your username |