Solved An alternative animation to the block animation following the type of attack

Question that is answered or resolved.

16-bit Fighter

Active member
I'd like an enemy to play another animation than block anim if he blocks a specific attack (by instance attack6).

In his didblockscript I put this only script but nothing happens like I want since the block anim still starts running instead of follow2 anim:

Code:
void main()
{
    void self=getlocalvar("self");
    if(getlocalvar("attacktype")==openborconstant("ATK_NORMAL6"))
    {
        performattack(self,openborconstant("ANI_FOLLOW2"));
    }
}

Thanks in advance for any help.
 
Solution
Why not use the native functionality?

If you have an appropriate Blockpain#, it plays when blocking attack#. It is NOT a "pain" animation, it's a block reaction, like KOF games. It was put in specifically for needs like this.

DC
I'd like an enemy to play another animation than block anim if he blocks a specific attack (by instance attack6).

In his didblockscript I put this only script but nothing happens like I want since the block anim still starts running instead of follow2 anim:

Code:
void main()
{
    void self=getlocalvar("self");
    if(getlocalvar("attacktype")==openborconstant("ATK_NORMAL6"))
    {
        performattack(self,openborconstant("ANI_FOLLOW2"));
    }
}

Thanks in advance for any help.
Your script is correct, you only need to disable the blocking instance.

C:
void main()
{
    void self=getlocalvar("self");
    if(getlocalvar("attacktype")==openborconstant("ATK_NORMAL6"))
    {
        changeentityproperty(self, "aiflag", "blocking", 0);
        performattack(self,openborconstant("ANI_FOLLOW2"));
    }
}
 
Why not use the native functionality?

If you have an appropriate Blockpain#, it plays when blocking attack#. It is NOT a "pain" animation, it's a block reaction, like KOF games. It was put in specifically for needs like this.

DC
Tested and works fine, I thought it was useful only to simulate pain states but can be used to change animations too. Thanks!
 
Tested and works fine, I thought it was useful only to simulate pain states but can be used to change animations too. Thanks!

Someone came behind me and put an erroneous entry in the manual saying it was a pain for when attacks broke through your block, but it's actuality the opposite. Guess it's my fault for using pain in the name. FYI, you're still in blockstate until the animation ends, so if another hit comes in, you'll restart the block sequence.

It was inspired by Fatal Fury 2. I remember thinking it was really cool how there was a separate animation for bracing up and then blocking, and how it was different for jumping vs. standing attacks.

DC
 
FYI, you're still in blockstate until the animation ends, so if another hit comes in, you'll restart the block sequence
Hmm checked and I can confirm it. So, in case the block state needs to be nullified we also need at least a small script to change the aiflag blocking to zero, can be an animation script, inline or didblock event.

Anyway it is a cool way to create different blocking reactions.
 
Someone came behind me and put an erroneous entry in the manual saying it was a pain for when attacks broke through your block, but it's actuality the opposite. Guess it's my fault for using pain in the name. FYI, you're still in blockstate until the animation ends, so if another hit comes in, you'll restart the block sequence.

It was inspired by Fatal Fury 2. I remember thinking it was really cool how there was a separate animation for bracing up and then blocking, and how it was different for jumping vs. standing attacks.

