YesNoOk
avatar

Understanding helpers for Velset and Angledraw (Read 3742 times)

Started by Plum, October 31, 2018, 09:38:12 am
Share this topic:
Understanding helpers for Velset and Angledraw
#1  October 31, 2018, 09:38:12 am
  • **
  • Variables > Boyfriends
Please and thank you in advance.

I've been searching for about three days now, and glancing at help guides from 1.0  for angledraw on explods vs just writing "angle =" for 1.1b and so far I've seen others saying write the projectile as a helper so it's easier to code and honestly I just can't seem to grasp it all /together/ in pieces it makes sense but bringing it all together to actually /make/ the helper keeps baffling me.

I'm using  "Takuma's" super as a base study for the character I'm making and I just want to add a helper so I can have projectiles,(ones that are only for show if possible) to be coded as helpers so I can use angledraw and velset for speed since I can't the smooth illusion without velset and explods don't seem to allow use velset only "vel."

I used an explod "anim=3354" and it's just not working out right, plus I'd have to keep making explods inbetween the same state instead of just making a helper and animating, it's just all off.

Leaving the code here in case anyone decides to help. I'm trying to code helpers for "statedef 3351 /Hit/" it's a long 71 frame animation.
Spoiler: WARNING: A lot of code below! (click to see content)
Last Edit: December 14, 2018, 10:51:50 am by Chartreuse
Re: Understanding helpers for Velset and Angledraw
#2  October 31, 2018, 11:56:35 pm
  • *****
  • Shame on you!
    • USA
What about helpers are you having trouble with?
The way I think about them is it's just another character. It's a mini-P1 that can look like anything you want.

I'm not exactly sure what your helper is going to look like exactly. I've never personally used angledraw coupled with velocity. With that said, I have a move in Samus that sounds very similar to the effect you want.
She shoots homing missiles and depending on P2's position it'll change the angle it's flying at. I also change what animation it uses to make it look like it's flying straight instead of sideways.
 
I'd say get the helper working. Spawning, flying, and dying, like it should, then add angledraw.
But it shouldn't be too hard.
Something like

[State 1250, AngleDraw]
type = Angledraw
trigger1= 1 
value = floor(vel x*10)

Is totally possible. That trigger may not work, but you get the idea. One thing you will want to remember when using angledraw, the hitboxes do not rotate. You'll want to make updated animations, similar to how my Samus does it. If it's just an orb or something basic, you can probably get away with just 1 animation. Use CTRL+C to see the boxes in Mugen.
vVv Ryuko718 Updated 10/31/22 vVv
Re: Understanding helpers for Velset and Angledraw
#3  November 01, 2018, 10:05:24 pm
  • **
  • Variables > Boyfriends
https://imgur.com/1SEgfmd

I honestly think I'm just over complicating this, I just wanted to be able to make a statedef or "helper" so it would be easier to add fireballs to this animation,(linked from imgur) on the second, third, and sixth hit of the super-combo. I tired using Rotsprite and other programs to get a 45 or -45 degree angle but it keeps ruining the sprites I have, even in Photoshop.

I just need Velset for speed purposes because I want to effectively stop the velset mid animation or at least decrease the velocity towards the end of the animation. Same for angle draw, I want the fireball to start normal and then descend, but only angledraw can readjust the sprites without ruining them.

This animation is coded in the 3351 "Hit" I posted above. And all I can think to do now is add a bunch of explods, but that still doesn't give me full authority over the fireball, since it's all tied to the Statedef 3351 so angledraw and velset only affect Takuma himself and not the fireballs.
Re: Understanding helpers for Velset and Angledraw
#4  November 02, 2018, 02:46:04 pm
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
AngleDraw
AngleDraw does not affect velocity.  It simply rotates the sprite.  So you if do something like

type = AngleDraw
trigger1 = 1
value = 45

This would display the sprite at a constant 45 degree angle.

If you did something like
value = Floor(45 + (Time/10))

It would start at 45 degrees then gradually rotate at a speed depending on how much you divide Time by.

You could also factor the enemy's position into the value using trigger redirection to make it look more like a homing missle, like

value = Pos X - enemenynear,pos X ;---- There is more math needed I do not know offhand, but this would return the X distance


Velocity
It sounds like you want to set an initial velocity, then apply a VelMul which will slow it down.
Something like

type = Velocity
trigger1 = Time = 0
x = 4
y = 4

type = VelMul
trigger1 = Time > 30
x = 0.95
y = 0.95

Re: Understanding helpers for Velset and Angledraw
#5  November 03, 2018, 06:44:42 am
  • **
  • Variables > Boyfriends
I've had mugen(fighter factory) in my face everyday for literally a month now, I think I just need to stop for awhile. At first I was excited because that is code Velmul and etc. is exactly what I need but I still need to apply it to statedef 3351 as a separate state for the fireball effect/animation I made in PS. And every part of me is screaming it's simple, but I can't wrap my head around it. If I figure something out I'll report back.

The "value = Floor(45 + (Time/10)) " was the best thing I read all day, so thanks for that. XD I'll definitely be sure to use it in the future, I'll just go see if I can wrap my head around "helpers" again, if not I'll just take a break and come back whenever. Thanks guys, I know I posted an enormous amount code and all your info was helpful so I definitely won't quit.
Re: Understanding helpers for Velset and Angledraw
#6  November 04, 2018, 04:47:18 pm
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
If you spawn a fireball as an explod, it can’t do so many things, like:
Return any x/y coordinate, like parentdist x, or screenpos y, pos x, etc
Determine its own distance from an enemy, like p2dist
Changeanim
Changestate
PalFX
Angledraw
Assertspecial
All those other things a player CAN do

