How to spawn puff via A_FireBullets, even when actor hit?

Discuss all aspects related to modding Zandronum here.
Post Reply
newbiejackcity
New User
Posts: 12
Joined: Tue Aug 06, 2013 10:26 am

How to spawn puff via A_FireBullets, even when actor hit?

#1

Post by newbiejackcity » Wed Aug 14, 2013 9:15 am

So, the docs from the A_FireBullets function says,
Optionally you can specify a puff type that is spawned when hitting a wall or a non-bleeding actor. The puff also determines the damage type of the attack.
But, on the puff documentation, there's another note,
by default, puffs are only spawned as a result of a hitscan attack hitting a wall, or an actor with one or more of NOBLOOD, INVULNERABLE and DORMANT flags set. In order for puffs to appear in other circumstances, certain flags must be in effect on either the puff actor or the target actor. The ALWAYSPUFF flag applied to the puff actor makes it spawn even for missed attacks. The PUFFONACTORS flag applied to the puff actor will make it spawn (instead of Blood) even if the hit actor does not have any of the aforementioned flags.
However, I tried adding +PUFFONACTORS and +ALWAYSPUFF to a puff associated with A_FireBullets, and it doesn't seem to spawn on actors that bleed. What am I missing?

Zupoman
Forum Regular
Posts: 110
Joined: Tue Jun 26, 2012 6:30 pm

RE: How to spawn puff via A_FireBullets, even when actor hit?

#2

Post by Zupoman » Wed Aug 14, 2013 10:45 am

Zdoom wiki says:
ALWAYSPUFF

Used on puff objects only. Makes the puff appear even when nothing was hit.
PUFFONACTORS

Used on puff objects only. A puff with this flag is spawned even if the actor being hit bleeds. Normally in such a case only blood is spawned but no puff.
Then, as wiki says, +ALWAYSPUFF has got nothing to do with it.

So if you add +PUFFONACTORS, it should spawn puffs. You say it does not, then it is either a Zandronum problem, or you are doing something wrong. Have you given that flag to the puff? Or have you given it to something else? Also try testing it with newest ZDoom, instead of Zandronum, it may be a Zandronum specific problem.
This signature is empty and useless, I would write another useless idiotism here but people will call me a noob for that, so sorry, no more signatures for you. Go somewhere else.

newbiejackcity
New User
Posts: 12
Joined: Tue Aug 06, 2013 10:26 am

RE: How to spawn puff via A_FireBullets, even when actor hit?

#3

Post by newbiejackcity » Wed Aug 14, 2013 8:19 pm

So if you add +PUFFONACTORS, it should spawn puffs. You say it does not, then it is either a Zandronum problem, or you are doing something wrong. Have you given that flag to the puff? Or have you given it to something else? Also try testing it with newest ZDoom, instead of Zandronum, it may be a Zandronum specific problem.
The flag is set on the puff. Here's the code where the A_FireBullets call is made.

Code: Select all

ACTOR Boomstick : Weapon
{
	Weapon.AmmoUse 			1
	Weapon.AmmoGive 		8
	Weapon.AmmoType			"Shell"
	Inventory.PickupMessage		"You got the Boomstick!"
	Obituary			"%o got blasted by %k's Boomstick."
        PoisonDamage                    5000000
	
	Weapon.UpSound			"w2/load"
	AttackSound			"w2/fire"
	
	States
	{
		Ready:
			W2E1 A 1 A_WeaponReady
			goto Ready
		Deselect:
			W2E1 A 1 A_Lower
			W2E1 A 0 A_Lower
			goto Deselect
		Select:
			W2E1 A 1 A_Raise
			W2E1 A 0 A_Raise
			goto Select
		Fire:
			W2E1 A 3 A_GunFlash
			W2E1 A 7 A_FireBullets(6, 6, 7, 0, "BulletPuff_Explosive")
			W2E1 BC 5
			W2E1 D 4 A_PlayWeaponSound("w2/load")
			W2E1 D 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W2E1 CB 4
			W2E1 A 10 A_Refire
			goto Ready
		Flash:
			SHTF A 2 bright A_Light1
			SHTF B 2 Bright A_Light2
			Goto LightDone
	}
}
And here's the bit where BulletPuff_Explosive is defined. It works when walls are hit (i.e., BulletPuff_ExplosiveRemains is spawned), but this doesn't happen when an actor is hit. I've also tried simpler puffs with the +PUFFONACTORS flag set, and no luck was had there either.

