Bullet Tracer Spawning

Moderator: GZDoom Developers

User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Bullet Tracer Spawning

Post by Major Cooke »

Hellser wrote:I suppose this will be like HL2's tracer method (the game internally uses hitscans, but spawns a 'projectile' tracer to go where the hitscan landed).
Yes, just like HL2's.
Hellser wrote:Will this work if the puff itself wasn't spawned? Say, hitting a bloody target?
You would need +PUFFONACTORS. Possibly +ALWAYSPUFF too. But the good news is, you can use +HITTRACER to detect if you hit something shootable. Then you just need to check flags for things like SHOOTABLE or NOBLOOD and that will determine whether to perform anything or just go to a state with TNT1 A 0 frame and call it a day.

But to answer your question, it does in fact require the puff to spawn. It's the lesser evil of the two options because unfortunately, there was no way I could have the projectile accurately predict the spot with offsets applied. A_FireBullets and A_CustomBulletAttack both lack the ability to shoot with offsets, and that's because they were built with the assumption it would always come from the center, roughly.

...Now that I think about it, I might want to consider adding a check for a Sky State if +SKYEXPLODE is specified. There's no way to currently tell if a puff hits a line horizon. Hmmm...
User avatar
zrrion the insect
Posts: 2411
Joined: Thu Jun 25, 2009 1:58 pm
Location: Time Station 1: Moon of Glendale

Re: Bullet Tracer Spawning

Post by zrrion the insect »

Is there no way to determine the vector (probably the correct word) of the hitscan and fire the projectile based on that? Relying on the puff being spawned seems like it just adds needless complexity to the puff to get it to always spawn.
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Bullet Tracer Spawning

Post by Major Cooke »

The way I have it now provides some additional benefits such as calculating travel distance, especially for making projectiles that self destruct. Say, half way to the bullet puff. I'm already planning usage for it thanks to pointer usage, so no. I'm not going to change it.
User avatar
arookas
Posts: 265
Joined: Mon Jan 24, 2011 6:04 pm
Contact:

Re: Bullet Tracer Spawning

Post by arookas »

For setting the puff into an actor pointer, what would happen in cases where the puff disappears before the projectile reaches it? Is there an easy way to store the puff's position into the projectile so it doesn't rely on it staying around? I'm not good with projectiles and particles in DECORATE :P
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Bullet Tracer Spawning

Post by Major Cooke »

User vars, son. And A_Warp.

You might not understand what it's for or see the advanced possibilities with it, but rest assured... They're there. ;)
User avatar
Hege Cactus
 
 
Posts: 368
Joined: Wed Feb 19, 2014 3:23 am

Re: Bullet Tracer Spawning

Post by Hege Cactus »

From the sounds of it, this would be absolutely incredible.
I want this so bad as it would definitively make laser styled attacks a lot easier to make and other fancy complicated moves

and also certain type of.. other evil things

Makes me wonder if this could also be used to make a pulsing laser attack of sort if the buff would also send back a little projectile as this sends its own.
Ideas ideas
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Bullet Tracer Spawning

Post by Major Cooke »

Hege Cactus wrote:From the sounds of it, this would be absolutely incredible.
I want this so bad as it would definitively make laser styled attacks a lot easier to make and other fancy complicated moves
Yes, indeed it would be. And so do I, believe me. However, Graf seems occupied with other things at the moment and he's the only dev in a while to be looking at these. It appears he's also somewhat busy with other things at the moment so we may have to wait a bit. Or he might be waiting on other submissions to take care of first, I'm not sure.
Hege Cactus wrote:Makes me wonder if this could also be used to make a pulsing laser attack of sort if the buff would also send back a little projectile as this sends its own.
Ideas ideas
Certainly is a possibility.
User avatar
Xaser
 
 
Posts: 10772
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Bullet Tracer Spawning

Post by Xaser »

Quick enhancement request, if you're up for it: assigning the actor's pitch on spawn to face the direction of movement in 3D. I imagine folks are really going to want to use this feature with voxels & models.

[Unless A_Face does this internally and it's already covered. ;]

[EDIT] Yup, looks like it does, scanning the source code. Thanks for the time-travel request fulfillment, then. :P
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Bullet Tracer Spawning

Post by Major Cooke »

It already does. To clarify, if you're not familiar with the schematics, A_Face also sets pitch. It just needs to be set to 0 instead of the default 270, or else it won't adjust pitch.

As you can see, I've done that with both. I needed it to get the correct Z velocity anyway.

EDIT: Ninja'd.
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Bullet Tracer Spawning

Post by Major Cooke »

Can I ask someone to check the code? I don't mind the wait for merging into zdoom, but I do care about flattening any issues the current code may present as soon as possible, otherwise I have a tendency to forget what things do what after a while from no comments.
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

Re: Bullet Tracer Spawning

Post by Edward-san »

Imho you could add a 'self->player' check in FireBulletMissile together with the others, just to give the idea this is intended to work only with players.
User avatar
NeuralStunner
 
 
Posts: 12325
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Bullet Tracer Spawning

Post by NeuralStunner »

Edward-san wrote:[...] just to give the idea this is intended to work only with players.
I don't believe so.
Major Cooke wrote:A_CustomBulletAttack
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

Re: Bullet Tracer Spawning

Post by Edward-san »

I'm talking about this function. A_CustomBulletAttack doesn't even call that function.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Bullet Tracer Spawning

Post by Graf Zahl »

In case you wonder why this still hasn't been added:

What I am missing here is feedback from a developer's point of view. At one point we implemented a two-man rule, but that will require that someone comments on this. It doesn't have to be blzut3, I'd just want to hear some opinion from someone who had a look at how this was done.
User avatar
NeuralStunner
 
 
Posts: 12325
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Bullet Tracer Spawning

Post by NeuralStunner »

Edward-san wrote:I'm talking about this function. A_CustomBulletAttack doesn't even call that function.
Sounds like MC might've missed something, then.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”