YesNoOk
avatar

Revival code (Read 888 times)

Started by Ichisennen, November 28, 2010, 01:34:36 pm
Share this topic:
Revival code
#1  November 28, 2010, 01:34:36 pm
  • **
  • That guy who did that thing back then just because
So I've been working on this code which will allow me to remain with 1 hp even after a KO-inducing hit. It does work, problem is, when this character fights himself...... Well, it bugs, and none of them dies. Although he does die when he's fighting others.

Another note is that I've also included a defense code which buffs up my defence when Im at low health.
Code:

Code:
[Statedef -2]

[State -2,011]
Type=VarAdd
Trigger1=life<var(36)
fv=15
value=(var(36)-life)*fvar(14)
ignorehitpause=1

[State -2,012]
Type=LifeAdd
triggerall = life < 300
Trigger1=life>=1
Trigger1=abs(fvar(15))>=1
value=floor(fvar(15))
absolute=1
ignorehitpause=1

[State -2,011]
Type=VarAdd
Trigger1=life<var(36)
fv=18
value=(var(36)-life)*fvar(17)
ignorehitpause=1

[State -2,013]

Type=VarSet
Trigger1=1
fv=15
value=fvar(15)-floor(fvar(15))
ignorehitpause=1

[State -2,015]
Type=VarSet
Trigger1=1
fv=14
value = 0.5
ignorehitpause=1

[State -2,014]
Type=VarSet
Trigger1=1
v=36
value=Life
ignorehitpause=1

[State -2]
Type=Assertspecial
Trigger1=var(37)>0
Trigger1=P2life>0
flag=NoKo
ignorehitpause=1

[State -2]
Type=Lifeset
Trigger1=var(37)>0
Trigger1=Life<=0
value=1
ignorehitpause=1

[State -2]
Type=VarSet
Trigger1=1
var(37)=(movetype=H) || (Life>1)
ignorehitpause=1

So what do you guys think is wrong..?
Re: Revival code
#2  November 28, 2010, 08:34:07 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Fuck knows, add some comments so we get a better idea of what the hell all those variables are actually for. I am surprised the system needs to be so complicated.

lifeset
trigger1 = life < gethitvar(damage)
value = 1

I assume you wish to achieve something else?


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: Revival code
#3  November 29, 2010, 02:19:16 am
  • ***
  • Life is Life... WTF!!
    • www.mugenimperiolatino.com/index.php
This code doesn't works, its imposible "Realive" any character after KO, you can fill his life again and see your player stand again but you can't keep fighting.

