YesNoOk
avatar

Making a boomerang-like projectile/helper (Read 2293 times)

Started by Basara Lapis, October 30, 2007, 04:07:28 am
Share this topic:
Making a boomerang-like projectile/helper
#1  October 30, 2007, 04:07:28 am
  • ******
  • Take better care of the plants around u or become
  • the fertilizer that feeds them.The choice is yours
    • Chile
    • network.mugenguild.com/basara/
Well, I'm experimenting with a character (secret for now) who has this kind of move, but I don't know how to make it, and if I need a Projectile or a Helper for this move. I've seen some characters with that kind of move, but I can't understand the way how they did it...

So, this is my question: how can I make a "boomerang" for MUGEN?? Thanks :)

Rest in peace, Toriyama-san...
Normal WIPS - ClayFighter - Ideas - Anti-Gouki Project - Lifebars - Facebook - X
Re: Making a boomerang-like projectile/helper
#2  October 30, 2007, 05:16:37 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
100% helper


Give it physics = N and start it off at a high velocity, when parentdist X < -something, have it velset in the other direction, or veladd

getting the Y positioning is a bit difficult and using a posadd on parentdist Y is probably the best method.

Have a look in my rayman, every fist attack does it, or blackhearts aerial demons (the red ones) they do it too.

You can do it with a projectile but it's not hugely reliable and can look odd.


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.
Re: Making a boomerang-like projectile/helper
#3  October 30, 2007, 05:58:05 am
  • ******
  • [E]
    • Mexico
it depends heavily on the exact effect, but the simplified physics of a boomerang are a positive initial vel, and a negative constant acceleration, so they return to their place. if tehy are not heat seeking, a simple projectile that dissapears after a bit of time should be enough. if you need them to get back to the parent's position after being thrown, even if the parent moves, you need a helper.
Re: Making a boomerang-like projectile/helper
#4  October 31, 2007, 04:46:45 am
  • *****
    • Peru
Do you want an ellipse-shaped path for your boomerang? It's Sin() & Cos() funtime!

Pos x = K*Cos(-t+pi)+K
Pos y = L*Sin(-t+pi)

Vel x = K*Sin(-t+pi)
Vel y = -L*Cos(-t+pi)

I'm a bit rusted in the Derivative Calculus area, but I think the equation is OK. In mugen code:


;I'll explain the "why" of the numbers:
;The 100 in the x set means how wide will the boomerang travel x-axis wise.
;20 in the y set means how wide will the boomeang travel y-axis wise.
;Why the two values are divided by 50? You can skip this part by putting 2 and 0.4 directly,
;is just a illustration for the people who likes mathematical explanations. They will understand.
;-t*pi/50 : The period of this function is 100, since 100*pi/50 = 2pi.
;think of this as how much time will be needed for the boomerang to return.
;
;You can replace the numbers with other ones to suit your tastes.
[State WhatEver, WhatEver++]
type=VelSet
trigger1=1
x=(100/50)*sin(-time*pi/50+pi)
y=-(20/50)*cos(-time*pi/50+pi)


Test it and tell me.

Edit: I already tested the formula and it works... just needs a bit of tweaking in the values.
Last Edit: October 31, 2007, 05:06:18 am by Renzo [Fullmetal boobs]
Re: Making a boomerang-like projectile/helper
#5  October 31, 2007, 05:04:27 am
  • ******
  • Just a butcher on a mission
    • www.justnopoint.com/lbends
Use a Bezier curve!
Re: Making a boomerang-like projectile/helper
#6  October 31, 2007, 05:06:51 am
  • *****
    • Peru
Or better, use polar coordinates. You can get your boomerang to draw a heart onscreen  :sweetheart:
Re: Making a boomerang-like projectile/helper
#7  October 31, 2007, 05:42:08 am
  • ******
  • Take better care of the plants around u or become
  • the fertilizer that feeds them.The choice is yours
    • Chile
    • network.mugenguild.com/basara/
Whoa!! A lot of answers... thank you guys, I'll prove it all of these to make the boomerang ;) I'll post you soon if it worked or not

Rest in peace, Toriyama-san...
Normal WIPS - ClayFighter - Ideas - Anti-Gouki Project - Lifebars - Facebook - X
Re: Making a boomerang-like projectile/helper
#8  October 31, 2007, 06:29:17 am
  • ****
  • Coming Soon?
hmm a heart thing...that would be cool for certain characters

good luck with the rang though eric
Latest Yoshi alpha ready for feedback Aug 15th check here for details...
Re: Making a boomerang-like projectile/helper
#9  November 07, 2007, 06:39:06 am
  • ******
  • Take better care of the plants around u or become
  • the fertilizer that feeds them.The choice is yours
    • Chile
    • network.mugenguild.com/basara/
OK, reviving for more questions :-X

I did it at last the boomerang move with a mixture of your answers (like revising Cyb's Rayman and following the tips of Renzo and [E]), but I have some problems I can't solve yet:
-the !NumHelper in CMD doesn't work with the boomerang: I can shoot infinite boomerangs and makes a lot of damage :S
-the DestroySelf doesn't work unless I use time = X, I want to make it dissapear when it returns to the player but parentdist doesn't work
-the boomerang hits twice, since I need to hit once

Those're my questions now, at least I can make a boomerang, I though that I can't do it, but I can :) thanks guys and I hope you can help me again... and I don't know if I have to post the code to make the things easier...

Rest in peace, Toriyama-san...
Normal WIPS - ClayFighter - Ideas - Anti-Gouki Project - Lifebars - Facebook - X
Last Edit: November 07, 2007, 07:44:14 am by Basara Eric
Re: Making a boomerang-like projectile/helper
#10  November 07, 2007, 07:00:56 am
  • ****
  • Coming Soon?
I think you might, code posting is always handy when you are asking why stuff doesn't work.
Latest Yoshi alpha ready for feedback Aug 15th check here for details...
Re: Making a boomerang-like projectile/helper
#11  November 07, 2007, 07:40:36 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Why are you using removeexplod? Destroyself should be all you need.

!numhelper(ID) or numhelper(ID) = 0 are how it should be used. Give your helper an ID as well.

Hit's twice? hitdefpersist = 1 in the return state (if you have a return state) and movecontact = 0 for the trigger. If no return state, movecontact = 0 will work there too.


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.
Re: Making a boomerang-like projectile/helper
#12  November 07, 2007, 07:45:09 am
  • ******
  • Take better care of the plants around u or become
  • the fertilizer that feeds them.The choice is yours
    • Chile
    • network.mugenguild.com/basara/

Rest in peace, Toriyama-san...
Normal WIPS - ClayFighter - Ideas - Anti-Gouki Project - Lifebars - Facebook - X
Re: Making a boomerang-like projectile/helper
#13  November 07, 2007, 07:49:20 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Ah, you're using too specific a trigger aren't you? Like trigger1 = parentdist X= 0, try parentdist X<= -2


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.