YesNoOk
avatar

life = 0 and not KO'd using helper? (Read 1802 times)

Started by Disconcorde, November 02, 2019, 02:53:37 pm
Share this topic:
life = 0 and not KO'd using helper?
#1  November 02, 2019, 02:53:37 pm
  • avatar
  • **
    • UK
If the question isn't clear from the title, it's because I did not know how to make a clear title for what I'm about to ask. I know that if you use a NoKo flag in -2, it will hold your life at 0, and you will be automatically KO'd after the noko ends, if you turn it off and on. You can use a selfstate with a lifeset whilst the NoKo is active to create a resurrection effect, where it looks like p1 has been KO'd by p2, but comes back from the dead.

The problem is that some OHKO's are so quick that they will bypass right through it and kill p1 before the NoKo and SelfState are activated, making p1 KO'd first, and SelfStating after, because the SelfState will still happen.

I feel like that the reason that some OHKO's slip past my resurrection method is because I rely too heavily on that NoKo flag to prevent the KO signal from happening whilst life is at 0. I've observed another character called Fallen-Sanae, and when she is on simultaneous mode with a teammate, she will only die if her teammate dies, she will not be KO'd if her teammate is still alive.


I tried to look at her code. It seems her Statedef 5150 is changed so that it looks like this:

Code:
[Statedef 5150]
type=U
movetype=U
physics=U
hitdefpersist=1
movehitpersist=1

[State ]
type=Null
Trigger1=1
persistent=256
ignorehitpause=1


Of course, you can't just not have a Statedef 5150, but getting rid of everything and putting a null there keeps your character functioning whilst effectively "getting rid of" that state. I tried to copy this to no avail. It seems that was not the reason she could keep fighting whilst she had no life left in simul mode.

I think it's because of a helper. She's using a helper, or a combination of helper(s) and the NoKo flag to achieve being able to stay "alive" whilst her life is at 0.

Whether or not the NoKo flag holds p1s life at 0 or 1 is kind of irrelevent, because once the NoKo ends p1 still dies. In most cases, the SelfState is triggered in time to LifeSet p1 so that it doesn't die, however, if p2 is good enough then the KO signal happens before the SelfState, resulting in a dead p1 with a life value of 350, which is just unappealing.


If there's a way to use helpers to prevent death from happening while p1's life is at 0, so that they can SelfState uninterrupted, I'd like to know how, if that's not how it works, then I'd like to know how it does work if possible. I only think that it's helper related because I don't see any other way, and because I still don't fully understand how they work.
Last Edit: November 03, 2019, 01:38:59 am by Disconcorde
Re: life = 0 and not KO'd using helper?
#2  December 11, 2019, 04:22:56 am
  • avatar
  • **
    • Vietnam
At least you should spend some variable to maintance your life point.

When NoKo flag is triggered. Both player can't be KOed in any circumstance, except when your life point is 0, it will maintance our lifepoint to 1 until the flag is no longer triggered then you will be KOed, unless you have some piece of code that re-fill your lifepoint greater than 1. In that case your ass will NOT be KOed if Noko is un-flagged.

About OHKO, you should known when your char is being hitted by any hitdef or projectile, you still not KOed, but after 1 ticks from that hit, when your lifepoint is 0, you done. That reason is Mugen engine need to spend 1 ticks to made this caculaiton "your next life point = your previous life point - damage point you recieved from hitdef or projectile"

So basically, if you use this trigger "life = 0 && gethitvar(damage) >= (value)"
--> Noko flag won't work and you will constantly KOed even you have SelfStating or lifeset.
------Tremble Mortal and Despair. Doom has come to this world------
Re: life = 0 and not KO'd using helper?
#3  December 18, 2019, 02:43:09 pm
  • avatar
  • **
    • UK
Okay, that makes sense. I have this currently...

Code in Statedef -2:

Code:

[State , UnPauseHelper]
type = helper
triggerall = var(52) = 5
trigger1 = (stateno = 5052 || stateno = 13006 || stateno = 14000 || stateno = 14005) && !numhelper(15150)
id = 15150
stateno = 15150
name = "UNPause"
keyctrl = 0
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State -2, Resist]
type = AssertSpecial
triggerall = var(52) = 5
trigger1 = var(43) < 2 && enemy,alive
trigger2 = stateno = 5052
trigger3 = stateno = 13006
trigger4 = stateno = [14000,14005]
flag = noko
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State a, SaveHelper]
type = Helper
triggerall = var(52) = 5
triggerall = roundno != 3 || stateno != [5100,5150]
trigger1 = (RoundState = 2) && (numhelper(15051) = 0)
helpertype = player
name = "SaveP"
id = 15051
postype = p1
stateno = 5051
keyctrl = 0
ignorehitpause = 1
supermovetime = 999999999999999999999
pausemovetime = 999999999999999999999

[State -2]
type = SelfState
triggerall = var(52) = 5
trigger1 = ishelper(15051)
trigger1 = stateno != 5051
value = 5051
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State a, Save]
type = SelfState
triggerall = var(52) = 5
triggerall = !var(17)
triggerall = stateno != 5052
triggerall = stateno != [5100,5150]
triggerall = (stateno != 14000 || stateno != 14005)
triggerall = roundno != 3
trigger1 = (life <= 0) && (numhelper(15051))
value = 5052
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

State 5052:

Code:
[Statedef 5052]
Type = U
MoveType = U
Physics = N
anim = 7703

[State ]
type = AssertSpecial
trigger1 = 1
flag = NoKo
flag2 = RoundNotOver
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State ]
type = NotHitBy
trigger1 = 1
time = -1
value = SCA
value2 = SCA
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State ]
type = HitOverride
trigger1 = 1
time = -1
attr = SCA,AA,NA,SA,HA,AP,NP,SP,HP,AT,NT,ST,HT
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State , Leave]
type = ChangeState
trigger1 = (var(17)) && var(43) = 2 && var(19) = 2
value = 710
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State , Save]
type = SelfState
triggerall = time >= 1
trigger1 = var(43) < 2 && (life <= 0)
value = 14000
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State , Die]
type = ChangeState
triggerall = time >= 7
trigger1 = var(43) = 2
trigger1 = (life <= 0)
value = 5100
ignorehitpause = 1

[State ]
type = Null
Trigger1 = 1
persistent = 256
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State ]
type = Null
Trigger1 = 1
persistent = 256
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State ]
type = Null
Trigger1 = 1
persistent = 256
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State ]
type = Null
Trigger1 = 1
persistent = 256
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State ]
type = Null
Trigger1 = 1
persistent = 256
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State ]
type = Null
Trigger1 = 1
persistent = 256
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State ]
type = Null
Trigger1 = 1
persistent = 256
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State ]
type = Null
Trigger1 = 1
persistent = 256
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State ]
type = Null
Trigger1 = 1
persistent = 256
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State ]
type = Null
Trigger1 = 1
persistent = 256
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State ]
type = Null
Trigger1 = 1
persistent = 256
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State ]
type = Null
Trigger1 = 1
persistent = 256
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State ]
type = Null
Trigger1 = 1
persistent = 256
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State ]
type = Null
Trigger1 = 1
persistent = 256
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State ]
type = Null
Trigger1 = 1
persistent = 256
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State ]
type = Null
Trigger1 = 1
persistent = 256
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State ]
type = Null
Trigger1 = 1
persistent = 256
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State ]
type = Null
Trigger1 = 1
persistent = 256
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State ]
type = Null
Trigger1 = 1
persistent = 256
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State ]
type = Null
Trigger1 = 1
persistent = 256
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

[State ]
type = Null
Trigger1 = 1
persistent = 256
ignorehitpause = 1
supermovetime = 11111111111
pausemovetime = 11111111111

Alot more nulls but pasting them all is just a waste of space...


This seems to work. When her life is at 0, SaveHelper is a helper which prevents the round from ending, and she has a NoKo active, she then SelfStates to State 5052, and is given immunity to SuperPauses and Pauses through the "UnPauseHelper" and if var(43) is less than 2, she'll SelfState to 14000 where she lifesets to "lifemax / 4" (350 for her). If var(43) is = to 2, then she changes to 5100 and dies normally. The problem now, is that the "Time" trigger won't work for some reason, and I'm about to make a thread for that.