Code: Select all

ACTOR BulletPuff_Explosive
{	
	RenderStyle			Translucent
	Alpha				0.66
	Scale				0.66
	VSpeed				1
	Mass				5
	+NOBLOCKMAP
	+NOGRAVITY
	+ALLOWPARTICLES
	+RANDOMIZE
	+PUFFONACTORS	
	States
	{
		Spawn:
			BAL1 CD 4 bright
		Melee:
			BAL1 E 4 bright
			stop
		Crash:
			BAL1 C 4 bright
			BAL1 D 4 bright  A_SpawnItemEx("BulletPuff_ExplosiveRemains")
			BAL1 C 4 bright
			stop
	}
}
(This code is actually from Shotgun Frenzy 1.4, BTW, though slightly modified at this point).

Unfortunately, this mod doesn't work on ZDoom, but I'll set up a simpler test case to test in both Zandronum and ZDoom when I get a chance.
Well, it looks like +PUFFONACTORS doesn't work in Zandronum. Here's my test case, in case anyone else wants to verify.

DECORATE.TXT

Code: Select all

#include "newpuff.txt"
NEWPUFF.TXT

Code: Select all

ACTOR NewPuff : BulletPuff replaces BulletPuff
{
  Game Doom
  SpawnID 131
  +NOBLOCKMAP
  +NOGRAVITY
  +ALLOWPARTICLES
  +RANDOMIZE
  +PUFFONACTORS
  RenderStyle Translucent
  Alpha 0.5
  VSpeed 1
  Mass 5
  States
  {
  Spawn:
    BFS1 AB 4 Bright
    BFE1 AB 8 Bright
    //BFGG A 4 Bright
    //BFGG B 4
    // Intentional fall-through
  Melee:
    BFS1 AB 4 Bright
    Stop
  }
}
Behavior in ZDoom: As expected, BFG animations happen when bullets strike both actors and walls.

Behavior in Zandronum: BFG animations happen when bullets strike walls only, not when actors are struck.

Does anyone know if this flag is intentionally not supported in Zandronum, or is this a bug?
Last edited by newbiejackcity on Wed Aug 14, 2013 8:41 pm, edited 1 time in total.

User avatar
President People
Forum Regular
Posts: 394
Joined: Tue Jun 05, 2012 8:12 am

RE: How to spawn puff via A_FireBullets, even when actor hit?

#4

Post by President People » Wed Aug 14, 2013 8:54 pm

-ALLOWPARTICLES doesn't work either, last I checked (particles spawn regardless), but I haven't gotten around to creating a ticket for that yet.
Last edited by President People on Wed Aug 14, 2013 8:55 pm, edited 1 time in total.
Image
***MARATHON SKINS PACK V1.0.7***

I have been Roland, Beowulf, Achilles, Gilgamesh.
I have been called a hundred names and will be called
a thousand more before the world goes dim and cold.

newbiejackcity
New User
Posts: 12
Joined: Tue Aug 06, 2013 10:26 am

RE: How to spawn puff via A_FireBullets, even when actor hit?

#5

Post by newbiejackcity » Wed Aug 14, 2013 10:08 pm

President People wrote: -ALLOWPARTICLES doesn't work either, last I checked (particles spawn regardless), but I haven't gotten around to creating a ticket for that yet.
Interesting.

