Solved alternate special button

Question that is answered or resolved.

msmalik681

OpenBOR Developer
Staff member
I wanted to know when you have a block animation and the special key is used for block is there any way to set special as another key without resorting to script ?

I know how to make a fake block by script and how to set a2 to a custom freespecial but that is not what I want I want to use the system special as a2 if possible.
 
Solution
Thanks @DCurrent but I decided to keep special for blocking and use A2 with a freespecial that is really the special animation and add cancel commands into the pain animations.

Just wanted to know if i was missing something obvious.
I wanted to know when you have a block animation and the special key is used for block is there any way to set special as another key without resorting to script ?

I know how to make a fake block by script and how to set a2 to a custom freespecial but that is not what I want I want to use the system special as a2 if possible.

Sorry, but in the current build there's really no way to swap button functions around without some tricky scripts. Depending on what you want to do, there are plenty of ways to add block functionality outside of the Special button though. @Pierwolf's Knights and Dragons module has a block system that IIRC makes clever use of the counter system.

DC
 
Thanks @DCurrent but I decided to keep special for blocking and use A2 with a freespecial that is really the special animation and add cancel commands into the pain animations.

Just wanted to know if i was missing something obvious.
 
Solution
I wanted to know when you have a block animation and the special key is used for block is there any way to set special as another key without resorting to script ?

I know how to make a fake block by script and how to set a2 to a custom freespecial but that is not what I want I want to use the system special as a2 if possible.
Hi buddy. I don't know if it will fit for your game but I have a suggestion with no scripts.

First, you can rename the "special" animation into any freespecial and use the "com" function at the character header to define the "a2" key.
Code:
com a2    freespecial19    #CUSTOM SPECIAL

Code:
anim freespecial19
    fastattack 1
    jugglecost 5
    forcedirection 0
    otg 1
    energycost 40 2 5
    @cmd healStart
    loop    0
    delay    6
    offset    62 126
    @cmd hitfx "HighPunch.wav"
    @cmd sound "Fire.wav"
    frame    data/chars/heroes/axel/special00.gif
    attack 72 64 64 40 8 1 0 0 20 12
    dropv 2 1 0
    frame    data/chars/heroes/axel/special01.gif
    attack 44 26 64 54 8 1 0 0 20 12
    dropv 2 1 0
    frame    data/chars/heroes/axel/special02.gif
    attack 10 25 58 43 8 1 0 0 20 12
    dropv 2 1 0
    frame    data/chars/heroes/axel/special03.gif
    attack 21 56 76 47 8 1 0 0 20 12
    dropv 2 1 0
    frame    data/chars/heroes/axel/special04.gif
        delay    1
    attack 0 0 0 0 0 0 0 0 0 0
    frame    data/chars/heroes/axel/special04.gif
        delay    6
    attack8 85 78 63 37 8 1 0 0 20 12
    dropv 2 2 0
    frame    data/chars/heroes/axel/special05.gif
    frame    data/chars/heroes/axel/special06.gif
    attack 0 0 0 0 0 0 0 0 0 0
    frame    data/chars/heroes/axel/special07.gif

Second, to achieve the "special" effect, you can use the "cancel" command at the header of all "pain" and "grabbed" animations. This way you will deceive the engine and have the same "escape" effect as the original special animation.
Code:
anim grabbed
    cancel 0 7 0 a2 freespecial19
    loop    0
    delay    8
    offset    62 126
    bbox     50 65 24 62
    frame    data/chars/heroes/axel/grabbed00.gif

anim pain #UP
    cancel 0 7 0 a2 freespecial19
    loop    0
    delay    4
    offset    62 126
    bbox     51 57 21 71
    frame    data/chars/heroes/axel/pain00.gif
    frame    data/chars/heroes/axel/pain01.gif
    frame    data/chars/heroes/axel/pain00.gif
    frame    data/chars/heroes/axel/pain01.gif
    frame    data/chars/heroes/axel/pain00.gif
    frame    data/chars/heroes/axel/pain01.gif
    frame    data/chars/heroes/axel/pain00.gif
    frame    data/chars/heroes/axel/pain01.gif

anim pain2 #DOWN
    cancel 0 7 0 a2 freespecial19
    loop    0
    delay    4
    offset    62 126
    bbox     47 66 31 60
    frame    data/chars/heroes/axel/pain200.gif
    frame    data/chars/heroes/axel/pain201.gif
    frame    data/chars/heroes/axel/pain200.gif
    frame    data/chars/heroes/axel/pain201.gif
    frame    data/chars/heroes/axel/pain200.gif
    frame    data/chars/heroes/axel/pain201.gif
    frame    data/chars/heroes/axel/pain200.gif
    frame    data/chars/heroes/axel/pain201.gif

This way you can freely use the "Ajspecial 1" to block by using the native "special" button and let the "a2" key for "special" animation
 
Thanks for the support @Kratus if you read my previous post you just suggested what i literally said i will be doing lol.

But again thanks for the suggestion.
Sorry man, I got it wrong because I readed custom "freespecial" instead of custom "special". I thought that you only wanted to avoid scripts, but now I understand that you want to avoid custom "freespecial" usage too.

Maybe we can add some alternatives in the next engine build, it's a good idea.

EDIT: I checked the source and added a new "Ajspecial" flag 2 to use the A2 button.
I'm doing some tests and if everything is ok I will add it to my next source commit.
 
Last edited:
Sorry man, I got it wrong because I readed custom "freespecial" instead of custom "special". I thought that you only wanted to avoid scripts, but now I understand that you want to avoid custom "freespecial" usage too.

Maybe we can add some alternatives in the next engine build, it's a good idea.

EDIT: I checked the source and added a new "Ajspecial" flag 2 to use the A2 button.
I'm doing some tests and if everything is ok I will add it to my next source commit.

Be aware, I added an event already that allows super easy capturing and rerouting keys before the engine code sees them. The intent is for stuff like control reversal and button scrambling, but it could be usful for these sorts of things as well.

DC
 
Be aware, I added an event already that allows super easy capturing and rerouting keys before the engine code sees them. The intent is for stuff like control reversal and button scrambling, but it could be usful for these sorts of things as well.

DC
Hmm this is interesting. If we are able to change the final result of any button press, my update is not necessary.
After testing the "Ajspecial 2", I was increasing a few lines in the code to expand it for more buttons with an easy usage, like this.

Ajspecial 0 = default
Ajspecial 1 = A1+JUMP
Ajspecial 2 = A2 key
Ajspecial 3 = A3 key
Ajspecial 4 = A4 key

It's really a very small and simple change in the source that significantly increases the button customization for "special/block" functions, plus reduces script usage.
But I will wait to test your new code, it seems to be better.
 
I was just thinking if the engine took away the special button maybe there was a option to give it back without losing the block option so guess 4.0 will have that fix.
 
Back
Top Bottom