DC
so it should be BLOCK{#} {players,enemies}??
 
I wonder what I missed but it doesn't work. I moved out the didblockscript and I put in the enemy's header "blockpain 0" and among his animations a blockpain6 animation (different from block anim). And of course I made my tests with attack6 attack boxes.
 
Last edited:
I wonder what I missed but it doesn't work. I moved out the didblockscript and I put in the enemy's header "blockpain 0" and among his animations a blockpain6 animation (different from block anim). And of course I made my tests with attack6 attack boxes.
@16-bit Fighter

For me it worked with blockpain 1 in the enemy's header.
I didn't look at the source but maybe the engine sees the value of zero the same as a blockpain "disabled" and instead of damage zero.
 
Last edited:
@16-bit Fighter

For me it worked with blockpain 1 in the enemy's header.
I didn't look at the source but maybe the engine sees the value of zero the same as a blockpain "disabled" and instead of damage zero.
Thank you but I forgot to say I tried with "blockpain 1" too.

Header:
Code:
type           enemy
gfxshadow      1
dust           dust
bflash         block
score          0 1
fmap           4
aggression     0
jugglepoints    5
blockodds      1.5
blockpain    1
hostile player npc
candamage player npc obstacle

blockpain6 animation:
Code:
anim blockpain6
     loop        0
     bbox        217 90 38 114
     delay    4
     offset     240 204
     frame    data/chars/rofos/block01.png
     delay    20
     frame    data/chars/rofos/block02.png
 
Last edited:
Thank you but I forgot to say I tried with "blockpain 1" too.

Header:
Code:
type           enemy
gfxshadow      1
dust           dust
bflash         block
score          0 1
fmap           4
aggression     0
jugglepoints    5
blockodds      1.5
blockpain    1
hostile player npc
candamage player npc obstacle

blockpain6 animation:
Code:
anim blockpain6
     loop        0
     bbox        217 90 38 114
     delay    4
     offset     240 204
     frame    data/chars/rofos/block01.png
     delay    20
     frame    data/chars/rofos/block02.png
@16-bit Fighter

Hmm maybe it can be due to different engine versions or other details in your game. In my tests I used the build 6391 with a fresh BOR mod and it works fine.
 
@Kratus
Thank you for showing your test. Unfortunately I actually have the last OP version and I checked it. Then I tried with a template mod (with the last OP of course) but it's the same result, only block anim is played. I also checked the maxattacks.
I feel stucked...

Enemy (I removed nopassiveblock, otherwise he never blocked):
Code:
name            Ray
health            60
speed            11
type            enemy
aimove          chasez
gfxshadow       1
blockodds       1
blockpain    1
dust            dust
bflash          block
icon            data/chars/ray/icon.gif
diesound        data/sounds/die1.wav
score           0 1
fmap            7
aggression      -100
projectilehit   enemy obstacle

[...]

anim block
    delay    7
    offset    40 108
        bbox    16 16 35 93
    frame    data/chars/ray/block01.gif
        delay   58
    frame    data/chars/ray/block02.gif
        delay   15
        frame    data/chars/ray/block01.gif

anim blockpain4
    delay    7
    offset    40 108
        bbox    16 16 35 93
    frame    data/chars/ray/PainT.gif
        delay   58
    frame    data/chars/ray/PainT.gif
        delay   15
        frame    data/chars/ray/PainT.gif

Player:
Code:
anim attack1
    loop    0
    delay    4
    bbox    25 8 54 97
    offset    60 105
    frame    data/chars/donovan/a1-01.gif
    attack4    85 8 128 43 8
    frame    data/chars/donovan/a1-02.gif
    frame    data/chars/donovan/a1-03.gif
    attack    0 0 0 0 0
    frame    data/chars/donovan/a1-04.gif
    frame    data/chars/donovan/a1-05.gif
    frame    data/chars/donovan/a1-06.gif
    frame    data/chars/donovan/a1-07.gif

anim attack2
    loop    0
    delay    4
    offset    88 114
    bbox    61 11 58 105
    frame    data/chars/donovan/a2-01.gif
    frame    data/chars/donovan/a2-02.gif
    frame    data/chars/donovan/a2-03.gif
    bbox    102 11 58 105
    attack4    102 11 162 74 15
    frame    data/chars/donovan/a2-04.gif
    frame    data/chars/donovan/a2-05.gif
    frame    data/chars/donovan/a2-06.gif
    attack    0 0 0 0 0
    frame    data/chars/donovan/a2-07.gif
    frame    data/chars/donovan/a2-08.gif
    bbox    61 11 58 105
    delay 5
    frame    data/chars/donovan/a2-09.gif
    frame    data/chars/donovan/a2-10.gif
    frame    data/chars/donovan/a2-11.gif


anim attack3
    loop    0
    delay    6
    offset    93 141
    bbox    78 46 50 96
#    sound    data/sounds/donhoya.wav
    frame    data/chars/donovan/a3-01.gif
    frame    data/chars/donovan/a3-02.gif
    attack4    132 4 100 142 25 1
    frame    data/chars/donovan/a3-03.gif
    frame    data/chars/donovan/a3-04.gif
    frame    data/chars/donovan/a3-05.gif
    attack    0 0 0 0 0
    frame    data/chars/donovan/a3-06.gif
    frame    data/chars/donovan/a3-07.gif
    frame    data/chars/donovan/a3-08.gif
    frame    data/chars/donovan/a3-09.gif
    frame    data/chars/donovan/a3-10.gif
    frame    data/chars/donovan/a3-11.gif
 
Last edited:
Unfortunately I actually have the last OP version and I checked it.
@16-bit Fighter
When you mean the last OP, which build are you mentioning? If you are using any other official release above 6391, they are in "alpha" state and are not stable.
In case you are mentioning builds compiled directly from the latest source, I tested the blockpain and worked too.

Please, try your engine build in this BOR I used on my tests and let me know if it works. We need to know if the difference is in the engine or in the game.

1677780806186.png

1677779878137.png

Enemy (I removed nopassiveblock, otherwise he never blocked):
Hmm the "nopassiveblock" indeed makes the entity to block "more", not "less".

1677781021360.png
 

Attachments

  • 1677779829440.png
    1677779829440.png
    23.4 KB · Views: 1
Back
Top Bottom