Beating Enemies on the Ground

aL BeasTie

Well-known member
Beating Enemies on the Ground by BonusJZ

This is a one of my new features that i use in upcoming mod Violent Storm.

violentstormfx0.gif


Intro:
I allways loved way i use to treat punks in mighty Vendeta when they fall on the ground and i want to see this in my game - here i present an anim of Terry but other characters have other ground finishers.

Procedure:
First make propher animation of attack for character and put it as one of freespecial ( in this ex Terry use U D A )
Second desite if you want hit enemy onese or more  - hier Terry deliver
one veeery hard punch - and set attack bbox very low ( here only his fist in the frame that hit ground and attack is also set as KO)

Now poor boy Tom - you have to include bbox in his fall anim (last frames is enough) . You gain also next new feature that give you option to pick him up from the ground ( his a minor enemy so he dont have a riseattack wich can be attack/counter/dodge) and give him next lesson.

If you want use more hits when hi/her on the ground use egz. attack3(not animtion) and make propher enemy anim pain3 (as lying on the ground).

Now how you think Tom gets the lesson or hit him again.

by BonusJZ

EDIT BY O ILUSIONISTA:

JZ forgot to say HOW you set it :) This is how:

OTG {bi}

~This command determines how attackbox affect lying opponent.
0 = Attackbox can't hit lying opponent at all
1 = Attackbox can hit lying oppoent
2 = Attack boxes can only hit down opponents.

Just add it to your attack attributeand it will work. You can use, like the tutorial said, a custom attack to trigger a custom pain.
This is one example:

anim follow15
loop 0
range -15 70
rangez -18 18
delay 3
attackone 1
fastattack 1
otg 2
followcond 1
followanim 16
 
nsw25 to be honest, while this is pretty self explanatory, the tutorial actually doesn't saws A THING on how to do it, lol.

This is how you do it:

OTG {bi}

~This command determines how attackbox affect lying opponent.
0 = Attackbox can't hit lying opponent at all
1 = Attackbox can hit lying oppoent
2 = Attack boxes can only hit down opponents.

Just add it to your attack attribute and it will work. You can use, like the tutorial said, a custom attack to trigger a custom pain.
This is one example:

anim follow15
loop 0
range -15 70
rangez -18 18
delay 3
attackone 1
fastattack 1
otg 2
followcond 1
followanim 16
 
I can't find anything about ground attack in above tutorial. I think the above example was freespecial instead of autoswitch to ground attack
But either way, both attack animation must use OTG 1
 
nsw25 said:
The bit that is missing is how do you make the attack animation switch to a ground attack animation when approaching a enemy on the ground who can be hit.

No, what I posted is how to make an attack to hit downed enemies - OTG is the technical term for it.
OTG alone has nothing with changing to a different attack if the enemy is down near you. It just controls how the attack will hit:
0 = Attackbox can't hit lying opponent at all (default)
1 = Attackbox can hit lying opponent
2 = Attack boxes can only hit down opponents.

To switch to a different attack if the enemy is down near you, you need to use script. I use a different FALL animation for downed enemies, so my OTG won't trigger them over and over, because - if I am not mistaken, the juggle cost is reseted when the enemy touches the ground, so you would be able to trigger it many times on a row near walls, for example.

I use DC's ani0020.h for that.
 
I'm sorry to bring this topic back up:
would it be possible to explain how it is possible to switch the basic attack to an otg attack if the player is close to a grounded enemy?
 
I'm sorry to bring this topic back up:
would it be possible to explain how it is possible to switch the basic attack to an otg attack if the player is close to a grounded enemy?

I don't have the script on hand, but what I do is in a key script, when player presses attack, I check for the following:
  • Is player ALSO holding Down?
  • Is there a target within proximity of the down attack's range setting? You can use findtarget() with the optional animation parameter to check this.
  • Is the target fallen? No need to look for animations, I check the falling flag.
  • Is the target on the ground (< 0.1 from its base?)
If those conditions meet, I switch to ground attack, which of course has an OTG hit box.

HTH some,
DC
 
would it be possible to explain how it is possible to switch the basic attack to an otg attack if the player is close to a grounded enemy?
I am on a hurry to explain it fully, but if you download my Avengers game, you will see this being used on Wolverine.

What I do?

- I've duplicated the normal attack as a freespecial, with D A as input - so it will trigger only if I press DOWN+A over a fallen enemy
com D A freespecial30 #down attack