one stupid idea is make a helper to fight and hide real character after helper dies with some code you can show your character again aand keep fighting.. i really don't know if exist other way... but revive your character its impossible.  --;
[

Nice userbars no? :P Make click & Download something nice for your Mugen!!!
________________________________
Last Edit: November 29, 2010, 02:24:13 am by leandro1412
Re: Revival code
#4  November 29, 2010, 07:15:00 am
  • *****
  • Mega Klinklang confirmed
    • USA
    • ricepigeon.webs.com

<<-- Updated 09/14/14

You limit yourself so badly when you try to avoid variables. When you get over your fear of the "complexity" of variables, you will find yourself in a better place: A beautiful world where coding is actually fun.
Re: Revival code
#5  November 29, 2010, 03:37:14 pm
  • **
  • That guy who did that thing back then just because
This code doesn't works, its imposible "Realive" any character after KO, you can fill his life again and see your player stand again but you can't keep fighting.

one stupid idea is make a helper to fight and hide real character after helper dies with some code you can show your character again aand keep fighting.. i really don't know if exist other way... but revive your character its impossible.  --;

Sorry, wrong name. Its impossible to revive any character, only make them remain with one hp after a hit, then make them go into some custom state, or make a helper fight like you said. Only this code is more of a second chance thing, since he doesn't go into any custom state/revival animation, just remain with on hp. And yes, this code works, and yes I can still fight. Try copy pasting it into your character, just avoid using the same variable with already used in that character.

Fuck knows, add some comments so we get a better idea of what the hell all those variables are actually for. I am surprised the system needs to be so complicated.

lifeset
trigger1 = life < gethitvar(damage)
value = 1

I assume you wish to achieve something else?

Sorry,  I copy pasted the whole -2 state into this post. To narrow it down, the "remain with 1 hp code" itself is:

Code:
[State -2]
Type=Assertspecial
Trigger1=var(37)>0
Trigger1=P2life>0
flag=NoKo
ignorehitpause=1

[State -2]
Type=Lifeset
Trigger1=var(37)>0
Trigger1=Life<=0
value=1
ignorehitpause=1

[State -2]
Type=VarSet
Trigger1=1
var(37)=(movetype=H) || (Life>1)
ignorehitpause=1
Now I only included the other things because I thought you guys would want to see the other things in my -2 state to help me better............... guess i was wrong.

That bit of code you were saying the life < gethitvar is part of the armor code... disregard that........
Re: Revival code
#6  November 29, 2010, 05:45:31 pm
  • *****
  • Mega Klinklang confirmed
    • USA
    • ricepigeon.webs.com

<<-- Updated 09/14/14

You limit yourself so badly when you try to avoid variables. When you get over your fear of the "complexity" of variables, you will find yourself in a better place: A beautiful world where coding is actually fun.
Re: Revival code
#7  November 29, 2010, 08:29:21 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
NoKo is valid, it's an undocumented incomplete sctrl. It works, but not how you'd expect.

While asserted NOBODY can be knocked out.
If you lose all your life during NoKO and then gain it back, when noko is turned off, you lose anyway.

Ditto for p2. Not the best solution as implementation is incomplete.


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: Revival code
#8  November 29, 2010, 08:33:43 pm
  • avatar
  • ****
what about turning it off then gaining more life?

Why not send out a clone when life is at 10, let the helper fight for a while then remove it after a few hits?
Re: Revival code
#9  November 29, 2010, 08:44:14 pm
  • *****
  • Mega Klinklang confirmed
    • USA
    • ricepigeon.webs.com
what about turning it off then gaining more life?

Why not send out a clone when life is at 10, let the helper fight for a while then remove it after a few hits?

You have 300 life. Opponent uses a level 3 that deals 400 damage in a single hit.

There are too many scenarios where this wouldnt work. Iirc, using a player type helper used to solve this problem in the older versions of mugen, but no longer worked once it became depricated.

One disadvantage to the clone helper method is that helpers can't inherit the -2 and -3 states.

<<-- Updated 09/14/14

You limit yourself so badly when you try to avoid variables. When you get over your fear of the "complexity" of variables, you will find yourself in a better place: A beautiful world where coding is actually fun.
Re: Revival code
#10  November 29, 2010, 09:14:26 pm
  • avatar
  • ****
You mean the player type isn't in mugen 1 or ...what?
deprecated doesn't mean no longer working. Or do you mean it is deprecated and doesn't work.
Re: Revival code
#11  November 29, 2010, 09:58:24 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Deprecated means it still functions but it may be removed from mugen altogether. Basically if you use it it may not function in the next release and you will need a better solution.

This is also why you should use animelemtime over animelem and explod over gamemakeanim.


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: Revival code
#12  November 30, 2010, 05:17:18 am
  • ***
  • Life is Life... WTF!!
    • www.mugenimperiolatino.com/index.php
lol XD Cyanide code Works but i have to update a little  :sugoi: to make your request

;---------------------------------------------------------------------------
; HITG_SHAKE
[Statedef 5000]
type    = S
movetype= H
physics = N
velset = 0,0

[State 0, LifeSet]
type = LifeSet
trigger1 = Gethitvar(Damage) >= Life
value = 1
ignorehitpause = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Gethitvar(Damage) >= Life
flag = noko
ignorehitpause = 1

[State 5000, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(groundtype) = 1),Ifelse(Facing != Enemy,Facing,5000,5010),Ifelse(Facing != Enemy,Facing,5010,5000)) + GetHitVar(animtype)