So when you want a projectile to do special things, you need to spawn it as a Helper instead of as an Explod

Re: Understanding helpers for Velset and Angledraw
#7  November 04, 2018, 09:31:14 pm
  • **
  • Variables > Boyfriends
Well... yes, that's what I stated numerous times in the above post, that I've read others say that coding a projectile as a helper is best. I just have to admit that I don't have the knowledge to put it altogether, I take anxiety breaks every now and then to keep myself from stressing out over little things. I have basic knowledge of FF3, I've built my own character using kung fu as a base a few months ago, thing is he doesn't use explods or projectiles, or helpers--if I recall correctly? I've been studying Ryu's and Takuma's fireball code but I can't piece it altogether in my head to make a helper, whenever I try it just seems overwhelming, partially due to frustration because I know it's simple.

I know what I need to do and why, I've already made that quite clear. Your /explain/ of value constraints with time was new and very, very helpful,(also velmul) and I'm really grateful to everyone here, but I honestly just need keep reading the basics of creating a helper and not letting myself feel overwhelmed just because I know I'm making something far more difficult than it ever had to be.

I've wasted so many days on this--to the point where I can't abandon it. It sounds unhealthy, but most fun things are these days; it's the last thing I need for this character I'm making so it has to be done, I'm not doing anything else in mugen /until/ it's done correctly.
Re: Understanding helpers for Velset and Angledraw
#8  November 05, 2018, 12:06:57 am
  • *****
  • Shame on you!
    • USA
I was kinda stuck on helpers when I first started out.
So you know it spawns. And it's going to use an animation.
It's got it's own state that the call for it, spawns. You put the animation in the StateDef and then it just sits there. You could use the StateDef to give it a velocity.
Now comes what the helper actually IS.
Is it a fireball? Does it move one direction and then change directions? What's it actually going to do??
Is it an attack?? If so, add the HitDef. Then you have to decide what it does once it hits. Does it keep going? Does it just disappear? Does it change to a different animation for the "death effect"? Those 3 options use Changestates or DestroySelf. Does it hit multiple times? Add multiple hitdefs.

Does it need a sound? Just use triggers like normal. time, animation, position, they all work. 
Helpers can also spawn explods just like a regular character.

You can use multiple states to build up your helper's actions. I'd say most "fireball" helpers use 2 statedefs. A little more complex helper will use 3. But you can have a helper spawn other helpers. This is where
Root,
comes into play. Usually with 1 helper you'd just use
Parent,
But if the child helper has a child of it's own, P1 is now a grandparent; Parent wouldn't work for the ROOT of all those helpers.

Once you build your first helper the light will go on and you'll get it. I'd recommend to just do like 4 basic things at first.

Spawn a helper, Make it's statedef and destroyself. Add those 3 things into you char. Set the DestroySelf to be triggered at time >=40. TEST.
Did you see the helper spawn and die?
Add some velocity and the hitdef. The hitdef is going to act exactly like P1 was doing it. TEST
Did you get it to hit P2 and what happened?
Change the DestroySelf to a ChangeState. Set the Animation for that new state and add a DestroySelf. TEST.
Did it change states and die after playing the animation?
Now if the Velocity you originally set sucks and you dont want it to just fly to the right and you want it to do some cool stuff,
Add VelAdd or VelSet and come up with the triggers that define it. If it needs to move different directions at different times or locations, Awesome. You just use multiple VelAdd/VelSets and use different triggers. Mugen is pretty smart you just gotta let it know why you want it flying around.

My best advice is to think backwards on triggers. It's a computer. When ever something can possibly work it'll work. So LOCK IT DOWN so it can only possibly work for 1 instance, and then widen it's chances of working until ONLY the things you want to happen, happen. If you work on tightening the chances, something almost always randomly messes with it. With that said,
Time = 12
as a trigger isn't nearly as good as
Time >=12
as a trigger. You want to constrain the helper, but Time =, is a choke point. 1 tic, things can mess up. But if you're using multiple VelSets, you'll want extra triggers so the two velocities dont cause conflicts. If you do have to use Time =, make sure you add IgnoreHitPause. This can clear up a lot of errors.


Remember, it's not going to be perfect the first time you build it. I've been doing this a while now and it's pretty rare I can write an entire helper from scratch and have it be perfect before the first test.
What ever your specific problem is at that instant, try to solve it 3 different ways. If you cant get it, ask here. We might see what you're not seeing.

If you've done those 3 steps above, what problem are you trying to code right now?
And if you dont have FF3 launching a test mugen, set that up asap.
vVv Ryuko718 Updated 10/31/22 vVv
Re: Understanding helpers for Velset and Angledraw
#9  December 14, 2018, 10:56:40 am
  • **
  • Variables > Boyfriends
Just an update I finished the character I was working on entirely, thanks to you guys. I knew it was something simple as I believed before--I was just making things hard. After I took a full twenty-four hours away from FF3 & mugen I was able to  realize my mistake the very next day. I hadn't added the actual code/text to /tell/ mugen the helper existed, I kept trying to code it as an explod basically.

So I really appreciate the motivation, I meant to say something nearly three weeks ago. Character turned out exactly how I'd planned from the start, though I don't plan to stop on one thing if I get stuck again like that.^^" Though... it'll probably happen again eventually due to how stubborn I am.