I am using a function to check if the target is on the desired animation (in red) and make the attack to go to a specific animation (in blue)
anim freespecial30
loop 0
delay 4
offset 67 114
bbox 46 78 35 37
sound data/chars/wolverine/claws_171-2.wav
@cmd ani0020 openborconstant("ANI_FOLLOW15") openborconstant("ANI_FOLLOW15")
hitflash cut1
hitfx data/sounds/cut1.wav
frame data/chars/wolverine/a1-1.gif
@cmd ani0020 openborconstant("ANI_FOLLOW15") openborconstant("ANI_FOLLOW15")
frame data/chars/wolverine/a1-2.gif
attack12 68 71 45 22 10 0 0 0 0 15
@cmd ani0020 openborconstant("ANI_FOLLOW15") openborconstant("ANI_FOLLOW15")
frame data/chars/wolverine/a1-3.gif
delay 6
attack 0 0 0 0 0 0 0 0 0 0
frame data/chars/wolverine/a1-4.gif

in every enemy FALL (only on the FALL, not in any other) animation, I've added a code to force them to go to a new animation (FOLLOW15), which is the one where they can be hit on the ground

anim fall
loop 0
delay 14
landframe 2
(....)
@cmd anichange "ANI_FOLLOW15" 0
frame data/chars/enemies/gunner/fall3.gif

This prevents the attacker to keep spamming the OTG attack on the same enemy over and over. You can test it on the game using Wolverine: if you knock down an enemy using combos or jump attack, you can use OTG when they are fallen. But if you grab and throw them, you cannot execute it - since throws use a different fall animation (FALL9)
 
Last edited:
I am on a hurry to explain it fully, but if you download my Avengers game, you will see this being used on Wolverine.

What I do?

- I've duplicated the normal attack as a freespecial, with D A as input - so it will trigger only if I press DOWN+A over a fallen enemy


I am using a function to check if the target is on the desired animation (in red) and make the attack to go to a specific animation (in blue)


in every enemy FALL (only on the FALL, not in any other) animation, I've added a code to force them to go to a new animation (FOLLOW15), which is the one where they can be hit on the ground



This prevents the attacker to keep spamming the OTG attack on the same enemy over and over. You can test it on the game using Wolverine: if you knock down an enemy using combos or jump attack, you can use OTG when they are fallen. But if you grab and throw them, you cannot execute it - since throws use a different fall animation (FALL9)
Thanks for the explanations: I understood the principle and tried Wolverine in your Avengers game, everything works as expected.
However, it seems that this system does not work with build 7556 or in any case the application closes without any error message included in the Openborlog.
 
However, it seems that this system does not work with build 7556 or in any case the application closes without any error message included in the Openborlog.
Looks like you are missing something, because scripts - most of times - doesn't give you a "silent crash" like that. Unless there is a NULL POINT somewhere.
Also, keep in mind that some things were changed on how script works in 4.0, so if you imported my whole code it won't work on 4.0

The code uses two functions made by @DCurrent so maybe he can give you a hand here by check what was changed in 4.0

ani0020()

C-like:
int ani0020(int iAni, int iTAni){
    
    /*
    ani0020
    Damon Vaughn Caskey
    Perform alternate animation if target is within range and in specified animation.

    iAni:    Alternate attack.
    iTAni:    Target animation.
    */

    void vSelf      = getlocalvar("self");                    //Caller.                                                         
    void vOpp       = findtarget(vSelf, iAni);                //Nearest target in range of alternate attack.
    
    if (vOpp)                                                //Found a target?
    {
        if(getentityproperty(vOpp, "animationID") == iTAni)    //Animation match?
        {
            ani0009(vSelf, iAni, 0);                        //Perform alternate attack.
            return 1;                                        //Return 1.
        }
    }

    return 0;                                                //Return 0.
}

ani0009()

C-like:
int ani0009(void vTarget, int iAni, int iType)
{
    //Set animation and return 1 if valid.

    if (!vTarget) vTarget = getlocalvar("self");

    if (getentityproperty(vTarget, "animvalid", iAni))          //Animation valid?
    {
        if (iType == -1)                                        //Type -1?
        {
            changeentityproperty(vTarget, "animation", iAni);   //Set animation with entity property.
        }
        else
        {
            performattack(vTarget, iAni, iType);                //Set animation with perform attack command.
        }
        return 1;                                               //Return 1.       
    }
    return 0;
}
 
Back
Top Bottom