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
» Stan Lee WIP
by Predator Today at 6:34 am

» I'm baaaaack. With a fun little idea.
by Shadman Today at 5:17 am

» HOW TO CANCEL AN INTRO OF CHAR?
by Mazemerald Today at 4:15 am

» Albert Wesker from Resident Evil
by fede de 10 Today at 2:28 am

» Ult Riverside Training Grounds (Fighters History Dynamite - Yung Mie)
by ELECTRO Today at 1:28 am

» CVS NeoKyo POTS/Infinite (Nests Saga, Tales of Ash & Kusanagi) by Falcon Rapper
by Falcon Rapper Today at 1:26 am

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 : 140
Join date : 2016-01-23

PostSubject: A basic "The less health, the more knockback" code?   Sat Dec 10, 2016 2:35 am

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 : 1970
Join date : 2013-07-04
Age : 19
Location : Portugal

PostSubject: Re: A basic "The less health, the more knockback" code?   Mon Dec 12, 2016 9: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 Mon Dec 12, 2016 5:03 pm; edited 3 times in total
Back to top Go down
View user profile
borewood2013

avatar

Posts : 4629
Join date : 2014-08-11

PostSubject: Re: A basic "The less health, the more knockback" code?   Mon Dec 12, 2016 1:06 pm

@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 : 1970
Join date : 2013-07-04
Age : 19
Location : Portugal

PostSubject: Re: A basic "The less health, the more knockback" code?   Mon Dec 12, 2016 2:03 pm

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 : 140
Join date : 2016-01-23

PostSubject: Re: A basic "The less health, the more knockback" code?   Tue Dec 13, 2016 11: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
borewood2013

avatar

Posts : 4629
Join date : 2014-08-11

PostSubject: Re: A basic "The less health, the more knockback" code?   Fri Dec 16, 2016 7: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
 
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: