How to make the helper appear when P1 is hit by P2 or P2's helper

Started by DosKillerFighterTrue, June 04, 2025, 10:44:20 PM

Previous topic - Next topic

DosKillerFighterTrue

Hi, I've been trying to create the helper. I want it to appear when P1 is hit by P2 or its own helper, and subtract all the damage from P2. I've already set up hitdef with a huge hitbox and damage = 9999, but it doesn't work. I've already set movetype = H and nothing, and if I set movetype = A, P2 dies without being hit by P1. I also tried trigger1 = p2movetype = A or H, but it didn't work.
I'm not sure how to write the code correctly so that the helper appears when P1 is hit or P2's helper.




[State -1, Helper Die P2]
type = Helper
trigger1 = roundstate = 2
trigger1 = numhelper(9999) = 0
trigger1 = p2movetype = A
helpertype = normal
name = "Helper Die P2"
ID = 9999
stateno = 9999
pos = 0,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause = 0




Thanks in advance.

Sorry if there's a Spanish word, I'm using Google Translate.

Odb718

So this sounds like Super Armor. If P2 hits P1, P2 gets damaged?

"and if I set movetype = A, P2 dies without being hit by P1."
That's exactly what you should expect to happen. The helper will take all of P2's life.

Does this helper use actual sprites? Because I feel like you have it as a blank animation; Which might be adding to your confusion. Make it have an animation so you can see when it appears. Use a destroyself with a timer so it goes away on it's own.

" and subtract all the damage from P2."
Do you mean you want the damage P2 would have done to P1 to be taken from P2? Like a mirror damage, P1 and P2 get the same damage? Or P1 gets no damage and P2 only hurts itself?
vVv Gouken718 vVv SabreTooth718 vVv


DosKillerFighterTrue

Thanks for the reply!

Let me try to explain it more clearly.

Yes, I want to make it so that when P1 is doing a long combo (like an Ultra Combo in Killer Instinct) and P2 hits P1 with a projectile or helper, P2 should still die even if the combo gets interrupted.

The problem I'm facing is that when P1 is hitting P2, and P2 has 0 life, sometimes P2 doesn't die if P1 gets hit during the combo by a helper (like a projectile or fireball). The combo gets interrupted, and P2 survives with 0 HP. That's what I'm trying to fix.

What I tried:
Using a helper with "damage = 9999" to force P2 to die
Triggering the helper when "p2movetype = A" or "p2movetype = H"
Setting "movetype = A" or "movetype = H" in the helper
Making the helper appear when P1 is hit

What I want:
If P1 gets hit during a long combo, and P2 is already at 0 life, P2 should die anyway, even if the combo is interrupted.
I don't want to manually copy code into every custom state of every opponent.
I want this to work more automatically, like a system.

I'm not trying to reflect damage like "mirror damage" or "super armor". I just want to guarantee that P2 dies if they are at 0 life and were being hit by P1 even if P1 gets hit during the combo.

Let me know if this is more clear! If not, I can make a quick video example.
Thanks again for helping me!

Odb718

Does the combo rely on regular attacks to have P2 do hit reactions, or do you send P2 to 1 custom state, or do you send P2 to one custom state that keeps going down a list of custom states to match P1's attacks?


----
If the combo relies on regular attacks, something is probably odd with P2.
If you send them to 1 custom state, you should be able to send them to their death using a SelfState. You'll probably want to add

trigger2 = life <=0
or whatever the next trigger number is to existing selfstates. There shouldn't be a need for a helper to kill P2. We just have to make mugen realize they're dead.
If the selfstate doesn't fix the issue, there might be code inside P2 like super armor. Try to test against this using different characters. If you use debug buttons, you can press F2 on the keyboard to subtract P1 and P2's health to 0 for easy kills. I'm not sure if you have Fighter Factory 3 set up, but you can launch into P1 vs a different character and fight over and over. So dying 200+ times doesn't require reloading the battle. It always acts like the first round.
vVv Gouken718 vVv SabreTooth718 vVv


DosKillerFighterTrue

I forgot to tell you 7 days ago. I've finally solved it.

[Statedef -3] or [Statedef -2]

[State 0, TargetLifeAdd]
type = TargetLifeAdd
triggerall =! map (Finish); so the ultra only activates if we've won the first round
trigger1 = p2life < 0
trigger1 = movetype = H
value = -1
kill = 1
absolute = 1

There's still a chance there's a bug or not, but for now it works.
And I'm sorry I didn't mention it. I sent a suggestion to Niragla93 to update his ki char, and I forgot to share the solution in this post.