I wouldn't care too much about the +PUFFONACTORS if it was just an aesthetic thing, but Shotgun Frenzy uses it for the "explosive" damage part of the explosive shot, and I can't think of another way to do it short of modifying the weapon to both A_FireBullets and shoot a projectile. Right now, the explosive shot only works when it strikes walls and non-bleeding actors, which kinda gimps the gun.

Edit: I filed a ticket for the +PUFFONACTORS issue.
Last edited by newbiejackcity on Thu Aug 15, 2013 12:13 am, edited 1 time in total.

newbiejackcity
New User
Posts: 12
Joined: Tue Aug 06, 2013 10:26 am

RE: How to spawn puff via A_FireBullets, even when actor hit?

#6

Post by newbiejackcity » Mon Aug 19, 2013 1:14 am

If anyone else comes across a similar issue, I resolved this by basically using inheritance to modify every existing actor which bleeds, and added +NOBLOOD. It's a hack, but it seems to work for nowl.

Ijon Tichy
Frequent Poster Miles card holder
Posts: 901
Joined: Mon Jun 04, 2012 5:07 am

RE: How to spawn puff via A_FireBullets, even when actor hit?

#7

Post by Ijon Tichy » Mon Aug 19, 2013 1:39 am

funny, because PUFFONACTORS sure works fine with samsara with the thunderbolt

newbiejackcity
New User
Posts: 12
Joined: Tue Aug 06, 2013 10:26 am

RE: How to spawn puff via A_FireBullets, even when actor hit?

#8

Post by newbiejackcity » Mon Aug 19, 2013 2:19 am

Ijon Tichy wrote: funny, because PUFFONACTORS sure works fine with samsara with the thunderbolt
Weird. I guess maybe it works in some situations and not others? I did a lot of playing around / testing with puff flags on A_FireBullets puffs, and there's definitely something up with it. I uploaded a good test case to the bug report I filed.

User avatar
Ænima
Addicted to Zandronum
Posts: 3583
Joined: Tue Jun 05, 2012 6:12 pm

RE: How to spawn puff via A_FireBullets, even when actor hit?

#9

Post by Ænima » Mon Aug 19, 2013 2:24 am

Try this for now:

Code: Select all

ACTOR NewPuff : BulletPuff replaces BulletPuff
{
  Game Doom
  SpawnID 131
  +NOBLOCKMAP
  +NOGRAVITY
  +ALLOWPARTICLES
  +RANDOMIZE
  +PUFFONACTORS
  RenderStyle Translucent
  Alpha 0.5
  VSpeed 1
  Mass 5
  States
  {
  Spawn:
    BFS1 AB 4 Bright
    BFE1 AB 8 Bright
    //BFGG A 4 Bright
    //BFGG B 4
    // Intentional fall-through
  Melee:
  XDeath: //forces it to enter this state when hitting a bleeding actor
    BFS1 AB 4 Bright
    Stop
  }
}
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

newbiejackcity
New User
Posts: 12
Joined: Tue Aug 06, 2013 10:26 am

RE: How to spawn puff via A_FireBullets, even when actor hit?

#10

Post by newbiejackcity » Mon Aug 19, 2013 8:11 am

Ænima wrote: Try this for now:

Code: Select all

snip
Thanks! This is a cleaner solution than what I came up with.

User avatar
Ænima
Addicted to Zandronum
Posts: 3583
Joined: Tue Jun 05, 2012 6:12 pm

RE: How to spawn puff via A_FireBullets, even when actor hit?

#11

Post by Ænima » Mon Aug 19, 2013 2:12 pm

Does it work?
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

newbiejackcity
New User
Posts: 12
Joined: Tue Aug 06, 2013 10:26 am

RE: How to spawn puff via A_FireBullets, even when actor hit?

#12

Post by newbiejackcity » Tue Aug 20, 2013 2:16 am

Ænima wrote: Does it work?
Seems to work just fine. Works identically to changing the actors to +NOBLOOD.

Post Reply