YesNoOk
avatar

hit sparks for projectiles (Read 18163 times)

Started by eishiba, July 14, 2019, 03:38:14 am
Share this topic:
hit sparks for projectiles
#1  July 14, 2019, 03:38:14 am
  • avatar
  • **
    • USA
How does one make hitsparks for projectiles? Using the standard projectile sparkxy makes it stay in the same spot but the opponent could be anywhere when he gets hit.
Re: hit sparks for projectiles
#2  July 18, 2019, 12:19:57 am
  • *****
  • Shame on you!
    • USA
You might be able to use the enemy X and Y positions. I'm like 99% sure you should be able to do that. You might have to use
Floor(all your math),Floor(all your math)
as the values. 
Any real reason you're using a projectile instead of a helper?
vVv Ryuko718 Updated 10/31/22 vVv
Re: hit sparks for projectiles
#3  July 21, 2019, 04:03:58 am
  • avatar
  • **
    • USA
I'm a noob thats why I didnt use a helper. I'm reading everything the helper has in the states but I dont understand how one makes the hitspark appear on the opponent. With a regular attack the hit sparks can stay in the same spot usually because the opponent is up close. But when they are at any length of the arena the hitsparks dont have a way to be commanded to appear on the opponent regardless of where they are. How does one make a helper to do this?
Re: hit sparks for projectiles
#4  July 21, 2019, 04:21:44 am
  • ****
    • crepa.neocities.org
Using a helper makes the spark position be relative to the helper and not the player.

Helpers are like a second player you call, so you must code it to act like a projectile.
The basics would be creating a statedef, a velset, a hitdef and a changestate (or destroyself) for when it make contact, and use something like this in the hitdef:
Code:
sparkno = s7000
guard.sparkno = s7001
sparkxy = 0, 0

I just tested and the spark is appearing on the target position.
Re: hit sparks for projectiles
#5  July 21, 2019, 11:10:29 am
  • *****
  • Shame on you!
    • USA
But when they are at any length of the arena the hitsparks dont have a way to be commanded to appear on the opponent regardless of where they are. How does one make a helper to do this?

I just tested and the spark is appearing on the target position.

spark_x is a coordinate relative to the front of P2. 
spark_y is relative to P1.
I think he wants both values based off of P2. I started to do this years ago but was a rookie.
@eishiba: is this what you mean? We can help you learn how to make helpers. It will advance your coding a lot. Eventually you'll need to learn how to make helpers.  It's not even that hard.
vVv Ryuko718 Updated 10/31/22 vVv
Re: hit sparks for projectiles
#6  July 21, 2019, 05:43:31 pm
  • avatar
  • **
    • USA
Yes I THINK thats what I want. Regular attacks are easy to use the standard sparkxy because the opponent is always right in front of you. But for example when I fire my characters laser the opponent could be in the middle or at the other end or up close. Changing the sparkxy lets me put the hitspark in any ONE spot but the opponent could be at any length from me and I want the hitspark to appear on him regardless of where he is on the arena floor. Helpers so far are the hardest to learn.
Re: hit sparks for projectiles
#7  July 21, 2019, 08:00:11 pm
  • *****
  • Shame on you!
    • USA
Just think of a helper as a clone of your character that you can make look like anything.
You can make new attacks right? And you pick the animation for that attack, and the sounds and everything.
Same thing with a helper. Except you have the move it originates from. So you call the helper out, and you send your clone to it's Statedef.
If you need your clone/helper to do multiple things you use a changestate just like normal. But when you're done with it, you do a DestroySelf instead of a changestate back to statedef 0.

You can make the helper spawn it's own explods. And the helper can look up where the enemy is at, and use that info to put the hitsparks in.
In your case, you have a couple options. You can make the helper look like the FX, or you can make the helper be invisible and spawn the FX as an explod. I would think to just make the helper look like the hitspark.
vVv Ryuko718 Updated 10/31/22 vVv
Re: hit sparks for projectiles
#8  July 23, 2019, 06:15:01 pm
  • avatar
  • **
    • USA
There isnt enough information for me. Learning when to make the helper work is hard because there aren't enough reading material.
Re: hit sparks for projectiles
#9  July 23, 2019, 08:54:31 pm
  • *****
  • Shame on you!
    • USA
