gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfx
416913 Posts in 29726 Topics by 34423 Members - Latest Member: ojesenia32 September 03, 2010, 01:38:36 AM
*
gfx* Home Help Login Register gfx
gfx
Mugen-Infantry  |  M.U.G.E.N. Support  |  M.U.G.E.N Creator Assistance (Moderator: iTorres)  |  Help with the moving anims pls!
gfx
gfxgfx
 

Author Topic: Help with the moving anims pls!  (Read 136 times)

0 Members and 1 Guest are viewing this topic.

Offline Kenzouichi23

  • Newbie
  • *
  • Posts: 6
  • Honor: 0
  • Gender: Male
  • I gots no pic T^T
    • View Profile
Help with the moving anims pls!
« on: November 02, 2009, 09:34:51 AM »
I'm thinking of making a character that can fly :yes:, and i have no idea how to code the moving anims :okay:... I've got all the sprites I need, the stable floating in place, the zooming forward anim, and such. I just dont know how to make the character "fly" up or down and then stay stationary in that position much like the harpuia megaman or the master hand character... anyone who can help?   

Offline Rajaa

  • Global Moderator
  • *****
  • Posts: 3476
  • Honor: 475
  • Gender: Male
  • I don't make any sense.
    • View Profile
    • RajaaBoy's Mugen Stuff
Re: Help with the moving anims pls!
« Reply #1 on: November 02, 2009, 02:52:39 PM »
You need to use the negative states. Have your position move by reading commands using the command trigger. Here's an example:


[state]
type = velset
trigger1 = command = "holddown" || command = "holdup"
y = (command = "holddown" - command = "holdup")*(insert speed you want your character to go in between these parenthesis)

That means your character will have a velocity of +1 when you press down (which makes your character go down); and your character will have a velocity of -1 when you press up (which makes your character go up). The star means multiply, and you insert the general speed you want your character to go in the parenthesis there, since anything multiplied by 1 is itself.

Look at the jumping state in the common1, it uses something similar to this for setting the sysvar for jumping backwards or forward.

Use the same concept for forward and backwards.

Have a velset (use the number 1 as a trigger) that is always equal to zero, and place it ABOVE the two velset-sctrls that are used for vertical and horizontal movement.

Of course you'll need to disable jumping and walking and other obvious things. This is done simply by making use changestates, that are constantly telling your character not to do those moves. Your use of triggers will depend.

You could always look at the codes of the characters that you mentioned to see how they have done it. I've just told you a very basic way of doing it; basic works, though. You could use veladd and set a limit to the speed if you want a fly that needs to build speed.
Spoiler for My animation is far more painful to look at than yours!:

Offline Kenzouichi23

  • Newbie
  • *
  • Posts: 6
  • Honor: 0
  • Gender: Male
  • I gots no pic T^T
    • View Profile
Re: Help with the moving anims pls!
« Reply #2 on: November 03, 2009, 08:29:59 AM »
Okay, so I went to the common1 cns...... and it was empty. Sorry for sounding such a newb :'(, but where can I find the states which define the movement of the character e.g. gethitanims, jumping, etec. Looked in the common1 cns and it was blank. ??? Even weirder though, is that whenever I test my character out, poof, its there. The character, that is.

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

Oh, and I checked out the said characters cns before, just gave me a headache. Being kinda new to this, I still have a basic concept on things, and dont know how to really build up a character as heavy as this one.

here's the cns...

The start state

; Start
[Statedef ]
type = S
movetype = I
physics = S
sprpriority = 4

[State, NoTurn]
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State, AngleSet]
type = AngleSet
trigger1 = 1
value = 0

[State 0, 0]
type = ChangeAnim
trigger1 = Anim != 0
value = 0

[State 0, 1]
type = VelSet
trigger1 = Vel X != 0
x = 0

[State 0, 2]
type = VelSet
trigger1 = Vel Y != 0
y = 0

Thats the start state. The Idle state

[Statedef]
type = A
movetype = I
physics = N
sprpriority = 4
ctrl = 1

[State]
type = AngleSet
trigger1 = 1
value = 0

[State]
type = ChangeAnim
trigger1 = Anim != 0
value = 0

[State]
type = null ;Turn
trigger1 = Command = "holdback"

[State]
type = VelSet
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)

[State]
type = VelSet
trigger1 = command = "holdback"
x = const(velocity.walk.back.x)

[State]
type = VelSet
trigger1 = command = "holdup"
y = const(velocity.walk.back.x)

[State]
type = VelSet
trigger1 = command = "holddown"
y = const(velocity.walk.fwd.x)

[State]
type = VelSet
trigger1 = command != "holdfwd"
trigger1 = command != "holdback"
x = 0

[State]
type = VelSet
trigger1 = command != "holdup"
trigger1 = command != "holddown"
y = 0

[State]
type = PosSet
trigger1 = Pos Y > 0
y = 0

[State]
type = PosSet
trigger1 = Pos Y < -200
y = -200

Then use changestates to alter the moving forward, backward, crouching, jumping etc. and set the value to this state so that the character will move like its floating... Although the problem with this is that the character DOES float(using PosSet) and "float" moves forward but looks the same...which is alright for that character, but for mine, it needs to change from a stationary anim to its zooming forward anim. So how do I change it work that way?

Sorry for the insanely long post. -___-
« Last Edit: November 03, 2009, 09:13:22 AM by iTorres »

Offline Cyanide

  • M.U.G.E.N Creator
  • *****
  • Posts: 1219
  • Honor: 162
  • Gender: Male
  • Yarr...mas
    • View Profile
    • Mugen Obscurity
Re: Help with the moving anims pls!
« Reply #3 on: November 04, 2009, 12:54:22 AM »
Actually, when it comes to flight it's nicer to make a seperate state altogether rather than overwrite stand.

Use changeanim to set the animation

For example when traveling forwards

type = changeanim
trigger1 = command = "holdfwd" && command != "holdback"
trigger1 = anim != holdfwdanim
value = holdfwdanim

And you have another one for all the other directions. And one for when you have none of the commands held at all which is stationary.


In M.U.G.E.N there is no magic button

Offline Kenzouichi23

  • Newbie
  • *
  • Posts: 6
  • Honor: 0
  • Gender: Male
  • I gots no pic T^T
    • View Profile
Re: Help with the moving anims pls!
« Reply #4 on: November 07, 2009, 07:24:32 AM »
Thanks guys!  :D Your advice really helped a lot  :mrox: I'll just ask here again if I run into any problems; right now I'm just dealing with speed balancing and other stuff. Good thing I joined this site  :mrox:

Offline Kenzouichi23

  • Newbie
  • *
  • Posts: 6
  • Honor: 0
  • Gender: Male
  • I gots no pic T^T
    • View Profile
Re: Help with the moving anims pls!
« Reply #5 on: November 11, 2009, 09:16:48 AM »
Can you guys help me? I need to know how to assign an anim to the "B" command. I've tried everything I could think of (maybe its just not enough?) but I just don't know how. In my opinion attacks are easier to code -___-
« Last Edit: November 13, 2009, 09:43:48 AM by Kenzouichi23 »

Mugen-Infantry  |  M.U.G.E.N. Support  |  M.U.G.E.N Creator Assistance (Moderator: iTorres)  |  Help with the moving anims pls!
 

gfxgfx
gfx gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!