Jump to content

Photo

Sound effect for drowning

Global

  • Please log in to reply
2 replies to this topic

#1 Avataro

Avataro

    Quest maker

  • Members
  • Real Name:Robin
  • Gender:Male
  • Location:Germany

Posted 15 March 2014 - 06:26 AM

Sound effect for drowning


Description

This simple script plays a sound effect when Link drowns in "walkable water". You need to have the quest rule for drowning enabled, or else Link can't drown. :)

Screenshots and Demo

N/A

Code


import "std.zh"

const int LinkDrownSFX = 0; //Replace this number with the Sound Effect number for drowning

global script Slot2{
    void run(){
        bool LinkHasDrowned = false;
        while(true){
            if ( LinkHasDrowned == true && Link->Action != LA_DROWNING )
                LinkHasDrowned = false;
            if( Link->Action == LA_DROWNING && LinkHasDrowned == false){
                LinkHasDrowned = true;
                Game->PlaySound(LinkDrownSFX);
            }
            Waitframe();
        }
    }
}

Setup

1. Get a sound effect for drowning. Import it into your quest. Keep track of the sound effect number.
2. Copy the script into your script file. Combine it with your existing global script (if there is one).
3. Replace the "0" for the LinkDrownSFX with your sound effect number for drowning.
4. Import, compile and assign the script (as you do with any other scripts).

Resources

std.zh (comes with downloading Zelda Classic)

#2 MoscowModder

MoscowModder

    Still fighting the inevitable

  • Members
  • Gender:Male
  • Location:Wisconsin (WHAT)

Posted 26 March 2014 - 08:58 PM

Nice and simple. I like it!



#3 Rastael

Rastael

    Wizard

  • Members
  • Real Name:Raphael
  • Gender:Male
  • Location:Austria

Posted 27 March 2014 - 04:28 AM

Yeah, that's great, I will definitly use it! ^^





Also tagged with one or more of these keywords: Global

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users