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?
[REQUEST] Multiple Hurt SFX Script
Started by
Xenix
, Jul 24 2011 11:59 AM
4 replies to this topic
#1
Posted 24 July 2011 - 11:59 AM
#2
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.
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();
}
}
}
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
Posted 25 July 2011 - 03:23 PM
Wow! Thanks dude! This script worked perfectly!
#4
Posted 25 July 2011 - 03:25 PM
Do you mind if I use it?
#5
Posted 25 July 2011 - 03:35 PM
go ahead! it's neat and i would like to see it used in many games.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users