atchain with selectable finisher

marco75

New member
I would like to give the player character selectable finishers, like in Capcom's brawlers you hold down during the atchain to throw backwards (cf Final Fight) and up to throw forwards (cf Warriors Of Fate, Cadillacs & Dinosaurs).
In Undercover Cops Alpha Revival (Irem) or Asterix (Konami) each of the four directions results in a different finisher, usually some sort of throw or body slam.

How do I reproduce this behaviour in openBOR?

I want the engine to detect that the direction is held, so it doesn't matter if the direction was held during the first attack, or during the linker (last attack before the knockdown blow, like Hagger's 2nd body blow -> double hammer, Cody's mid punch -> uppercut or Guy's elbow -> outer crescent kick)

Thanks for reading!
 
I've implemented that system in Martial Masters New Legend

Here's Crane's finisher:
Code:
anim	attack5
drawmethod 220 220
	delay	6
	offset	105 141
	bbox	88 50 37 94
	@cmd	keyint "ANI_FOLLOW2" 0 "U" 0 0
	@cmd	keyint "ANI_FOLLOW1" 0 "F" 0 0
	frame	data/chars/crane/runslash1.png
	attack  160 40 86 93 9 1
	dropv	4 0 0
	sound	data/chars/crane/sounds/uppercut.wav
	frame	data/chars/crane/runslash2.png
	frame	data/chars/crane/runslash3.png
	attack  0
	frame	data/chars/crane/runslash4.png
	frame	data/chars/crane/runslash5.png

anim	attack6
drawmethod 220 220
	delay	5
	offset	105 141
	bbox	88 50 37 94
	frame	data/chars/crane/xslash01.png
	frame	data/chars/crane/xslash02.png
	frame	data/chars/crane/xslash03.png
	frame	data/chars/crane/xslash04.png
	frame	data/chars/crane/xslash05.png
	sound	data/chars/crane/sounds/super.wav
	frame	data/chars/crane/xslash06.png
	frame	data/chars/crane/xslash07.png
	frame	data/chars/crane/xslash08.png
	attack  126 57 111 66 18 1
	frame	data/chars/crane/xslash09.png
	frame	data/chars/crane/xslash10.png
	attack  0
	frame	data/chars/crane/xslash11.png
	frame	data/chars/crane/xslash12.png

anim	follow1
drawmethod 220 220
	delay	6
	offset	105 141
	bbox	88 50 37 94
	cancel	8 8 0 A freespecial5
	frame	data/chars/crane/pkick1.png
	frame	data/chars/crane/pkick2.png
#	attack  180 36 74 64 18 1
	attack  140 36 114 64 18 1
	dropv	4 1 0
	sound	data/chars/crane/sounds/kick2.wav
	frame	data/chars/crane/pkick3.png
	frame	data/chars/crane/pkick4.png
	attack  0
	frame	data/chars/crane/pkick5.png
	frame	data/chars/crane/pkick6.png
	frame	data/chars/crane/pkick7.png
	frame	data/chars/crane/pkick8.png
	delay	10
	frame	data/chars/crane/idle01.png

anim	follow2
drawmethod 220 220
	delay	10
	offset	105 141
	jumpframe 2 4 2 0
	bbox	88 84 54 58
	cancel	8 11 0 D U A Freespecial6
	frame	data/chars/crane/uppercut1.png
	frame	data/chars/crane/uppercut2.png
	delay	7
	bbox	84 62 50 36
	sound   data/sounds/jump.wav
	attack  132 11 110 119 14 1
	dropv	4 0 0
	nokill	1
	sound	data/chars/crane/sounds/uppercut.wav
	frame	data/chars/crane/uppercut3.png
	frame	data/chars/crane/uppercut4.png
	attack  0
	frame	data/chars/crane/uppercut5.png
	attack  132 11 110 119 24 1
	nokill	0
	frame	data/chars/crane/uppercut6.png
	frame	data/chars/crane/uppercut7.png
	attack  0
	frame	data/chars/crane/uppercut8.png
	frame	data/chars/crane/uppercut9.png
	delay	9
	frame	data/chars/crane/jump8.png
	frame	data/chars/crane/jump9.png
	frame	data/chars/crane/jump8.png
	frame	data/chars/crane/jump9.png
	delay	10
	bbox	88 84 54 58
	frame	data/chars/crane/land.png
	frame	data/chars/crane/jude1.png

Crane's atchain is 1 2 3 4 5 6. However these scripts:
Code:
	@cmd	keyint "ANI_FOLLOW2" 0 "U" 0 0
	@cmd	keyint "ANI_FOLLOW1" 0 "F" 0 0

allows player to change her combo finisher by holding Up or Forward (Left or Right depending on facing direction)

This is keyint function:
Code:
void keyint(void Ani, int Frame, void Key, int Hflag, int Limit)
{// Change current animation if proper key is pressed or released
    void self = getlocalvar("self");
    void MP = getentityproperty(self,"mp");  
    int iDir = getentityproperty(self, "direction");  
    int iPIndex = getentityproperty(self,"playerindex"); //Get player index
    void iRKey;

      if (Key=="U"){ //Up Required?
        iRKey = playerkeys(iPIndex, 0, "moveup"); // "Up"
      } else if (Key=="D"){ //Down Required?
        iRKey = playerkeys(iPIndex, 0, "movedown"); // "Down"
      } else if (Key=="L"){ //Left Required?
        iRKey = playerkeys(iPIndex, 0, "moveleft"); // "Left"
      } else if (Key=="R"){ //Right Required?
        iRKey = playerkeys(iPIndex, 0, "moveright"); // "Right"
      } else if (Key=="F"){ //Forward Required?
        if (iDir==0){ //Facing left?
         iRKey = playerkeys(iPIndex, 0, "moveleft"); // "Left"
        } else if (iDir==1){ //Facing right?
         iRKey = playerkeys(iPIndex, 0, "moveright"); // "Right"
        }
      } else if (Key=="J"){ //Jump Required?
        iRKey = playerkeys(iPIndex, 0, "jump"); // "Jump"
      } else if (Key=="A"){ //Attack Required?
        iRKey = playerkeys(iPIndex, 0, "attack"); // "Attack"
      } else if (Key=="S"){ //Special Required?
        iRKey = playerkeys(iPIndex, 0, "special"); // "Special"
      } else if (Key=="A2"){ //Attack2 Required?
        iRKey = playerkeys(iPIndex, 0, "attack2"); // "Attack2"
      } else if (Key=="A3"){ //Attack3 Required?
        iRKey = playerkeys(iPIndex, 0, "attack3"); // "Attack3"
      } else if (Key=="A4"){ //Attack4 Required?
        iRKey = playerkeys(iPIndex, 0, "attack4"); // "Attack4"
      }

      if (Hflag==1){ //Not holding the button case?
        iRKey = !iRKey; //Take the opposite condition
      }

      if ((MP > Limit)&&iRKey){
        changeentityproperty(self, "animation", openborconstant(Ani), 2);
        changeentityproperty(self, "animpos", Frame);
      }
}

It's included in her animation script
 
Bloodbane said:
I actually ran into an issue with the script where the data from the previous animation carries over. So for example, Axel's straight punch starts with delay 2, hits with attack2 etc. I change the animation into gut punch which starts with delay 4, hits with attack 4 etc but instead it hits with attack2 and delay2. I'm not sure why this is the case as it hasn't done this before or I haven't noticed.
 
Back
Top Bottom