# Trying to do special attacks while holding a button. (Read 258 times)

Started by Cyberq3000, March 13, 2019, 12:59:29 am

#### Cyberq3000

##### Trying to do special attacks while holding a button.
#1  March 13, 2019, 12:59:29 am
So I've been experimenting and trying different things but haven't gotten it to work the way i want it to.  I'm trying to freely move around while holding the Z Button, and from there if I'm still holding Z and press A while still holding Z, a special attack should come out.  If I release Z, then the attacks will go back to regular low, medium high attacks.

I guess the first problem is trying to hold the Z button without disrupting basic movement, walk, run, jump, and crouch.  I was able to get the special attacks to work while holding Z.  It's just my movement problem.

[Statedef 220]
type    = S
movetype= I
physics = S
juggle  = 4
ctrl = 1

[State 220, 5]
type = ChangeState
triggerall = statetype = S && command = "x"
trigger1 = stateno = 220 && time >= 0
value = 221

[State 220, 5]
type = ChangeState
triggerall = statetype = S && command = "a"
trigger1 = stateno = 220 && time >= 0
value = 222

[State 220, 5]
type = ChangeState
triggerall = statetype = S && command = "b"
trigger1 = stateno = 220 && time >= 0
value = 223

[State 220, 5]
type = ChangeState
triggerall = statetype = S && command = "y"
trigger1 = stateno = 220 && time >= 0
value = 224

and

[State -1, Stand Strong Punch]
type = ChangeState
value = 220
triggerall = command = "hold_z"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl
Last Edit: March 13, 2019, 02:45:40 am by Cyberq3000

#### Odb718

##### Re: Trying to do special attacks while holding a button.
#2  March 15, 2019, 01:53:50 pm
• Shame on you!
So I would suggest trying ~z to enter the move.
Those change states should be in Statedef -1 also. It wont hurt having them in 220.
But

;   tilde (~) - to detect key releases
;          egs. command = ~a       ;release the a button

Is kinda what you're looking for. If 220 is just your normal attack you may want to try this. It wont be as fast/reliable though.
This also may mess up some keyboard players using hold z+press a. Most keyboards will mess up once a few keys are held down.
Spoiler, click to toggle visibilty
vVv Wheat Stage Released vVv