Jump to content
  • 0

Trying to alter a Monster's Movement


MugoUrth

Question

I'm trying to edit this MUGEN Character's movements to make him feel a bit more... well it's hard to explain, but I'm trying to figure out a few things.

 

1: I want this character to pause his movements during certain frames.

2: I also want the screen to shake a bit during the same frames.

I got the code right here. It's to one of the Ryugens.

Spoiler

[Statedef 20]
Type    = S
Physics = S
SprPriority = 0

 

[State 20, AI]
Type = ChangeState
Trigger1 = Var(59) > 0
Value = 0
Ctrl = 1

 

[State 20, 1]
Type = VelSet
TriggerAll = PalNo != 12
Trigger1 = Command = "holdfwd"
X = Const(Velocity.Walk.Fwd.X)

 

[State 20, 2]
Type = VelSet
TriggerAll = PalNo != 12
Trigger1 = Command = "holdback"
X = Const(Velocity.Walk.Back.X)

 

[State 20, P12ƒJƒ‰[ŒÀ’è‚̈—]
Type = VelSet
TriggerAll = PalNo = 12
Trigger1 = Command = "holdfwd"
X = Const(Velocity.Walk.Fwd.X) * 1.5

 

[State 20, P12ƒJƒ‰[ŒÀ’è‚̈—]
Type = VelSet
TriggerAll = PalNo = 12
Trigger1 = Command = "holdback"
X = Const(Velocity.Walk.Back.X) * 1.5

 

[State 20, 3]
Type = ChangeAnim
TriggerAll = Vel X > 0
Trigger1 = Anim != 20 && Anim != 5
Trigger2 = Anim = 5 && AnimTime = 0
Value = 20

 

[State 20, 4]
Type = ChangeAnim
TriggerAll = Vel X < 0
Trigger1 = Anim != 21 && Anim != 5
Trigger2 = Anim = 5 && AnimTime = 0
Value = 21

 

[State 20, ‘«‰¹]
Type = PlaySnd
Trigger1 = AnimElemTime(2) = 1
Trigger2 = AnimElemTime(9) = 1
Trigger3 = AnimElemTime(16) = 1
Trigger4 = AnimElemTime(23) = 1
Value = 2, 4

 

 

[State 20, ‘«‰¹]
Type = VelSet
Trigger1 = AnimElemTime (2) = 2
Trigger1 = AnimElemTime (9) = 2
Trigger1 = AnimElemTime (16) = 2
Trigger1 = AnimElemTime (23) = 2
Value = Vel = 0

 

The stuff in Green was my attempt at changing the code. I see the "VelSet" and "EnvShake" options, but when trying to use them, nothing happens. I think it might be because of the "Const" states in the higher State sections, but I'm not sure.

 

One more thing:

3: I'm also trying to keep him in the air longer during a jump without raising his height.

 

I know there's no point to this, but I don't know. He's a boss character, and I guess it's just me wanting to make him feel even more like one.

Link to comment
Share on other sites

18 answers to this question

Recommended Posts

  • 1

Increasing the number would only change the tick it activates on.

 

You'll need to set a range of ticks if you want the effect to last more than one tick, though the range can only go as high as the number of ticks in that animation frame, meaning you may also need to mess with the animation timings if you want to achieve the desired effect.

 

Using [1,20] would cause the VelSet to activate on ticks 1 to 20 of the animation frame, though I doubt there are actually 20 ticks in a single frame, hence why I said you'll need to adjust the animation timings.

Link to comment
Share on other sites

  • 0

The other VelSets are conflicting with yours; they're telling the character to move a set amount of pixels every tick.

 

Also, Value = Vel = 0 is wrong, as it would return either 1 or 0 depending on whether the statement is true or not (and it returns false (0), as the character is moving). You want value = 0.

Link to comment
Share on other sites

  • 0
1 hour ago, GarchompMatt said:

The other VelSets are conflicting with yours; they're telling the character to move a set amount of pixels every tick.

 

Also, Value = Vel = 0 is wrong, as it would return either 1 or 0 depending on whether the statement is true or not (and it returns false (0), as the character is moving). You want value = 0.

 

I kind of figured, but how do I fix it? And if I fix that, will I also be able to make the screen shake with each step?

 

Edit: I figured out how to make the screen quake with every step, but I'm still stumped on my other two problems.

Link to comment
Share on other sites

  • 0

I also forgot to mention that your VelSet code will not function because all of those triggers have to return true at the same time, which is impossible; notice that the PlaySnd controller above it has each condition as its own trigger number. Also, 'vel' on its own is invalid, as you're not specifying the axis of the velocity (vel x or vel y, for example).

 

As for getting it to work, you'd have to tell all the other VelSets to not activate when the stopping conditions are met, to prevent conflicts. EnvShake should work in the same manner as the PlaySnd.

Link to comment
Share on other sites

  • 0
Just now, GarchompMatt said:

I also forgot to mention that your VelSet code will not function because all of those triggers have to return true at the same time, which is impossible; notice that the PlaySnd controller above it has each condition as its own trigger number. Also, 'vel' on its own is invalid, as you're not specifying the axis of the velocity (vel x or vel y, for example).

 

As for getting it to work, you'd have to tell all the other VelSets to not activate when the stopping conditions are met, to prevent conflicts.

 

Okay, but how do I do that? You are explaining what I have to do, but not how to do it. I don't do a lot of coding, to be honest.

Link to comment
Share on other sites

  • 0

You won't learn anything if I tell you exactly what code needs to be written. I'm also not sure what part of my message you are replying to, seeing as you quoted the entire thing.

 

If trigger1 = var(50) = 1, the state controller activates if the value of var(50) is 1.

If trigger1 = var(50) != 1, the state controller activates if the value of var(50) is not 1.

 

Apply the same logic to your triggers.

Link to comment
Share on other sites

  • 0
3 hours ago, GarchompMatt said:

You won't learn anything if I tell you exactly what code needs to be written. I'm also not sure what part of my message you are replying to, seeing as you quoted the entire thing.

 

If trigger1 = var(50) = 1, the state controller activates if the value of var(50) is 1.

If trigger1 = var(50) != 1, the state controller activates if the value of var(50) is not 1.

 

Apply the same logic to your triggers.

 

Well, my main problem is I don't know all of the terms and actions there are for MUGEN characters. Like, instead of Const, what would I use instead to allow conflicting states?

Link to comment
Share on other sites

  • 0

Const is merely pulling a value from the character's constants file (in this instance, forwards walking velocity); replacing it with your own value will not prevent conflicts.

 

I've already told you that you need to tell the other VelSet controllers to not activate when your stopping conditions are met, meaning you'll need to use the same conditions as your PlaySnd controller, but with a != operator.

 

Your stopping VelSet code should look like this, providing you haven't done this already:

[State 20, ‘«‰¹]
Type = VelSet
Trigger1 = AnimElemTime (2) = 2
Trigger2 = AnimElemTime (9) = 2
Trigger3 = AnimElemTime (16) = 2
Trigger4 = AnimElemTime (23) = 2
Value = 0

Link to comment
Share on other sites

  • 0
44 minutes ago, GarchompMatt said:

Const is merely pulling a value from the character's constants file (in this instance, forwards walking velocity); replacing it with your own value will not prevent conflicts.

 

I've already told you that you need to tell the other VelSet controllers to not activate when your stopping conditions are met, meaning you'll need to use the same conditions as your PlaySnd controller, but with a != operator.

 

Your stopping VelSet code should look like this, providing you haven't done this already:

[State 20, ‘«‰¹]
Type = VelSet
Trigger1 = AnimElemTime (2) = 2
Trigger2 = AnimElemTime (9) = 2
Trigger3 = AnimElemTime (16) = 2
Trigger4 = AnimElemTime (23) = 2
Value = 0

 

Oh, now I think I get it. I'll try that next chance I get.

 

I notice another good help with figuring out coding is to look at other MUGEN characters. For the steps, I looked through his state files to find the landing state which uses envirshake mechanism, and I took not from it. Maybe I should try to look for a MUGEN character with floaty jumps to try and figure out how to slow the arial antics.

Link to comment
Share on other sites

  • 0
Spoiler

[Statedef 20]
Type    = S
Physics = S
SprPriority = 0

 

[State 20, AI]
Type = ChangeState
Trigger1 = Var(59) > 0
Value = 0
Ctrl = 1

 

[State 20, 1]
Type = VelSet
TriggerAll = PalNo != 12
Trigger1 = Command = "holdfwd"
X = Const(Velocity.Walk.Fwd.X)

 

[State 20, 2]
Type = VelSet
TriggerAll = PalNo != 12
Trigger1 = Command = "holdback"
X = Const(Velocity.Walk.Back.X)

 

[State 20, P12ƒJƒ‰[ŒÀ’è‚̈—]
Type = VelSet
TriggerAll = PalNo = 12
Trigger1 = Command = "holdfwd"
X = Const(Velocity.Walk.Fwd.X) * 1.5

 

[State 20, P12ƒJƒ‰[ŒÀ’è‚̈—]
Type = VelSet
TriggerAll = PalNo = 12
Trigger1 = Command = "holdback"
X = Const(Velocity.Walk.Back.X) * 1.5

 

[State 20, 3]
Type = ChangeAnim
TriggerAll = Vel X > 0
Trigger1 = Anim != 20 && Anim != 5
Trigger2 = Anim = 5 && AnimTime = 0
Value = 20

 

[State 20, 4]
Type = ChangeAnim
TriggerAll = Vel X < 0
Trigger1 = Anim != 21 && Anim != 5
Trigger2 = Anim = 5 && AnimTime = 0
Value = 21

 

[State 20, ‘«‰¹]
Type = PlaySnd
Trigger1 = AnimElemTime(2) = 1
Trigger2 = AnimElemTime(9) = 1
Trigger3 = AnimElemTime(16) = 1
Trigger4 = AnimElemTime(23) = 1
Value = 2, 4

 

[State 20, ‘«‰¹]
Type = VelSet
Trigger1 = AnimElemTime(2) != 1
Trigger2 = AnimElemTime(9) != 1
Trigger3 = AnimElemTime(16) != 1
Trigger4 = AnimElemTime(23) != 1
X = 0

 

[State 20, ‰æ–Ê‚ð—h‚ç‚·]
Type = EnvShake
Trigger1 = AnimElemTime(2) = 1
Trigger2 = AnimElemTime(9) = 1
Trigger3 = AnimElemTime(16) = 1
Trigger4 = AnimElemTime(23) = 1
Time = 10
freq = 60
Ampl = -15
Persistent = 1
ignorehitpause = 1

Here it is right now.

Link to comment
Share on other sites

  • 0

Ehwhat?

 

Trigger1 = AnimElemTime(2) != 1

Trigger2 = AnimElemTime(9) != 1

Trigger3 = AnimElemTime(16) != 1

Trigger4 = AnimElemTime(23) != 1

 

These should be added to the other VelSets, not the stopping one; you want the character to stop moving at these points, right?

 

Moving Velsets should look like this (with the command and x value being changed according to whether it's forwards or backwards movement; note that the command trigger is triggerall, not trigger1):

[State 20, 1]

Type = VelSet

TriggerAll = PalNo != 12

TriggerAll = Command = "holdfwd"

Trigger1 = AnimElemTime(2) != 1

Trigger2 = AnimElemTime(9) != 1

Trigger3 = AnimElemTime(16) != 1

Trigger4 = AnimElemTime(23) != 1

X = Const(Velocity.Walk.Fwd.X)

 

Stopping VelSet should look like this:

[State 20, ‘«‰¹]

Type = VelSet

Trigger1 = AnimElemTime(2) = 1

Trigger2 = AnimElemTime(9) = 1

Trigger3 = AnimElemTime(16) = 1

Trigger4 = AnimElemTime(23) = 1

X = 0

 

It's also worth noting that your character is only going to stop moving for 1 tick, which isn't very noticeable.

Link to comment
Share on other sites

  • 0
10 hours ago, GarchompMatt said:

It's also worth noting that your character is only going to stop moving for 1 tick, which isn't very noticeable.

 

 

Would I have to increase the AnimElemTime = # number to increase the ticks?

Link to comment
Share on other sites

  • 0

I know it doesn't have much to do with what I asked, but I also noticed that Ryugen has three special moves, but they all have pretty much the same range. So I was dinking around with his coding, and I ended up with a character that moves a lot slower, and one that is bigger, BUT to make up for this he has more life and more move variations. His normal, slow, ridiculously short ranged projectile is gone and replaced with two more useful projectiles: One that is longer ranged and very slow to act as an obstacle, and a faster, more general projectile, and I also added dark pillar attacks that work on different ranges like mid-screen and full screen dark pillars. I might also have to either buff up his grappling attack or nerf the other attacks to make it more fair.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...