YesNoOk
avatar

controling helper movement  (Read 797 times)

Started by the mummy, November 20, 2007, 11:10:00 pm
Share this topic:
controling helper movement
#1  November 20, 2007, 11:10:00 pm
  • *
hey , I have a problem, see my char has this move where he throws a grenade, he throws it in the air
and it arcs and comes down. as of right now I'm using three velsets to make this happen, one to go up, one to go just a little forward,
and one to go down . it works ok, but I was wondering if there was a better way to make his grenade arc?
Re: controling helper movement
#2  November 21, 2007, 02:49:16 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
One state.

Physics of N

Apply initial velocity and then use gravity to bring it down again.

Velset and posset to 0 when pos Y>= 0

If you just velset or just posset it tends to offset downwards slightly.


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: controling helper movement
#3  November 21, 2007, 09:38:17 am
  • *
you know, I just realized that aside from the topic name, I in no other way specified the grenade to be a helper.
everything you said made perfect sense, thank you.
but now I have another question, two really.
one: is it possible to code the cmd to accept x,y, or z as input to trigger the state?
and two: is there a way to code the state so that the initial velocity depends on the button you press?

if these are possible it would save me from coding two more states so that the grenade would travel different distances.
Re: controling helper movement
#4  November 21, 2007, 10:23:29 am
  • ******
  • Limited time to use Infinite power !
    • France
    • network.mugenguild.com/cybaster/
1) Yes. Just trigger the state in the CMD using
triggerall = (command=blaX) || (command=blaY) || (command=blaZ)

2) Either use different velsets triggered by the command you pressed, or use only one velset using the commands to change the values.

Stupid example : let's say you want to give vel=1,2 if the button pressed is X, vel=3,5 if it's Y and vel = 17,45 if it's Z.
Then you can either do (can't remember exact code, and I'm too lazy to check):

type=velset
trigger1= command= blaX
value = 1,2

type=velset
trigger1= command= blaY
value = 3,5

type=velset
trigger1= command= blaZ
value = 17,45


Or group them all into one like this :

type=velset
trigger1= 1
value = (command=blaX)+3*(command=blaY)+17*(command=blaZ),2*(command=blaX)+5*(command=blaY)+45*(command=blaZ)
Re: controling helper movement
#5  November 21, 2007, 10:39:09 am
  • *
something in here is not working.

I am not getting an error message but it doesn't want to do it right
Re: controling helper movement
#6  November 21, 2007, 10:44:40 am
  • ******
  • Limited time to use Infinite power !
    • France
    • network.mugenguild.com/cybaster/
What's not working, the commands themselves, the vels ?
Re: controling helper movement
#7  November 21, 2007, 10:54:27 am
  • *
the vels. none of them even trigger, the grenade just falls and destroys it self like the gravity still triggers 
Re: controling helper movement
#8  November 21, 2007, 10:59:45 am
  • ******
  • Limited time to use Infinite power !
    • France
    • network.mugenguild.com/cybaster/
Check the way it must be coded, maybe the right syntax is :

type = velset
trigger=blablabla
x = ahahah
y = ahahah
Re: controling helper movement
#9  November 21, 2007, 08:18:01 pm
  • ******
  • [E]
    • Mexico
if that still fails, post your code.
Re: controling helper movement
#10  November 21, 2007, 08:37:03 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
BlahX won't be true by the time you reach the state. At least, not if you release it.

What you're going to need is variable assignment in the commands (here we go for confusing)

Here's your changestate

triggerall = command = "grenade"
triggerall = statetype = S && ctrl
trigger1 = command = "x" && var(10) := 1
trigger2 = command = "y" && var(10) := 2
trigger3 = command = "z" && var(10) := 3
value = 1000

The := rather than just = assigns the variable when that particular trigger is found to be true. If it was just = it would check if that was the value of the variable.

Then in the state you set up your helper creation state and use

ID = var(10)

then in the helper state you trigger your velsets of ishelper(1-3) dependant on thingy.


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.