YesNoOk
avatar

Moving Helpers (Read 341 times)

Started by Crase, March 27, 2008, 12:39:50 am
Share this topic:
Moving Helpers
#1  March 27, 2008, 12:39:50 am
  • avatar
  • *
This ties into my last topic.. Fortunately, I corrected my errors and unfortunately I encountered a problem.. My clone, I am trying to get him to move accurately... (I have searched the help forum for helper topics, and they're a plethora of topics, I may have found some that were quite useful, but didnt help me completely)

The problem is, that Im not really good with distance checking and stuff like that so I need a way to make the helper move to the right toward p2 when he is to the left of p2 and not in attacking distance... And vice-versa for the other direction (move left when right of p2)

Here is what I had, but of course it's a starter and not 100% what I want:
[mcode]
[Statedef 999]
type = S
physics = S
sprpriority = 0

[State 999, velset]
type = velset
trigger1 = p2dist x >= 45 ;This needs changing in order to get what I want I believe
x = const(velocity.run.fwd.x)

[State 999, ChangeAnim]
type = ChangeAnim
trigger1 = Const(velocity.run.fwd.x)
trigger1 = Anim != 20
value = 20
elem = 1
[/mcode]

~Thanks
Re: Moving Helpers
#2  March 30, 2008, 04:05:31 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
All you really need to add to make that function is a turn control so when p2 is behind you, you turn around and start going forwards again. No need for backwards or special left/right stuff.

trigger1 = p2bodydist X< -10 should do it.


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

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.