Set victim as tracer?

Moderator: GZDoom Developers

User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Set victim as tracer?

Post by Ed the Bat »

Based on some musings from here...

Is it possible to craft a flag or property so that a projectile can mark the actor it struck to be its tracer?
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Set victim as tracer?

Post by NeuralStunner »

Sounds reasonable (and quite useful) to me!
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

Re: Set victim as tracer?

Post by Blue Shadow »

This may sound moot at this point, but why not use the master field, instead? Projectiles don't have a use of that field currently.

Anyway, I'm in support of this. The ability to make a projectile run a script for the thing it hits* is something I needed recently for my mod. And with this, I may be able to achieve that.
Spoiler: *
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Re: Set victim as tracer?

Post by Ghastly »

Blue Shadow wrote:Please, don't suggest A_RadiusGive.
To preempt people that might, A_RadiusGive has the same problems as all the other hacky workarounds for the problem this request would solve. A_SeekerMissile's SMF_LOOK flag, A_Look(Ex) and the various methods of distance-checking all take into account only the center of the actor. Problem is when you're trying to detect what actor was hit by a projectile, it's entirely possible to either not detect large-enough actors (too far from the center), and/or pick out a small-radius target that wasn't even hit.

I think a flag (so it doesn't risk breaking any possibly-existing behavior) to set the actor hit by a projectile as the projectile's master (because projectiles already have extensive use of target and tracer) is the best option.
User avatar
Ryan Cordell
Posts: 4349
Joined: Sun Feb 06, 2005 6:39 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Capital of Explodistan

Re: Set victim as tracer?

Post by Ryan Cordell »

I'm not sure I'll actually post this as a patch, because I'm sure there's a better way of going about this - where you could basically set the hit actor as the Master, Tracer or Target of the projectile/puff - without using up more flags.

Devs are free to chime in on this idea.
Spoiler: Patch preview
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Set victim as tracer?

Post by Xaser »

Blue Shadow wrote:This may sound moot at this point, but why not use the master field, instead? Projectiles don't have a use of that field currently.
Semantically it doesn't really make sense why "master" should point at it, but I dunno if that's a big of a deal since the flag's name would explicitly state this behavior so it's not like it would be unintuitive.

Seems like it should be fine for the OP's purposes since A_GiveInventory and other relevant functions like A_Warp seem to have an actor pointer parameter now.
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: Set victim as tracer?

Post by Ed the Bat »

Any pointer will work, frankly. And since projectiles have traditionally set the Target field to be their owner, semantics were out the window to begin with.
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Re: Set victim as tracer?

Post by Ghastly »

Ed the Bat wrote:Any pointer will work, frankly.
Indeed. Hell, if we're using a function that needs a target anyway and we have it saved as a tracer, we can just A_RearrangePointers(AAPTR_TRACER, AAPTR_DEFAULT, AAPTR_TARGET), do what we need to do and call A_RearrangePointers again to set it back. :P
User avatar
Major Cooke
Posts: 8215
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: Set victim as tracer?

Post by Major Cooke »

Not if they're doing something like A_Explode. AEoD relies specifically on tracer actions, and using target will just cause many things to break there. I strongly must encourage using as the OP intended: tracer.
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Set victim as tracer?

Post by NeuralStunner »

Major Cooke wrote:Not if they're doing something like A_Explode. AEoD relies specifically on tracer actions, and using target will just cause many things to break there. I strongly must encourage using as the OP intended: tracer.
I'm not sure who you're trying to argue with.
User avatar
Major Cooke
Posts: 8215
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: Set victim as tracer?

Post by Major Cooke »

Ed the Bat. Simply put, quite a few projectiles within the mod rely upon hitting something and performing A_SeekerMissile to ensure that the victim and the shooter are consistent (i.e. the stake gun's stakes sticking into the enemy it hits)
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Set victim as tracer?

Post by NeuralStunner »

I don't believe he was actually advocating use of Target for the function (since he mentioned right after that it already has a special use).

Aside: There might be a niche use in remembering the intended victim of a seeker missile to compare it to the actual victim. It should work to shuffle the Tracer into Master during the missile's lifetime, right? (I don't assume, since there are a handful of "must be a monster" rules surrounding the Master pointer.)
User avatar
Nightfall
Posts: 555
Joined: Thu Aug 06, 2009 4:00 am
Location: Finland

Re: Set victim as tracer?

Post by Nightfall »

I really don't think using the master pointer here would be a very good idea since then we lock ourselves the possibility of possibly opening the master/minion relationship in the future. Bastardizing it like this isn't the correct way of doing things IMO. I'd rather add a new "victim" field but if something needs to be bastardized for the job perhaps use the lastenemy field for this?
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Set victim as tracer?

Post by NeuralStunner »

That could work, but it'd need a pointer "flag" and relevant functions. I think Tracer was chosen because that stuff is already there.

Edit:
I put some options in order from best to worst (as I see them):
  1. A new pointer. ("victim" works.) Open it for access and assignent.
  2. Use a pointer that projectiles don't normally use. (E.G. lastenemy.) Also needs to be opened up for use.
  3. Use tracer or master. (Least work involved as far as access, but cuts into future uses for these.)
  4. Bad Decorate/ACS hacks!
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

Re: Set victim as tracer?

Post by Blue Shadow »

Yeah, #1 and #2 seem to be the best to go for...
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”