YesNoOk
avatar

Seeking code to add blood sparks on top of existing hit sparks (Read 601 times)

Started by Minakata Moriya, August 19, 2020, 06:49:55 PM
Share this topic:
Seeking code to add blood sparks on top of existing hit sparks
#1  August 19, 2020, 06:49:55 PM
  • *
    • USA
In Samurai Shodown, the blood sparks essentially function like additional hit sparks, sometimes with vels added. In my dissecting hit states, I've found they are created at the same point as the hit sparks. Has anyone seen/made code to spawn explods at the same spot as the hitsparks in MUGEN? I have the regular hit sparks in place, but I'd like to add blood on movehit and sparks flying on moveguarded. I have a vague idea of how to position them, but I'm not especially handy with expressions and the syntax is something I'm still trying to work out. Any help would be greatly appreciated.
Re: Seeking code to add blood sparks on top of existing hit sparks
#2  August 19, 2020, 07:36:16 PM
  • **
  • Also in the sky, the strength of love has wings...
    • Mexico
God, I'm a little bit rusty on triggers, but it can be like this:

[State h]
type = Explod
trigger1 = movehit
anim = (number of the blood animation on the .air file)
ID = (same as anim)
pos = (try to copy the hitspark.pos of the HitDef where the spark locates)
sprpriority = 2
persistent = 1
ownpal = 0

And the same for the particles. In the trigger, instead of "movehit" set it to "moveguarded"

I hope this can help to solve your question.
Re: Seeking code to add blood sparks on top of existing hit sparks
#3  August 19, 2020, 09:44:34 PM
  • *
    • USA
Hey, thanks for the reply. I have the basic explod setup down, but I'm trying to get the X and Y coordinates to be automatically calculated based on distance or whatever expressions are necessary to position the sparks as necessary. Maybe using p2bodydist or something in the X value? x = p2bodydist + (whatever x offset)?

Hmm, this seems to work:

pos = (const(size.ground.front)+p2bodydist X), -60

I need to generate multiple identical sparks at the same time with each having randomized velocities, but my attempt to trick the engine into activating multiple times doesn't quite work.

[State 200, BloodSpeck]
type = Explod
trigger1 = movehit
trigger2 = movehit
trigger3 = movehit
id = 21
anim = F93
pos = (const(size.ground.front)+p2bodydist X), -60
postype = p1
vel = (random/200)-5,(random/200)-5
accel = 0,.2
bindtime = 0
removetime = -2
ignorehitpause = 1
sprpriority = 3
ownpal = 1
persistent = 0
ontop = 1

If I keep "persistent = 0" in there, it will only activate once no matter what. If "persistent = 1," then it generates explods each tick movehit returns true. Is there any way to just keep it activating three times simultaneously without having to do multiple identical Explod commands?
Last Edit: August 19, 2020, 11:51:52 PM by Minakata Moriya
Re: Seeking code to add blood sparks on top of existing hit sparks
#4  August 20, 2020, 12:42:57 AM
  • ******
Hmmm... adding an explod where you have the hitspark is one way to do it.

trigger1 = movehit
trigger2 = movehit
trigger3 = movehit

they're the same thing, you would just need one trigger, since it's the only one it reads.



The other way is to make the entire hitspark + blood a helper. Now I'm not sure how they're coded, since I haven't done that, but my suggestion is to look at PotS's Geese and/or Jmorphman's Ken and see how those are coded. They're basically multiple effects coded in a helper (or more, depending on the strength of the attack).

I'm sorry I can't be of much help.
Re: Seeking code to add blood sparks on top of existing hit sparks
#5  August 20, 2020, 01:55:36 AM
  • *
    • USA
Yeah, I was hoping I could get the thing to trigger three times with three triggers statements like that. Alas, to no avail. I will check out the characters you mentioned and see if I can learn anything from them, but I'm at least on the right track here. The additional sparks, along with the blood, definitely make a difference. Thanks for your help.