mersox
Active member
Hi guys! Is there a default way to add a sound effect when a characer is frozen? The freeze effect and its color map work fine, I just want to add a sound effect. I have tried with some didhitscripts but they don't work (the program exits abruptly once it loads the stage where the character with said didhitcript is)
This is the first didhitscript I tried:
And my second attempt:
Any ideas?
This is the first didhitscript I tried:
void main()
{
void self = getlocalvar("self"); //Get calling entity.
//void opponent = getentityproperty(self, "opponent");
void opponent = getlocalvar("damagetaker");
int iSnd = loadsample("data/sounds/(tmnt2/break01.wav");
int anim = getentityproperty(self, "animationid");
if((anim == openborconstant("ANI_ATTACK3")) && (frame < 15)){
playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 120, 0);
}
else {
playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 0, 0);
}
}
And my second attempt:
void main(){
void self = getlocalvar("self");
void anim = getentityproperty(self,"animationID");
int iSnd = loadsample("data/sounds/(tmnt2/break01.wav");
if(anim == openborconstant("ANI_ATTACK3")){
if(frame <= 15){
playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 120, 0);
}
}
}
Any ideas?