[Script] Killer Instinct Style Announcer

Viper Snake

Member
Big thanks to Dantedevil for reviving interest in this script and Piccolo for fixing it to work as intended!

Add this to your updated.c:
Code:
void main(){
processRushCount();
}

void rushCountSound(int rush_count){
	if (rush_count == 3) {
	int iSnd = loadsample("data/sounds/hits3_triple.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	} 
	else if (rush_count == 4){
	int iSnd = loadsample("data/sounds/hits4_super.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 5){
	int iSnd = loadsample("data/sounds/hits5_hyper.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 6){
	int iSnd = loadsample("data/sounds/hits6_brutal.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 7){
	int iSnd = loadsample("data/sounds/hits7_master.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 8){
	int iSnd = loadsample("data/sounds/hits8_awesome.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 9){
	int iSnd = loadsample("data/sounds/hits9_blaster.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 10){
	int iSnd = loadsample("data/sounds/hits10_monster.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 11){
	int iSnd = loadsample("data/sounds/hits11_king.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 12){
	int iSnd = loadsample("data/sounds/hits12_killer.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 13){
	int iSnd = loadsample("data/sounds/hits13_ultra.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count >= 14){
	int iSnd = loadsample("data/sounds/hitsx_ultimate.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}		
}

void processRushCount(){
	void vEnt = getplayerproperty(0, "entity"); // Player 1
	if(vEnt != NULL()){
		int lastRushCount = getentityvar(vEnt, "last_rush_count");
		int rushCount = getentityproperty(vEnt, "rush_count");
		
		if(lastRushCount != NULL() && rushCount < lastRushCount){ // Combo ended, play sound
			rushCountSound(lastRushCount);
		}
		setentityvar(vEnt, "last_rush_count", rushCount);
	}
}

After player 1's rush counter stops counting the current combo,  the corresponding .wav file will be played: 

1-2 hits  = Nothing plays
3 hits    = Triple Combo
4 hits    = Super Combo
5 hits    = Hyper Combo
6 hits    = Brutal Combo
7 hits    = Master Combo
8 hits    = Awesome Combo
9 hits    = Blaster Combo
10 hits  = Monster Combo
11 hits  = King Combo
12 hits  = Killer Combo
13 hits  = Ultra Combo
14+ hits = Ultimate Combo

Download the Killer Instinct Announcer sounds here:http://www.mediafire.com/download/sykxisghb6rq5e7/KI+Announcer+Sounds.7z

Optionally, you can turn on OpenBOR's rush counter display by putting something like this in your levels.txt:
Code:
rush 1 1 Hits: 4 4 Max! 4 4
p1rush 30 65 67 65 30 80 67 80
 
Hmmm.... I need to check if there's any script event related to combo. The idea is this script will acquire latest rush counter than play appropriate .wav based on the list

If there were no special event script, we can just set the script at end of combo animation
 
Bloodbane said:
Hmmm.... I need to check if there's any script event related to combo.

yes, there is "combostep":
Code:
int combo_step = getentityproperty(self,"combostep");

Then you continue with the "if" logic, like

if ( combo_step == 3 ){
*insert sound code here*
} else if (combo_step== 4){
*insert sound code here*
}
(....)

you will need to use this at didhitscript
 
O Ilusionista said:
combostep

I couldn't seem to get combostep to do anything, I am using build 3984. I used rush_count instead. Posted below is what I have so far, it does announce the hits but not in the way I'd like. I am trying to figure out the best way to have it only announce the total number of hits after the rush counter stops and goes away.

Code:
//Killer Instinct style combo announcer
void main()
{
    void self = getlocalvar("self"); //Get calling entity.
	int rush_count = getentityproperty(self,"rush_count");   //current rush count
	//int rush_time = getentityproperty(self,"rush_time");   //how much time you have before rush has ended
	//int rush_tally = getentityproperty(self,"rush_tally"); //max rush count

    if (rush_count == 2) {
	int iSnd = loadsample("data/sounds/hits3_triple.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
    } 
	else if (rush_count == 3){
	int iSnd = loadsample("data/sounds/hits4_super.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 4){
	int iSnd = loadsample("data/sounds/hits5_hyper.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 5){
	int iSnd = loadsample("data/sounds/hits6_brutal.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 6){
	int iSnd = loadsample("data/sounds/hits7_master.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 7){
	int iSnd = loadsample("data/sounds/hits8_awesome.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 8){
	int iSnd = loadsample("data/sounds/hits9_blaster.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 9){
	int iSnd = loadsample("data/sounds/hits10_monster.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 10){
	int iSnd = loadsample("data/sounds/hits11_king.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 11){
	int iSnd = loadsample("data/sounds/hits12_killer.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 12){
	int iSnd = loadsample("data/sounds/hits13_ultra.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 25){
	int iSnd = loadsample("data/sounds/hitsx_ultimate.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}	
}
 
I try to find more info about this in others post,  but nothing close to this.
It's really possible or this is a forgotten post, because it is not possible.?
 
"Is it possible" is not a question that should ever be asked. The answer is always yes. I'm pretty sure someone has already done this in fact. if they haven't, the worst case scenario is having to track the current rush count and using an update timer to play the announcements. Unless I am mistaken though, there is a more elegant method available.

DC
 
Thanks my friend!
Maybe you right, but not always be possible make all.
I remember more than one time, hear no for answer.
But never give up, like all people says the double gran not possible,  and I can create the double grab with my limited knowledge.
About the Killer Instinct announcer in the rush combo, I don't understand how works or how make it work.
For this I need ask my friend.
Thanks!
 
Finally solved with the help of Piccolo.
Thanks my friend!

Piccolo said:
Code:
void rushCountSound(int rush_count){
	if (rush_count == 2) {
	int iSnd = loadsample("data/sounds/hits3_triple.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	} 
	else if (rush_count == 6){
	int iSnd = loadsample("data/sounds/hits4_super.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 10){
	int iSnd = loadsample("data/sounds/hits5_hyper.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 14){
	int iSnd = loadsample("data/sounds/hits6_brutal.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 18){
	int iSnd = loadsample("data/sounds/hits7_master.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 22){
	int iSnd = loadsample("data/sounds/hits8_awesome.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 26){
	int iSnd = loadsample("data/sounds/hits9_blaster.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 30){
	int iSnd = loadsample("data/sounds/hits10_monster.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 34){
	int iSnd = loadsample("data/sounds/hits11_king.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 38){
	int iSnd = loadsample("data/sounds/hits12_killer.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 42){
	int iSnd = loadsample("data/sounds/hits13_ultra.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 51){
	int iSnd = loadsample("data/sounds/hitsx_ultimate.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}		
	
	
}


void processRushCount(){
	void vEnt = getplayerproperty(0, "entity");
	if(vEnt != NULL()){
		int lastRushCount = getentityvar(vEnt, "last_rush_count");
		int rushCount = getentityproperty(vEnt, "rush_count");
		
		if(lastRushCount != NULL() && rushCount < lastRushCount){ // Combo ended, play sound
			rushCountSound(lastRushCount);
		}
		setentityvar(vEnt, "last_rush_count", rushCount);
		
	}
	
}


Add these two functions in your updated.c (should be in you scripts folder).

Then in that same file, add this line in the main function :

Code:
processRushCount();

And you're done.
 
Testing more this I found something to fix:
Code:
void rushCountSound(int rush_count){
	if (rush_count == 3) {
	int iSnd = loadsample("data/sounds/hits3_triple.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 4){
	int iSnd = loadsample("data/sounds/hits4_super.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 5){
	int iSnd = loadsample("data/sounds/hits5_hyper.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 6){
	int iSnd = loadsample("data/sounds/hits6_brutal.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 7){
	int iSnd = loadsample("data/sounds/hits7_master.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 8){
	int iSnd = loadsample("data/sounds/hits8_awesome.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 9){
	int iSnd = loadsample("data/sounds/hits9_blaster.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 10){
	int iSnd = loadsample("data/sounds/hits10_monster.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 11){
	int iSnd = loadsample("data/sounds/hits11_king.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 12){
	int iSnd = loadsample("data/sounds/hits12_killer.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 13){
	int iSnd = loadsample("data/sounds/hits13_ultra.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
	else if (rush_count == 14){
	int iSnd = loadsample("data/sounds/hitsx_ultimate.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}		
	
	
}


In the last part, here:
Code:
	else if (rush_count == 14){
	int iSnd = loadsample("data/sounds/hitsx_ultimate.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
If  you hit 14 times the enemy, then play "ultimate.wav".
But if you hit your enemy more than 14 times, the "ultimate.wav" no play and is wrong.
That sound must play always the combo is 14 hits or more hits.
 
Well just edit that to this:

else if (rush_count >= 14){
int iSnd = loadsample("data/sounds/hitsx_ultimate.wav");
playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
}

Only do this to this line cause it's the maximum rush count accepted by this script
 
Bloodbane said:
Well just edit that to this:

else if (rush_count >= 14){
int iSnd = loadsample("data/sounds/hitsx_ultimate.wav");
playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
}

Only do this to this line cause it's the maximum rush count accepted by this script

Yes!

Now all it's perfect my friend.

Thanks!
 
It's possible set a range count in some counters?

Something like this, instead of 13,
From 13 to 20:
Code:
	else if (rush_count == 13){
	int iSnd = loadsample("data/sounds/hits13_ultra.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}
 
You should really try to learn the basics of scripting Dante, or at least try to figure out and come up with proto-code solutions (that is solutions that look - at least a bit - like script, even if they don't compile).

Code:
	else if (rush_count >= 13 && rush_count <=20){
	int iSnd = loadsample("data/sounds/hits13_ultra.wav");
	playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
	}

Wasn't that hard to figure isn't it ?
 
Thanks my friend!
Believe me I try, my idea is not disturbing anyone. Sometimes I can understand a little the logic of the script, but sometimes simply beyond me all this.
My apologies and thanks again for all your help.

 
It's okay, Dante. :) I didn't know about script functions before, but like Piccolo, you can learn about how each function works and how operators (&& (and), || (or), != (not), etc.) do. Still, I'm learning scripts so that I can be better at it someday. (Good thing is I'm interested in scripts more than the hard-coded ones as I progress in learning them.)

EDIT: It's a very great script I see right there for KI announcer style! ;D I'll take a look on it when I have time.
 
Back
Top Bottom