[State 5000, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5000, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

[State 5000, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5000, 5] ;State type gets set to aerial if getting hit up
type = StateTypeSet
trigger1 = Time = 0
trigger1 = GetHitVar(yvel) != 0 || GetHitVar(fall)
trigger2 = Pos Y != 0
statetype = a

[State 5000, 6]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0 && !GetHitVar(fall)
value = 5001 ;HITG_SLIDE

[State 5000, 7]
type = ChangeState
trigger1 = HitShakeOver
value = 5030

[State 5000, FFB Light]
type = ForceFeedback
trigger1 = anim = 5000
trigger2 = anim = 5010
persistent = 0
time = 6
waveform = square

[State 5000, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5001
trigger2 = anim = 5011
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5000, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5012
trigger2 = anim = 5002
trigger3 = anim = 5030
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

Put this code in 5020 5030 5070 and any start gethit state :D

well you can limit that using a variable ;D try it, really works, don't care your life or gethitvar damage value.

(Target lifeadd and lifeadd could be fixed in -2)

any way like Cyanide says "Not the best solution as implementation is incomplete."
[

Nice userbars no? :P Make click & Download something nice for your Mugen!!!
________________________________
Re: Revival code
#13  November 30, 2010, 10:47:22 am
  • **
  • That guy who did that thing back then just because
Quote
[State 0, LifeSet]
type = LifeSet
trigger1 = Gethitvar(Damage) >= Life
value = 1
ignorehitpause = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Gethitvar(Damage) >= Life
flag = noko
ignorehitpause = 1

Hmm. This almost got it, but i think this will make me invincible? I dunno, I'm not really that sure. If i insert this into my hitstates, each time i go to a hitstate, this'll negate all damages greater than my current life, and set my life to one. But there's no part in it that says to not do this when I have one life left. So ill keep remaining with one life no matter what, hence ill be unkillable... i dont want that. All i want is to remain with one life for one time after a KO-hit/combo, and then die when Im hit with 1 life. So unless i heal(yep, char has a small heal ability), i'll die after another non-combo hit. Maybe a bit more edit and this will work, ill try to go by this approach.
Last Edit: November 30, 2010, 10:53:43 am by Ichisennen
Re: Revival code
#14  November 30, 2010, 01:15:05 pm
  • ***
  • Life is Life... WTF!!
    • www.mugenimperiolatino.com/index.php
Add new Triggers

[State 0, LifeSet]
type = LifeSet
triggerall = Life > 1 && Alive
trigger1 = Gethitvar(Damage) >= Life
value = 1
ignorehitpause = 1

[State 0, AssertSpecial]
type = AssertSpecial
triggerall = Life > 1 && Alive
trigger1 = Gethitvar(Damage) >= Life
flag = noko
ignorehitpause = 1
[

Nice userbars no? :P Make click & Download something nice for your Mugen!!!
________________________________
Re: Revival code
#15  November 30, 2010, 08:51:21 pm
  • *****
  • Mega Klinklang confirmed
    • USA
    • ricepigeon.webs.com
It wont activate on custom states with the above code. Not sure if you want it that way, but more than likely not.

<<-- Updated 09/14/14

You limit yourself so badly when you try to avoid variables. When you get over your fear of the "complexity" of variables, you will find yourself in a better place: A beautiful world where coding is actually fun.
Re: Revival code
#16  November 30, 2010, 09:50:42 pm
  • ****
  • HAHAHAHAHAHAHAHA
    • Chile
Just add them to -2 state, variables to check the three possible states (alive, alive but knocked and returning to life), with 5110 state as a optional trigger. That's all. Just experiment and try every combination, that's what a coder do.
Re: Revival code
#17  December 01, 2010, 10:36:15 am
  • **
  • That guy who did that thing back then just because


Just add them to -2 state, variables to check the three possible states (alive, alive but knocked and returning to life), with 5110 state as a optional trigger. That's all. Just experiment and try every combination, that's what a coder do.

Again, if i wanted to put it just in my -2 state i would've just used my original code, because it works, just that it bugs when my character fights himself. This "solution" your giving would be if code didn't work, but I did say it works, doesn't it? Just that it bugs.

And yes, like a coder, I have done everything to make it work via -2 states, thats why im asking here for newer possibities which i haven't thought of, like the one leandro1412 gave me. Thats why we have something called development HELP; when one not as well off as you has ran out of ideas. I won't ask here if it was out of the bounds of my knowledge, woundn't I?

And no, just posting it plus adding variables for the three states does not work.

Add new Triggers

[State 0, LifeSet]
type = LifeSet
triggerall = Life > 1 && Alive
trigger1 = Gethitvar(Damage) >= Life
value = 1
ignorehitpause = 1

[State 0, AssertSpecial]
type = AssertSpecial
triggerall = Life > 1 && Alive
trigger1 = Gethitvar(Damage) >= Life
flag = noko
ignorehitpause = 1


Don't know why but it plain doesn't just work anymore when I add that.  Twas better before, still thanks again XD  :sugoi:

It wont activate on custom states with the above code. Not sure if you want it that way, but more than likely not.

Nope, I don't, and it doesn't work when I'm combo'ed as well.

Eurgh.
Re: Revival code
#18  December 01, 2010, 02:44:24 pm
  • ***
  • Life is Life... WTF!!
    • www.mugenimperiolatino.com/index.php
Ok then we go to improve that with a var ;D

;---------------------------------------------------------------------------
; HITG_SHAKE
[Statedef 5000]
type    = S
movetype= H
physics = N
velset = 0,0

[State 0, LifeSet]
type = LifeSet
triggerall = !Sysvar(4)
trigger1 = Gethitvar(Damage) >= Life
value = 1
ignorehitpause = 1

[State 0, AssertSpecial]
type = AssertSpecial
triggerall = !Sysvar(4)
trigger1 = Gethitvar(Damage) >= Life
flag = noko
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = !SysVar(4) || Life <= 1
sysvar(4) = 1


Whit this switch you should fix just for one time the not one hit kill :D don't care the damage amount.

Sorry but i can't understand why you are using this code (first posted), what are u looking with that, ahh by the way you cant do that in -2 or -3 because that starts detection from tic 1 (Time = 1) so we cant detect the time 0 codes... lifeadd and hold the gethitvar(damage) jeje XD for that you must to edit all Gethit shake states (for example 5000) its like and armor mode XD
[

Nice userbars no? :P Make click & Download something nice for your Mugen!!!
________________________________
Re: Revival code
#19  December 01, 2010, 04:37:06 pm
  • *****
  • Mega Klinklang confirmed
    • USA
    • ricepigeon.webs.com
I dont think messing around with sysvars is a good idea, especially since only sysvar(0) and sysvar(1) are actually used and supported.

Either way, theres no reason why such a code should bug if you're fighting yourself and it works otherwise

<<-- Updated 09/14/14

You limit yourself so badly when you try to avoid variables. When you get over your fear of the "complexity" of variables, you will find yourself in a better place: A beautiful world where coding is actually fun.
Last Edit: December 01, 2010, 04:45:52 pm by DUCTRUONG
Re: Revival code
#20  December 01, 2010, 05:24:38 pm
  • ***
  • Life is Life... WTF!!
    • www.mugenimperiolatino.com/index.php
I dont think messing around with sysvars is a good idea, especially since only sysvar(0) and sysvar(1) are actually used and supported.

Either way, theres no reason why such a code should bug if you're fighting yourself and it works otherwise

emm i use sysvar(4) because its so weird use for other thing else XD he can use anything :P
[

Nice userbars no? :P Make click & Download something nice for your Mugen!!!
________________________________
Re: Revival code
#21  December 02, 2010, 04:08:20 pm
  • **
  • That guy who did that thing back then just because
I dont think messing around with sysvars is a good idea, especially since only sysvar(0) and sysvar(1) are actually used and supported.

Either way, theres no reason why such a code should bug if you're fighting yourself and it works otherwise
I know, and that's what made me ask professional help  :'( If you think about it, if it works against other characters it should work against you... But it just confuses me why not lol.

Sysvar(1) ++ aint supported? Why not?

Ok then we go to improve that with a var ;D

;---------------------------------------------------------------------------
; HITG_SHAKE
[Statedef 5000]
type    = S
movetype= H
physics = N
velset = 0,0

[State 0, LifeSet]
type = LifeSet
triggerall = !Sysvar(4)
trigger1 = Gethitvar(Damage) >= Life
value = 1
ignorehitpause = 1

[State 0, AssertSpecial]
type = AssertSpecial
triggerall = !Sysvar(4)
trigger1 = Gethitvar(Damage) >= Life
flag = noko
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = !SysVar(4) || Life <= 1
sysvar(4) = 1


Whit this switch you should fix just for one time the not one hit kill :D don't care the damage amount.

Sorry but i can't understand why you are using this code (first posted), what are u looking with that, ahh by the way you cant do that in -2 or -3 because that starts detection from tic 1 (Time = 1) so we cant detect the time 0 codes... lifeadd and hold the gethitvar(damage) jeje XD for that you must to edit all Gethit shake states (for example 5000) its like and armor mode XD


Thanks again leandro XDXD , gonna try this out tommorow morning... I'll edit if anything else wrong comes up.
Re: Revival code
#22  December 02, 2010, 04:19:14 pm
  • ***
  • Life is Life... WTF!!
    • www.mugenimperiolatino.com/index.php
Sysvar(1) ++ aint supported? Why not?

I don't have any idea if these vars aren't spported XD but in winmugen and mugen 1.0 works fine  :sugoi: and i don't know why elecbyte recommend don't use them...
[

Nice userbars no? :P Make click & Download something nice for your Mugen!!!
________________________________
Re: Revival code
#23  December 02, 2010, 08:46:06 pm
  • *****
  • Mega Klinklang confirmed
    • USA
    • ricepigeon.webs.com
If youre going to use a sysvar for that purpose, then you might as well be using a normal variable. In fact, there is absolutely no reason not to.

<<-- Updated 09/14/14

You limit yourself so badly when you try to avoid variables. When you get over your fear of the "complexity" of variables, you will find yourself in a better place: A beautiful world where coding is actually fun.
Re: Revival code
#24  December 04, 2010, 03:41:12 pm
  • **
  • That guy who did that thing back then just because
Got it working. The solution was simpler than i thought lol.

[State -2]
Type=VarSet
Trigger1=1
var(37)=((movetype=H) && (var(37)>0)) || (Life>1)
ignorehitpause=1

Thanks to all that gave me solutions and help  :sugoi: