Jump to content

Photo

[REQUEST] Multiple Hurt SFX Script


  • Please log in to reply
4 replies to this topic

#1 Xenix

Xenix

    Well excuse me princess.

  • Members
  • Real Name:Chris
  • Location:Newport News, VA

Posted 24 July 2011 - 11:59 AM

I was wondering if it's at all possible to script multiple sfx for when link takes damage. It may need to be a global script. Is there anyone who can do this?

#2 Isdrakthül

Isdrakthül

    Apprentice

  • Members

Posted 24 July 2011 - 12:55 PM

I think I could do this.

EDIT: Here it is.

Integers:
HurtSound[] = The sounds that you want to use are inside the curly braces. You can have up to 256. If you wish to change this, just change the number between the square braces.
NumOfHurtSounds = The number of sounds you're using.


CODE

int LastAct;
int HurtSound[256] = {2, 35, 14};
const int NumOfHurtSounds = 3;

global script Slot2{
    void run(){
    while(true){
        if((Link->Action==LA_GOTHURTLAND || Link->Action==LA_GOTHURTWATER) && LastAct!=LA_GOTHURTLAND && LastAct!=LA_GOTHURTWATER) Game->PlaySound(HurtSound[Rand(NumOfHurtSounds)]);
        LastAct=Link->Action;
        Waitframe();
    }
    }
}

Edited by Isdrakthül, 24 July 2011 - 02:05 PM.


#3 Xenix

Xenix

    Well excuse me princess.

  • Members
  • Real Name:Chris
  • Location:Newport News, VA

Posted 25 July 2011 - 03:23 PM

Wow! Thanks dude! This script worked perfectly!

#4 Jared

Jared

    Deified

  • Members
  • Real Name:Jared
  • Pronouns:He / Him
  • Location:New Hampshire

Posted 25 July 2011 - 03:25 PM

Do you mind if I use it? icon_smile.gif

#5 Xenix

Xenix

    Well excuse me princess.

  • Members
  • Real Name:Chris
  • Location:Newport News, VA

Posted 25 July 2011 - 03:35 PM

go ahead! it's neat and i would like to see it used in many games.


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users