YesNoOk
avatar

Hitspark don't appear when both characters get hit at the same time (Read 571 times)

Started by Continuity, October 24, 2009, 12:01:06 am
Share this topic:
Hitspark don't appear when both characters get hit at the same time
#1  October 24, 2009, 12:01:06 am
  • ***
  • 我が名は 「ハクメン」、押して参る!
the title says it all, I use helper to make the hitspark and encountered this problem, here's my code
[mcode][state 200, hitspark]
type=helper
trigger1=movehit
stateno=8000
size.xscale=0.5
size.yscale=0.5
pos=ceil(p2bodydist x+35), -86
postype=p1
ownpal=1
keyctrl=0
ignorehitpause=1
persistent=0[/mcode]

it usually works fine, but when both characters hit each other at the same time, the hitspark won't appear, any advice? thank you
Re: Hitspark don't appear when both characters get hit at the same time
#2  October 24, 2009, 12:18:59 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
when that helper shows up, you're in a gethitstate and you no longer have movetype = A therefore movehit is no longer true.

I think this is fixable, but i'm not 100% on how to do it. Possibly having a helper detect parent's movehit and it creates the spark.


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.
Re: Hitspark don't appear when both characters get hit at the same time
#3  October 24, 2009, 01:48:27 am
  • ***
  • 我が名は 「ハクメン」、押して参る!
thanks cyanide for telling me the science behind it, still unable to get it to work though. Additional help is appreciated, thanks
Re: Hitspark don't appear when both characters get hit at the same time
#4  October 24, 2009, 01:32:23 pm
  • **
There are two reasons why this helper is not created in this case:
1. movehit never turns 1 if both hit
2. your char is immediately in another (hit) state so of course this controller cant trigger

I think all chars that dont use the hitdef sparks have this problem (unsolved).

If you want to solve this problem anyway, you will have to create a hitspark helper shortly before the hitdef is active.
This helper then has to detect normal hits and the special "both hit" case.
Basically you use an explod with the parent,movehit trigger for normal hits and specifically check the case when both hit at the same time, by checking both the enemy and the parent for movetype=H and AnimElem=1.

If you have more than one opponent I think there is theoretically a very very little chance that this will trigger if it shouldnt, but I still think this is the best way to do this.
Latest Creation: SSBB Assist Trophies
Re: Hitspark don't appear when both characters get hit at the same time
#5  October 25, 2009, 06:00:46 pm
  • ***
maybe this works...

triggerall = P2stateno = [5000,5999]

so when enemy gets to that state (even if both hits them selves they get in that stage after hit -.-) the helper will show up..
Re: Hitspark don't appear when both characters get hit at the same time
#6  October 25, 2009, 09:34:53 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
No, then you'd get spamming. Or random hitsparks in teammode even when you haven't hit them just because your opponent has.


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.
Re: Hitspark don't appear when both characters get hit at the same time
#7  October 25, 2009, 09:44:44 pm
  • ***
nop...I forgot is like this:
triggerall = P2stateno = [5000,5999]
trigger1 = MoveHit

So u hit and only if the other char gets to that stage the spark will appearing :D
Re: Hitspark don't appear when both characters get hit at the same time
#8  October 25, 2009, 09:49:55 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
He has something similar to that already. It doesn't work because he's no longer in movehit when p2stateno = 5000 It's a double hit, you're both in state 5000+ at the same time. At that point movehit is no longer true as you are movetype = H rather than movetype = A


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.
Re: Hitspark don't appear when both characters get hit at the same time
#9  October 25, 2009, 10:07:28 pm
  • ***
but as u HIT and the opponent is in the state the spark will apear...
Re: Hitspark don't appear when both characters get hit at the same time
#10  October 25, 2009, 10:12:06 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Read his first post again. He already HAS that effect. He wants it to work when both him and p2 hit at the same time.

Due to the way hitdefs work. Everything in a hitdef is processed at the same time. If for any reason there's a dual hit state checking will be canceled and they go off to the next state. Helper creations and triggers etc happening at that point wind up waiting a tick. So you miss the movetype = A and only get movetype = H.

What you posted would work (to an extent) but ONLY if you're the only one hitting. If you both hit at the same time your code will not work.


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.
Re: Hitspark don't appear when both characters get hit at the same time
#11  October 25, 2009, 10:31:35 pm
  • ***
he just need to add and leave all like it is right now

triggerall = P2stateno = [5000,5999]

Let him try....i bet it will work
Re: Hitspark don't appear when both characters get hit at the same time
#12  October 25, 2009, 10:50:08 pm
  • **
Latest Creation: SSBB Assist Trophies
Re: Hitspark don't appear when both characters get hit at the same time
#13  October 26, 2009, 12:09:19 am
  • ***
yeah...u were alkl right  :-\ srry for arguing.