A place to have fun with Mugen
 
PortalHomeFAQMemberlistSearchRegisterComic WIP TrackerDownloadsLog inChat
Website Navigation Help
Translate the Website
Log in
Username:
Password:
Log in automatically: 
:: I forgot my password
Latest topics
» Michael Myers hallowen MK edit
by skhsato123 Today at 10:34 am

» Supreme Sagat BETA 2.0. by M206 NEW RELEASE 14 December
by m206 Today at 10:19 am

» THE FIRST KEIJO!!!!!!!! FIGHTING GAME I FINALLY MADE IT!
by Dragon972 Today at 2:37 am

» Batman font letters
by yolomate Yesterday at 9:27 pm

» Axel Hawk Stage FFS - Daytime Released
by Mr.Welldone Yesterday at 7:23 pm

» TK's Lets Play: Legend of Zelda - Temples of Turmoil Revamped 2017 (ZC)
by TK830515 Yesterday at 1:17 pm

Special Features at MMV






Chat on MMV w/ Discord


Share | 
 

 A basic "The less health, the more knockback" code?

View previous topic View next topic Go down 
AuthorMessage
Mega_Man

avatar

Posts : 145
Join date : 2016-01-23

PostSubject: A basic "The less health, the more knockback" code?   December 9th 2016, 8:35 pm

I am pretty sure this is possible. If so, any ideas to make this? I have already accomplished the opposite with a simple P2Life but changing the - and / to a + and * is not enough.
Back to top Go down
View user profile
Mistah Jorge

avatar

Posts : 2020
Join date : 2013-07-04
Age : 19
Location : Portugal

PostSubject: Re: A basic "The less health, the more knockback" code?   December 12th 2016, 3:09 am

hum... try this:
("your knockback value" * (1 + (1 - (LifeMax/1000)))) 04 Try this idea by borewood instead 04 ("your knockback value" * (1 + (1 - (Life/LifeMax))))


Last edited by Mistah Jorge on December 12th 2016, 11:03 am; edited 3 times in total
Back to top Go down
View user profile
Werewood

avatar

Posts : 5428
Join date : 2014-08-11

PostSubject: Re: A basic "The less health, the more knockback" code?   December 12th 2016, 7:06 am

@Mistah Jorge:
might be try "Life/LifeMax" because some MUGEN characters have Life value more than 1000? Wink

And wait, which MUGEN case did you mean Mega_Man? Question
1) P1's Life down => P1 gets knocked back more
2) P1's Life down => P2 gets knocked back more
3) P2's Life down => P2 gets knocked back more
4) P2's Life down => P1 gets knocked back more
I am asking because for each different MUGEN case the MUGEN code shall be different too...
Back to top Go down
View user profile https://onedrive.live.com/?cid=7DB65F02B0BBD12E
Mistah Jorge

avatar

Posts : 2020
Join date : 2013-07-04
Age : 19
Location : Portugal

PostSubject: Re: A basic "The less health, the more knockback" code?   December 12th 2016, 8:03 am

Yes i tried it, and thanks for correcting me, your way is better
Back to top Go down
View user profile
Mega_Man

avatar

Posts : 145
Join date : 2016-01-23

PostSubject: Re: A basic "The less health, the more knockback" code?   December 13th 2016, 5:53 pm

borewood2013 wrote:
@Mistah Jorge:
might be try "Life/LifeMax" because some MUGEN characters have Life value more than 1000? Wink

And wait, which MUGEN case did you mean Mega_Man? Question
1) P1's Life down => P1 gets knocked back more
2) P1's Life down => P2 gets knocked back more
3) P2's Life down => P2 gets knocked back more
4) P2's Life down => P1 gets knocked back more
I am asking because for each different MUGEN case the MUGEN code shall be different too...
Number 4...

The one that Jorge provided seemed to of had the same knockback no matter the health P2 has. Maybe it's just not noticable?

Back to top Go down
View user profile
Werewood

avatar

Posts : 5428
Join date : 2014-08-11

PostSubject: Re: A basic "The less health, the more knockback" code?   December 16th 2016, 1:15 pm

>> Number 4...
So, your MUGEN case is:  "4) P2's Life down => P1 gets knocked back more" 

Perhaps you might want to try this  geek:

A) Under your [Statedef -2], use a MUGEN float variable to keep recording your MUGEN Enemy's Life:
[State -2, VarSet]  ;;; make sure your FVar(39) MUGEN float variable is not in use...
type = VarSet
triggerall = NumEnemy
triggerall = EnemyNear, Alive = 1 && EnemyNear, Life != 0
trigger1 = 1
fv = 39
value = EnemyNear, Life
ignorehitpause = 1
persistent = 1

B) Under your [Statedef -3], use a VelMul MUGEN State Controller to make your x-velocity multiple by the FVar(39) MUGEN float variable, and your MUGEN Character's State Time:
[State -3, VelMul] ;P2's Life down => P1 gets knocked back more (on ground only & not in P2's custom states)
type = VelMul
triggerall = NumEnemy
triggerall = StateType != A
triggerall = StateType != L
triggerall = MoveType = H
triggerall = Alive = 1 && Life != 0
triggerall = EnemyNear, Alive = 1 && EnemyNear, Life != 0
triggerall = EnemyNear, Life < EnemyNear, LifeMax
trigger1 = GetHitVar(xvel) != 0.0
trigger1 = GetHitVar(hitshaketime) = 0
trigger1 = Time = [1, 2]  ; [1, #] => the bigger # is, the longer time VelMul is in effect....
x = 1.0 + ((EnemyNear, LifeMax - FVar(39)) / EnemyNear, LifeMax)
y = 0.0
ignorehitpause = 0
persistent = 1

-------------------------------------------------

P.S. OK I tried to use just the "1.0 + ((EnemyNear, LifeMax - EnemyNear, Life) / EnemyNear, LifeMax)" for the VelMul x = value, but somehow it didn't work.........and it can work only by using a MUGEN float variable (FVar(39), which I chose it as it is the biggest MUGEN float variable you can have) to record your MUGEN Enemy's Life........don't know why........ scratch
Back to top Go down
View user profile https://onedrive.live.com/?cid=7DB65F02B0BBD12E
Sponsored content




PostSubject: Re: A basic "The less health, the more knockback" code?   

Back to top Go down
 
A basic "The less health, the more knockback" code?
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
The Mugen Multiverse :: Mugen :: Mugen Help-
Jump to: