YesNoOk
avatar

How to prevent the character from sliding  (Read 291 times)

Started by luis2345, December 30, 2013, 12:01:32 pm
Share this topic:
How to prevent the character from sliding
#1  December 30, 2013, 12:01:32 pm
  • **
When my character runs and i perform any attack it keeps some momentum sliding slightly.
How do i prevent this? it's probably easy to fix but couldn't find anything about it.
http://www.mugen-infantry.net/forum/index.php?topic=64575
By Matrimelee
Luis2345 Video thread
AI\'s : Cassandra,Fliz,Angel,Kung fu Man,Ai,Yuri,Adon
Re: How to prevent the character from sliding
#2  December 30, 2013, 12:16:38 pm
  • ****
  • play more SNK games
    • South Africa
    • www.trinitymugen.net/
Add this to the statedef of the attack

[Statedef whatever]
type = whatever
movetype = whatever
physics = whatever
velset = 0,0 <- just add that line
Re: How to prevent the character from sliding
#3  December 30, 2013, 12:43:22 pm
  • **
Thanks, that works but i found it a little time consuming to do that for every state so i found a way around it:

Added this to the statedef -2

Code:
[State -2, ]
type = velset
triggerall = prevstateno = [100,101]
trigger1 = statetype != A && Movetype = A && time = 1
x = 0



Perhaps i am losing 1 tick but nothing noticeable, works fine for me.
Leaving it here in case someone else is looking for something similar.
http://www.mugen-infantry.net/forum/index.php?topic=64575
By Matrimelee
Luis2345 Video thread
AI\'s : Cassandra,Fliz,Angel,Kung fu Man,Ai,Yuri,Adon
Re: How to prevent the character from sliding
#4  December 30, 2013, 12:48:17 pm
  • *****
  • Christmas? /人◕ ‿‿ ◕人\
    • UK
Time consuming? Don't be lazy. The way Websta said it is the correct way to do it.
Is a mess. :gonk: Needs sexy new coding to go with sexy sprites.
Re: How to prevent the character from sliding
#5  December 30, 2013, 01:07:17 pm
  • **
Fullgame purposes , that's why i think it's pretty time consuming.
Not sure what's the downside of this other method.
http://www.mugen-infantry.net/forum/index.php?topic=64575
By Matrimelee
Luis2345 Video thread
AI\'s : Cassandra,Fliz,Angel,Kung fu Man,Ai,Yuri,Adon
Re: How to prevent the character from sliding
#6  December 30, 2013, 04:51:16 pm
  • *****
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
It's called optimization.

By using the -2 state, you are forcing the engine to perform every gametick (that is, 60 times per second) a check to see if the previous state was [100, 101]. That check is ridiculous to perform if you are in whatever state other than [100, 101], for example, standing idle.

XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
Re: How to prevent the character from sliding
#7  December 30, 2013, 06:13:02 pm
  • ******
  • [E]
    • Mexico
that makes me wonder what kind of characters are you using for your full game that have that kind of bug.
Re: How to prevent the character from sliding
#8  December 30, 2013, 08:06:34 pm
  • *****
  • Most dangerous person in Mugen
    • USA
    • caddie.smeenet.org
You can also just put velset = 0,0 right under the statedef.