two buttons

jiam

Member
may make an attack by pressing two buttons at once?

example: com a4 + a3 freespecial4 # elbow
 
I had a similar request once, but it was for pressing both a directional and an attack button. Could this script be used for that too?
(though I'm almost sure it needs to be developed further to account for that)
 
For direction + attack button, you could use keyscript like above OR animation script which detects if a key (direction or attack button) is held.

[A DAY LATER]

Oh I suggested using animation script with assumption that direction button can be held prior to pressing attack button and vice versa. If neither can be held, then keyscript is the only way.
 
I'm wondering if there's a way to make hold direction and attack button similar to anim slide which you hold down and press jump to perform anim slide as an attack. For example, you hold forward while walking and press attack button to perform an attack.
 
Holding key event is easier to check, you don't need keyscript for this. Animation script is enough
In this case, check if forward key is held when ATTACK1 is performed. If it's held then change animation to desired animation
 
Thanks Bloodbane! You are right about it. I got it working and I didn't know it's doable with a keyint animation script until I did it now. Thanks to you and the DD Mini mod for us DD modders, I realize it is doable.
 
This is my library for keyall.c

DOWNLOAD:
http://www.mediafire.com/download/mmv7qb8zpmsl7jv/key_lib.zip

USAGE:

combo(int p, char combo_id, int ETA, int hold_btn_combo_flag, char btn1, char btn2, char btn3, ...)
- returns 1 is the combo is completed, else returns 0

PARAMS:
int p: Player index
char combo_id: Combo ID (string)
int ETA: time between two button pression
int hold_btn_combo_flag: hold button flag (the same of playerkeys())
char btn1, char btn2, char btn3, ...: buttons

ACCEPTED BUTTONS:
forward, backward, up, down, attack,
attack2, attack3, attack4, jump,
special, start, esc, screenshot


and the function accepts multipple buttons like
"attack+attack2" or "attack+jump+special"

Example:
Code:
    if ( getentityproperty(getplayerproperty(p,"entity"),"exists") ) {
        void player = getplayerproperty(p,"entity");

        if( combo(p,"combo01",0,1,"forward","up","attack+attack2") ) {
            char anim = "ANI_FOLLOW42";

            if ( ready_to_attack(player,1,0,NULL()) ) {
                changeentityproperty(player,"velocity",0,0,0);
                performattack(player,openborconstant(anim),1);
            }
        }
    }

int playerkeys_multi(int p, int hold_flag, char key_string)
- return 1 if all buttons are pressed, 2 if button are partially pressed and 0 if buttons aren't pressed. it works like playerkeys()
  ex. playerkeys_multi(0, 0, "attack+jump") returns 1 if player 1 hold
        attack+jump+special together
        and it returns 2 is player 1 hold only attack or jump. It accepts also more
        then two buttons like: "attack+jump+special"

int get_hold_time(int p, char key)
- returns the hold button time.
  ex. get_hold_time(0, "attack") returns the hold button time for player 1.

int is_multi_hold_pressed(int p, char btn1, char btn2, char btn3, ...)
- returns is more than 1 button is pressed
  ex. is_multi_hold_pressed(0,"attack","jump") returns 1 if the player 1 holds attack and jump button togheter, returns 0 else.
 
Badass key scripts you got there, White Dragon! ;D Is it possible to rename any name of the key script rather than just keyall.c? I'm curious if I can use that script for declaring a keyscript in the header.
 
maxman said:
Badass key scripts you got there, White Dragon! ;D Is it possible to rename any name of the key script rather than just keyall.c? I'm curious if I can use that script for declaring a keyscript in the header.

Thanks, to use it for a keyscript just import the keyall.c
However I wrote a combo func. Test it! ;)
Ps. see usage above
 
Back
Top Bottom