Jump to content

Photo

WAV


  • Please log in to reply
7 replies to this topic

#1 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 13 September 2011 - 03:28 PM

I would like to use a WAV file as the Ambient Sound for one of my screens.
Is there literally no way a script can tell the WAV file to stop playing when I leave the screen?

#2 Majora

Majora

    Unironic Marxist-Leninist

  • Members

Posted 13 September 2011 - 03:30 PM

there is already a script for ambient sounds. you just have to put 1 FFC per screen per different sound and it stops when you leave the screen.

#3 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 13 September 2011 - 03:40 PM

EDIT: Could you please link me to the script?

Edited by Cukeman, 13 September 2011 - 03:48 PM.


#4 Majora

Majora

    Unironic Marxist-Leninist

  • Members

Posted 13 September 2011 - 04:18 PM

CODE
// SCRIPT: SFX Player
// --------------------------------------
// DESCRIPTION
// This script will play a sound effect
// specified by the user. It is capable
// of crude looping when a delay is specified.
// --------------------------------------
// USER ARGUMENTS
// D0 (sfx_slot)
//     This is the slot number of the sfx you will be playing.
// D1 (sfx_delay)
//    This is the delay between each play of the SFX *in TICS*.
//    **Leaving this at zero will make the SFX only play once.**
//    There are no REAL sound effects that are 0 tics long, after all.
//    Most people will want to set this to the length of the sfx.
//    SECOND TO TIC CONVERSION: Seconds / (1/60) OR Seconds / 0.0166
//    Alternatively (or if I got that wrong), just check things in the ZQuest F9 dialog.
// --------------------------------------

// #####This is the main code that ZQuest will execute#####
ffc script sfx_player {
    void run(int sfx_slot, int sfx_delay) { // Begin run function.
        int counter = 0; // This is the counter that will be used.
                         // It's used to produce the delay specified.
        do{ // Run this block of code once before checking the status of sfx_delay.
            if (counter == 0) // If the counter is zero, play the sfx in this iteration of the loop.
            {
                Game->PlaySound(sfx_slot); // Play sound # "sfx_slot." This action happens each time this is executed.
                counter = sfx_delay; // (Re)start the counter by setting it to sfx_delay.
            }//!End if statement for counter
            else
            {
                counter--; // Subtract one tic from the counter
            }//!End else statement for counter
            Waitframe(); // Makes the script wait a frame before looping again.
        }while(sfx_delay != 0);//! End of internal do-while loop. If sfx_delay is not 0, it will loop until the ffc is terminated.
    }//! End of run function
}//! End of ffc script


#5 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 13 September 2011 - 09:36 PM

Thank you so much! This has been giving me a headache for over a month.
I'll try it out today!

EDIT: If you know who wrote that script I'll credit them.


EDIT:
I regret to say this script does not do what I need it to.
I wanted a script which will make a WAV file stop playing when I leave the screen.

I tested this script, and when I left the screen, the WAV continued to play until it reached
the end of the sound.

Edited by Cukeman, 13 September 2011 - 09:36 PM.


#6 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 14 September 2011 - 09:25 PM

What if we tackle this another way? Rather than making an ambient sound that stops playing when you leave the screen...

Could there be a script on-screen that forces ambient sounds to stop playing?
It has to work for WAV files, though, or it's useless.

#7 SpacemanDan

SpacemanDan

  • Members
  • Location:Ontario, Canada

Posted 14 September 2011 - 09:31 PM

There's a built-in function that does this. icon_wink.gif

Under Screen Data/Flags (can't recall off hand) there should be a checkbox for 'Use Ocean SFX' or something. Check that. Under another tab, you can set what sound to play. It should repeat the sound as long as the player is on the screen. :3

I must be thinking an older version. In RC2, just go into Screen Data and look under S.Data 2 and pick you desired sound from the list. :3

#8 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 14 September 2011 - 09:33 PM

QUOTE(SpacemanDan @ Sep 14 2011, 07:31 PM) View Post

There's a built-in function that does this. icon_wink.gif

Under Screen Data/Flags (can't recall off hand) there should be a checkbox for 'Use Ocean SFX' or something. Check that. Under another tab, you can set what sound to play. It should repeat the sound as long as the player is on the screen. :3


Sorry, but that is exactly what I am using, the ambient sound...
The problem is that my WAV files keep playing after I leave the screen
(until they reach the end of the sound)

I want them to stop playing immediately when I change screens.

Edited by Cukeman, 14 September 2011 - 09:34 PM.



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users