YesNoOk
avatar

Help. Using different hitdef if you hold a button. (etc.) (Read 3939 times)

Started by Momotaro, May 12, 2025, 07:41:32 pm
Share this topic:
Help. Using different hitdef if you hold a button. (etc.)
#1  May 12, 2025, 07:41:32 pm
  • *****
  • A.K.A. NED
  • I like to draw fighting game characters...
Hi,

I'm back to some old project editing.
To explain, this is some heavy punch state (state 220)
There are 2 ways to reach this move : During a run "input is X", or during a regular punch combo "x, x, x" (200, 210, then 220)

I would like this state to use 2 different hitdefs depending on these conditions :

*Knockdown version (+ some other adjustments)*
-if player holds X button
or
-if prevsate is 100 (run)
or
-a combination of these conditions (hold x and prevstate stuff...)

*NON Knockdown version (+ some other adjustments)*
-Not holding X (just hitting x normally)

How to make it working effectively ?
Thanks

Very OLD code... (just as a reference of how I tried to make it long time ago)
I have not touched it for decades...
But it seems buggy ingame. And I'm sure there are some ways to make it more effective
Code:
[State 220, 3] ;RESET hold detect, not released
type = VarSet
trigger1 = time = 0
v = 2
value = 0

[State 220, 3] ;hold detect, or running , or counter attack(fall detect)
type = VarSet
triggerall = time = 1
trigger1 = command != "Rx";(release x)
trigger1 = command = "hold_x"
trigger2 = prevstateno = 100
v = 2
value = 1

[State 220, 1];holdbutton, fall => non cancellable
type = HitDef
;triggerall = command != "Rx"
triggerall = command = "hold_x"
trigger1 = animelem = 2;time = 0
...ETC
.
.
.

[State 220, 1];pas de fall => cancellable
type = HitDef
triggerall = prevstateno != 100
trigger1 = command = "Rx"
trigger1 = time <= 8
...ETC
.
.
.
Last Edit: May 15, 2025, 12:18:37 pm by Momotaro
Re: Help. Using different hitdef if you hold a button. (etc.)
#2  May 15, 2025, 12:19:23 pm
  • *****
  • A.K.A. NED
  • I like to draw fighting game characters...
Bump for some help.
Thanks

+ I renamed for more clarity
Re: Help. Using different hitdef if you hold a button. (etc.)
#3  May 16, 2025, 12:39:54 pm
  • avatar
  • ***
    • https://sites.google.com/site/mgmurrow/
Put this hit def first

[State 220, 1];pas de fall => cancellable
type = HitDef
triggerall = time <= 8
triggerall = prevstateno != 100
trigger1 = command !=  "hold_x"

Then this one

[State 220, 1];holdbutton, fall => non cancellable
type = HitDef
triggerall = animelem = 2;time = 0
trigger1 = command = "hold_x"
trigger2 = prevstateno = 100

Hope this helps

MGMURROW