need some code

Started by VGames, May 10, 2013, 01:12:18 PM

Previous topic - Next topic

VGames

Does anybody have any bit of code that would be good for making blood particles fly through the air smoothly? The animation sequence that i found in the mortal kombat project v4.1 is not all that great. thanks.

Synck

Only what you need is to creeate a explod to p2 when you atack him...

VGames

Oh yeah i got that far already. the blood shows up and everything. but i was wondering if there was a better set up for the actual path that the blood flies. i see that its done by positioning the blood sprites to make it look like theyre flying through the air via the action that i made for them in the fightfx script file. so is their code with better positioning out there?

Also would there be a way to make the blood an actual projectile like a fireball would be that could interact with the floor and characters when it hits them? at this point using the method up above it seems that the only way to make the blood look like its splatting on the floor is by timing its animation and not actually having it make a separate sprite for the blood splat when its done flying through the air and has hit the floor.

Synck

if you know the projectile code and sprite the blood ball everything can be ok...

VGames

Are u saying i should look at how the blood ball is coded in mkproject?

xcheatdeath

are you asking if its possible to make the blood like, land on a character when its knocked out of them? it's possible but you have to create sprites of the blood hitting and landing on the character. and to make it a "projectile" are you saying it hurts the other character when knocked out? if so i guess that's possible but would be really annoying to code. and the splatting is more of the animation rather than coding. the coding would just be it coming out and going down. the animation part the more frames you have the smoother it looks.

Synck

#6
no, if you want a most simple code here:

[Statedef 1570]
type    = S
movetype= A
physics = S
juggle  = 5
velset = 0,0
anim = 4555
ctrl = 0
sprpriority = 2

[State 184, 2]
type = Projectile
trigger1 = AnimElem = 4   <=== element of first anim (you character)
projanim = 4556
projremanim = 4557 <=== remove anim
projhits = 9
projremovetime = 20
projhitanim - 4558 <======= hit anim
projid = 4556
velocity = 3,0           <============ a projectile moving   x,y
offset = 48,-35   <=== offset
attr = S, HP
damage   = 25,10
animtype = heavy
getpower = 0,0
guardflag = MAF
hitflag = MAFD
pausetime = 5,3
hitsound = S5,4
sparkno = S8008
sparkxy = 120,0
guard.sparkno = S8030
guardsound = S1,7
ground.type = Low
ground.slidetime = 25
ground.hittime  = 25
ground.velocity = -10,-6
air.animtype = Back
air.velocity = -10,-6
air.juggle = 3
down.velocity = -10
down.hittime = 30
down.bounce = 0
fall = 1

[State 1020, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

Cybaster

Why are you post random code ?

The easiest way is to have an explod with a nice blood animation flying through the air. However, that won't give you much control over it.

To get the best control over it, create a helper and give it various vels/veladd in order to create some sort of gravity.
Change the animation when the helper reaches the ground.
You can even have a different helper being boided to P2 if your blood helper touches P2, using dist triggers, in order to simulate P2 being full of blood. However, this won't look very good most of the time, especially when P2 starts fighting again afterwards.

VGames

What i want is a blood drop to spawn and fly through the air. when it hits the floor i want it to make a blood splat. forget it hitting the characters too. is there a way to do this or can it only be done using the way its done in mk project via actions and animations.

Synck

I'm thinking:
it can be created on other character in falling state to add a blood...

Cybaster

Quote from: vgames on May 10, 2013, 05:04:47 PM
is there a way to do this or can it only be done using the way its done in mk project via actions and animations.
With the way you're asking the question, I can only wonder if you know the basics of Mugen coding ?
Of course you're going to need animations. How could you display your sprites in Mugen without animations ?

So yes, you can do it with explods and use a modify explod (or removeexplod + spawning another explod) when the explod reaches the ground, to display the blood spash on the ground.
Or you can use a helper to have better control on the vels, and use changestates/changeanim as you please.

You may want to look at POTS' Lei-Lei, which has blood animations like you're asking for.

VGames

Thanks a lot man. i havent got the basics down just yet but i do know that sprites are needed. how does this modify explod or removeexplod work. could u give me a small example?

Ill check out lei lei too.