When to make the helper? You decide that. Are you confused as to What the helper can be/replace?
Or do you mean what Triggers you need to use when making the helper?
A helper can be used for way to many purposes to describe. The most basic thing you would want a helper for would be a more complex explod. Like if you wanted the effect to move, or transform, or anything different than just playing an animation. You'd use a helper to do those things to the explod.
A helper can be a completely whole character. My Yun&Yang, and PiccoloZ2, both can have controllable helpers. You can move them around and have them do basic attacks and special attacks, all with their own explods and helpers.

If you're having trouble with the Triggers, just ask how to get it to work and we can give you ideas.
vVv Ryuko718 Updated 10/31/22 vVv
Re: hit sparks for projectiles
#10  July 24, 2019, 05:43:19 pm
  • avatar
  • **
    • USA
Triggers are what I meant. But I also don't see any form of sparkxy type information when you click the helper in the right side of the screen.
Re: hit sparks for projectiles
#11  July 24, 2019, 08:12:19 pm
  • ****
    • crepa.neocities.org
It doesn't have sparkxy as it is not a hitdef or a projectile. We said a helper is like a second char that your main char will spawn, it can be anything, a simple effect, a spark, a striker, a projectile, anything, but you'll have to code it as if it was another char. If you want it to be a projectile for example, you'll need to code a new statedef, give it a velocity, a hitdef (this is where you put the sparkxy), a changestate or destroyself, etc. Also, your helper can trigger an explod using the target X and Y position values as sparks, as opposed to using the sparkxy in the hitdef.
Re: hit sparks for projectiles
#12  July 25, 2019, 11:14:31 pm
  • *****
  • Shame on you!
    • USA
Triggers are what I meant. But I also don't see any form of sparkxy type information when you click the helper in the right side of the screen.
Dont forget about Mugen Class. The Master Thread can help you find links to anything you'd want to know about.
Projectiles have a lot of info the hitdef needs. So you've pretty much got all that filled in. I always suggest people read the HitDef in mugen class. It's got a ton of info you may not know about.

The Triggers are all laid out in Mugen Class too.

Think of a Helper as a shell.  Yun&Yang it's a background character you call in to fight. The bg character will try to stay on screen by following P1. So I took that 1 idea and made a little raccoon for my Ibuki. My Samus has a Metroid that attacks P2, sucks it's life, and gives it to Samus. My Sagat uses a helper for a normal fireball. BUT it also has a dust effect on the ground. A regular projectile wouldn't be able to do that. My Noob Siabot has a helper fireball that once it hits P2, a spark flies in a wobble pattern in front and behind P2.
A Helper is just a Statedef you call up when ever you want. Say you wanted 50 missiles to attack P2, but each one has a different arch pattern. You'd use a helper, change it's ID, and use that info to adjust velsets. 50 projectiles would take a ton more work.
A Helper can be used to do a background effect for all your hypers/ultras. You call one Statedef, it looks at the Root,StateNo, and slides in background images, and does super pause, and plays the sound effects. You just code it once, and you use it multiple times.

Take 15mins and skim over Mugen Class. It'll help out a lot.
vVv Ryuko718 Updated 10/31/22 vVv
Re: hit sparks for projectiles
#13  July 27, 2019, 10:31:21 pm
  • avatar
  • **
    • USA
So looking around, am I going to want the projhit trigger?
Re: hit sparks for projectiles
#14  July 29, 2019, 11:16:21 am
  • *****
  • Shame on you!
    • USA
Not if you're using a helper. You'll need to switch those types of triggers to watch for your helper(s).
vVv Ryuko718 Updated 10/31/22 vVv
Re: hit sparks for projectiles
#15  July 30, 2019, 06:39:02 am
  • avatar
  • **
    • USA
Can you define "switch those types of triggers to watch for your helper?"
Re: hit sparks for projectiles
#16  August 13, 2019, 12:18:06 am
  • *****
  • Shame on you!
    • USA
Not specifically. But in general you're going to want to use something like
triggerall = numhelper(3202) = 1
trigger1 = helper(3202), movehit

If you're "inside" the helper, you dont need the redirect. Meaning, if your helper uses state 3202, inside state 3202, you dont need helper(3202). You'd just check if movehit != 0
vVv Ryuko718 Updated 10/31/22 vVv