YesNoOk
avatar

[SOLVED] Combo counter checking/resetting  (Read 842 times)

Started by CRZ, August 16, 2011, 04:48:41 am
Share this topic:

CRZ

[SOLVED] Combo counter checking/resetting
#1  August 16, 2011, 04:48:41 am
  • avatar
  • *
I've read elecbyte's wiki about combos, seems like mugen has little with regard to how the combo counter is checked (i.e returning the number of combo hits achieved)

Enemy,gethitvar(hitcount) - This does check the counter, but the problem is it doesn't reset after a combo is over. So if I put this as a trigger for a state to be executed, the state will forever be executed when the combo is completed.

It DOES reset if a new attack comes after the completed combo - so the problem is it'll be an 18-hit combo if both chars do nothing until the attacker starts a new successful attack. Also, unchained attacks can also be 'carried forward' to a new attack. like two LPs being carried forward to an unchained MK, making it a 3-hit combo out of nowhere.
 
Overall this is quite an inaccurate trigger.

hitcount - checks the number of hits for only one state. when the char changes from one state to another, the hitcount from the previous state is lost. Tried hitcountpersist = 1 but this doesn't affect the combo counter in any way (as the wiki says, and as i've tried). uniqhitcount doesn't differ much except for the number of opponents it includes in the combo.

Are there any other more reliable triggers for this?
Last Edit: August 21, 2011, 02:48:38 pm by CRZ
Re: Combo counter checking/resetting
#2  August 16, 2011, 06:13:26 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Quote
Enemy,gethitvar(hitcount)
That one will count hits until the opponent reenters movetype = I

Hitcount itself is only true while you're in an attacking state and if hitcountpersist is following you. Uniqhitcount is much the same.

Hitadd and hitreset will reset the combo counter, but not either of the above 2 triggers. What you'll want to do is use the redirect to give a value to a variable. You can then check if the value is set to 1, while the variable is greater than 1. So you do 10 hits. The counter and the gethitvar both read 10. The counter then resets to 1, the variable is now > counter, so it resets.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

CRZ

Re: Combo counter checking/resetting
#3  August 16, 2011, 09:54:07 am
  • avatar
  • *
Quote
Enemy,gethitvar(hitcount)
That one will count hits until the opponent reenters movetype = I

Hitcount itself is only true while you're in an attacking state and if hitcountpersist is following you. Uniqhitcount is much the same.

Hitadd and hitreset will reset the combo counter, but not either of the above 2 triggers. What you'll want to do is use the redirect to give a value to a variable. You can then check if the value is set to 1, while the variable is greater than 1. So you do 10 hits. The counter and the gethitvar both read 10. The counter then resets to 1, the variable is now > counter, so it resets.

Umm hitreset? I couldn't find it in elecbyte's wiki. Tried it as a state controller, mugen said invalid element.

I don't know if it's just my mugen, it seems that even if p2 returns to movetype = I after getting hit, the enemy,gethitvar(hitcount) doesn't reset. What's even more strange is that this is only the case for certain combos. For instance, jump MK ==> crouch LP ==> crouch LK. If the first two are blocked and crouch LK hits, enemy,gethitvar(hitcount) gives 1 hit, if i repeat the combo again with the same result, enemy,gethitvar(hitcount) will return 2 hits even though the combo counter doesn't appear and state '2 hits'....I know because I've coded a helper to appear once enemy,gethitvar(hitcount) reaches 2 hits. for crouch LK i've already set hitcountpersist = 0 (unrelated but just in case).

the helper's code just to clarify:
[State -2,Helper]
type = Helper
triggerall = teamside = 1
triggerall = !Numhelper(6001)
trigger1 =  movehit && Enemy,gethitvar(hitcount)=[2,3]
pos = 0,0
postype = left
ID = 6001
stateno = 6001
ownpal = 1
keyctrl = 0
facing = 1
persistent = 0

So for your suggestion, I can't get it to work because the variable's value depends on the redirect, which itself isn't working accurately. Any idea where the error is?

Re: Combo counter checking/resetting
#4  August 16, 2011, 03:09:11 pm
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
HitReset is invalid, but MoveHitReset isn't :)

-[Все слова это только слова.]-

CRZ

Re: Combo counter checking/resetting
#5  August 16, 2011, 03:31:54 pm
  • avatar
  • *
HitReset is invalid, but MoveHitReset isn't :)

Ah thanks..what'd be the suitable trigger then? i tried (in State -2):

[State X, Reset]
type = MoveHitReset
trigger1 = statetype != A
persistent = 1

and it still doesn't work, that strange combo is still triggering. it'd only work if i put trigger = stateno = 430 (crouch LK) but that'll disable all combos with crouch LK as well.
Last Edit: August 16, 2011, 03:36:33 pm by CRZ
Re: Combo counter checking/resetting
#6  August 16, 2011, 09:09:41 pm
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
Don't you want to reset when you've hit 2-3 times? It seems like that's when you want this thing to appear, so you'd want to reset the movehit after your hitcount has reached that point.

-[Все слова это только слова.]-

CRZ

Re: Combo counter checking/resetting
#7  August 21, 2011, 02:48:23 pm
  • avatar
  • *
Don't you want to reset when you've hit 2-3 times? It seems like that's when you want this thing to appear, so you'd want to reset the movehit after your hitcount has reached that point.

Actually I've solved it (by looking at someone else's code I admit :P) using two variables which mutually reset each other, the triggers being p2stateno = [5000,5899] and movehit (kudos to DarkCipherLucius's Angel Ken). Hitcount and movehitreset etc don't seem to work very well for some reason.
Re: [SOLVED] Combo counter checking/resetting
#8  August 21, 2011, 02:54:07 pm
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
Whatever works :) Glad you got it working.

-[Все слова это только слова.]-