@DD Tokki You can use a random sound script for that. I use it on my games, either to make them speak random lines or just one line at random chance
Put this at your animationscipt file:
C-like:
void randSound0(char s1,char s2)
{
int r = rand()%100;
char sound;
if (r<=0)
{
sound=s1;
}else{
sound=s2;
}
playSound("data/"+sound);
}
void randSound(char s1,char s2,char s3)
{
int r = rand()%300;
char sound;
if (r<=-100)
{
sound=s1;
}else if(r<=100){
sound=s2;
}else{
sound=s3;
}
playSound("data/"+sound);
The script already include the "data" of the path, so you don't need to add it manually.
Both scripts do the same, but one accepts 2 files and the other one 3 files
This is an example when you want a sound file just in 50% of the cases, or silence:
"Null.wav" is an empty sound file (a very short sound file with just silence)
This is very useful in animations like PAIN or JUMPATTACK, to avoid hearing the same sound over and over.
The other function works on the same way, you just need to point 3 files: