MK style blood

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
Okgo5555
Posts: 78
Joined: Thu Mar 23, 2017 11:18 am

MK style blood

Post by Okgo5555 »

I've been working on a "gore" system that feels satisfying and time/technology for the 90's.

Essentially, I have a 1 pixel sprite that I am using as a particle effect (think of OG quake). I have been throwing in something like:

Code: Select all


TNT1 AAAA A_SpawnDebris ("bloodspurtactorA")
TNT1 AAAA A_SpawnDebris ("bloodspurtactorB")

ACTOR BloodspurtactorA
{
Yada Yada...

States
{
spawn:

PIXL A 20
BLSH ABCD 2
stop
}
}
It seems like the "debris" isn't lasting a consistent amount of frames and the blood splashing sprites (BLSH ABCD) happen while still in the air. I've tried elongating the frames that the particle lasts. There still seemed to be some debris that play the blood pool animation while in the air. I also tried adding a "crash" state to the particles and that didn't seem to make a difference. I added "-RANDOMIZE" to the actor and that didn't seem to make much of a different either.

The effect I'm going for is a drop of blood hitting the floor and making a small splash on the floor ala Mortal Kombat.
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: MK style blood

Post by wildweasel »

I think this is the sort of thing for which you want the "Crash" state - the Spawn state can just loop the part that needs to loop, and the rest of the animation goes under Crash, which occurs when the actor hits the floor.
Okgo5555
Posts: 78
Joined: Thu Mar 23, 2017 11:18 am

Re: MK style blood

Post by Okgo5555 »

Ah. Loop. Gotchya.
Okgo5555
Posts: 78
Joined: Thu Mar 23, 2017 11:18 am

Re: MK style blood

Post by Okgo5555 »

So, I just tried that fix, and the blood particles never "crash". So, I'm a little confused.

Code: Select all

ACTOR BloodJunkA
{
  Health 2
  Radius 1
  Height 1
  +Missile
  -RANDOMIZE
  scale 1.5
  States
  {
  Spawn:
	RPXL A  4
	Loop
	Crash:
	BLSH ABCD 2
	Stop
  }
Okgo5555
Posts: 78
Joined: Thu Mar 23, 2017 11:18 am

Re: MK style blood

Post by Okgo5555 »

So, I've got this thing MOSTLY working but I still have a hiccup that I do not understand.

I have a monster who spawns debris when they pain. That looks like this:

Code: Select all

ACTOR MonsterGuy : Zombieman
...

    Pain:
   TNT1 A 0 A_SetRenderStyle (.3,STYLE_Normal)   
    POSS G 3
   TNT1 AAAA 0 A_SpawnDebris ("BloodJunkA")
   TNT1 AAAA 0 A_SpawnDebris ("BloodJunkB")
    POSS G 3 A_Pain
    Goto See
...

And these are the blood particles. The idea is for the blood to hit the ground and then play the MK style "splash" animation (as defined in the Crash state per your advice.) The blood particles hit the ground and "splash", yet, the other issue I am having is that some of the particles are entering the crash state well before they actually hit the floor despite the loop in the Spawn state.

Code: Select all

ACTOR BloodJunkA
{
  Health 2
  Radius 1
  Height 1
  +CORPSE
  -RANDOMIZE
  scale 1.5
  States
  {
  Spawn:
   RPXL A  4
   Loop
   Death:  // This seems weird, but I was just experimenting with trying to keep the blood p[articles from entering their crash state while mid-air.
   goto Spawn   
   Crash:
   TNT1 A  0 A_SetScale (.5)   
   BSLH ABCD 4
   Stop
  }
 }
ACTOR BloodJunkB
{
  Health 2
  Radius 1
  Height 1
  +CORPSE
  -RANDOMIZE
  scale 1.5
  States
  {
  Spawn:
   RPXL B  4
   Loop
   Death:   // This seems weird, but I was just experimenting with trying to keep the blood p[articles from entering their crash state while mid-air.
   goto Spawn
   Crash:
   TNT1 A  0 A_SetScale (.5)
   BSLH ABCD 4
   Stop
  }
 }
Okgo5555
Posts: 78
Joined: Thu Mar 23, 2017 11:18 am

Re: MK style blood

Post by Okgo5555 »

Just solved it:

Code: Select all

ACTOR BloodJunkA
{
Health 1 // this was set at 2 before. I have no idea why, but that was spawning the particles already in their crash state. leaving health blank makes an infinite loop.
  Radius 1
  Height 1
  +CORPSE
  -RANDOMIZE
  scale 1.5
  States
  {
  Spawn:
   RPXL A  4
   Loop
  Crash:
  TNT1 A 0 A_ChangeVelocity (0,0,0,CVF_REPLACE) // this keeps the "splat" from sliding
  TNT1 A 0 A_SetScale (.33)
  BSLH ABC 3 // the MK blood splat animation
  BSLH D 2 // the MK blood splat animation
Stop
}
In my opinion, this provides an iterative blood that is very 90's style without all the faff of stuff like Nashgore, Brutal Doom, or Even Duke 3d does. If you look back to Quake and QII, id seemed to be content with pixelized blood particles up until 2000. For me, the OG Doom bloodsplat didn't age well. This is my personal (almost) vanilla solution.
Post Reply

Return to “Scripting”