YesNoOk
avatar

How to add custom hitsparks to hitdef? (Read 20368 times)

Started by NEX, August 04, 2022, 05:13:20 am
Share this topic:

NEX

How to add custom hitsparks to hitdef?
#1  August 04, 2022, 05:13:20 am
  • *
  • "You know, I'm something of a scientist myself."
Hello.

I have this custom hitspark statedef. StateDef 8020 to be specific.

And this hitspark has a few AngleSets, AngleDraws, ModifyExplod and a bunch of animations and it works as intended.

So far, I've been using a helper to make the hitspark appear and it does work as intended.
However, I've seen that you're able to put it in the sparkno within the HitDef and I don't know how to do that.

Help?
Last Edit: August 04, 2022, 01:06:05 pm by NEX
Re: How to add custom hitsparks to hitdef?
#2  August 04, 2022, 11:15:53 am
  • **
Don't know where you saw it but the sparkno in hitdef's either read from the common fx file or straight from you .air files. That's why some people use explods & helpers (like yourself) for hitsparks that can't be achieved with preset animations.  That said, using sparkno in Hitdefs is more reliable outside a closed game environment so there are advantages/disadvantages for using either.

You can however, have more than 1 hitspark animation from the .air file attached to a single hitdef sctrl and have them displayed randomly.  This is useful if you're using for e.g. SFIII/CVS2 hitsparks and want to randomise the sparks for each attack without having to manipulate the angle & size of these sparks with explods/helpers.
Last Edit: August 04, 2022, 11:30:04 am by SteelHammers
Re: How to add custom hitsparks to hitdef?
#3  August 04, 2022, 11:27:28 am
  • ***
  • 하나뿐인 한국인 대표
  • Ambassador of MugenRevival
    • South Korea
    • sites.google.com/view/kolossoni-mugen
I'm quite astonished that you used the helper function prior to learning about the hardcoded hitdef sparkno first. 99 times out of a hundred, people start with the latter.

That being said, sparkno needs a specific number that directly correlates to the assigned animation in your air file. So, if you write 4500 in the sparkno value, the game will search for a 4500 animation in your air file to play (beware that this INCLUDES the fightfx air file). If you add an "s" in front of your value (i.e. s4500), then the character will search THAT specific character only, NOT the entire fightfx file.

Next, you'd also need to add a guardsparkno (speaks for itself), then a sparkxy which would tell how close/high the sfx will show once it's activated.

You need to try practicing with it. But all in all, as long as the moves aren't too complex, I'd stick with the hitdef/sparkno system than the helper one. This one is WAY more simple.

PS. the only down side to this is that you can't use any other controls such as angledraw, since sparkno ONLY takes into account the animation that is solely present in the air file. If you wish to change the size, angle or whatever without manually redrawing them, you might want to stick with the helpers.

NEX

Re: How to add custom hitsparks to hitdef?
#4  August 04, 2022, 12:10:34 pm
  • *
  • "You know, I'm something of a scientist myself."
> To Kolossoni

Oh. I already know about using the "s" in front of the animation number for the SparkNo.
I guess I should have included that clarification in my post.

My hitsparks require 3 sets of animations.
(Although, they're not technically "animations", but rather, single frame sprites that animate using AngleDraws, ModifyExplod and trans state controllers)
Hence why I use a helper state.


﹋﹋﹋﹋﹋﹋﹋﹋﹋﹋﹋﹋

> To SteelHammers

Apparently they did their hitsparks like this in their HitDef

Code:
sparkNo=-1 + 0 * (var(33) := 8020)

8020 being the hitspark StateDef.

Judging from this, it uses a variable but I'm not sure where I should place this variable. Do I set up a VarSet in my own HitSpark StateDef or put in -2 StateDef or... I'm just pondering about it right now and wondering what direction I should go.
Last Edit: August 04, 2022, 12:22:10 pm by NEX
Re: How to add custom hitsparks to hitdef?
#5  August 04, 2022, 12:41:44 pm
  • ***
  • 하나뿐인 한국인 대표
  • Ambassador of MugenRevival
    • South Korea
    • sites.google.com/view/kolossoni-mugen
Ahhhh now I get more of what you're getting at.

But that still kind of leaves out one thing. You can't use sparkno to achieve what you really want, which is (to my understanding) using a custom hitspark with custom sctrls.
Sparkno only reflects animations, meaning, regardless of how you use that animation in another state, it's only going to use what's purely found in the AIR file. Sparkno's are not changestates. Whatever value/number you have on there is still going to look for an animation not a state.

Simply put, "sparkNo=-1 + 0 * (var(33) := 8020)" is going to be "sparkNo = x" eventually, (since I have no idea what var(33) has in its values) so the system is going to look for an animation in the AIR file with the "x" number assigned to it. If x equals 50, then it'll show animation 50's sprites and so on.

NEX

Re: How to add custom hitsparks to hitdef?
#6  August 04, 2022, 01:01:56 pm
  • *
  • "You know, I'm something of a scientist myself."
Ah I see. I understand now. So it only uses what's in the animation file.

Alrighty. If that's the case, then I'll simply continue using my helpers which does the job. Thank you all for the assistance.  o7
Re: How to add custom hitsparks to hitdef?
#7  August 04, 2022, 01:13:43 pm
  • **
Ah I see. I understand now. So it only uses what's in the animation file.

Alrighty. If that's the case, then I'll simply continue using my helpers which does the job. Thank you all for the assistance.  o7

Glad to hear.  That code you gave doesn't even make sense anyway, since it will always return -1 no matter what value the variable is.  Meaning, they're not even using the sparkno parameter in the hitdef.  Don't even know what the Author was thinking, maybe trying to confuse people.

-----------Edit--------------------------------------------
I take back what I said about the Author.  Jumped the gun too early. It's actually a clever way to display the hitsparks through helpers without using the sparkno parameter.
Last Edit: August 04, 2022, 01:47:56 pm by SteelHammers

NEX

Re: How to add custom hitsparks to hitdef?
#8  August 04, 2022, 01:23:18 pm
  • *
  • "You know, I'm something of a scientist myself."
Quote
Meaning, they're not even using the sparkno parameter in the hitdef

You know, after hearing that, that actually makes a lot of sense.
Apologies for wasting y'all time with this.
Re: How to add custom hitsparks to hitdef?
#9  August 04, 2022, 07:48:50 pm
  • ******
    • Portugal
    • network.mugenguild.com/pots/
Pretty sure that's my spark code. All the Hitdef spark parameters are essentially blanks used to set the variables that replace them. It's just a way to keep the code readable.
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.

NEX

Re: How to add custom hitsparks to hitdef?
#10  August 05, 2022, 08:44:21 am
  • *
  • "You know, I'm something of a scientist myself."
I see. The code I got was from a character that was created by a different author but I guess it was using your coding as a base template. Finding out it was blanks did clarify things for me.