Set victim as tracer?

Moderator: GZDoom Developers

cybermind
Posts: 64
Joined: Mon Jan 03, 2011 3:33 pm

Re: Set victim as tracer?

Post by cybermind »

I have found a way to achieve special effects when a monster is being hit without interrupting its actions, though, it will work same regardless of what hit the monster.
Instead of accessing monster from projectile itself, we will modify the actor's blood. The PUFFGETSOWNER flag works differently for blood actors - it sets blood's target field to bleeding actor. That's exactly what we need!
So define a new blood for monster using BloodType property. Remember that blood actors have special logic for their first states, so just place a few empty states in Spawn block with no duration. After that, you can call ACS script from blood actor. In the script, use SetActivator(0, AAPTR_TARGET) - this will set the monster as the activator of the script. That's all, dowhateveryouwant from this script.

So, to make different reactions for different weapons, ZDoom should support different blood types for different damage types. That's pretty easy to implement, I think.

An example which is included in attachment shows zombieman's health on screen, when something hits it (I've increased zombieman's health to 200, to clearly show the effect, because zombiemans die very quickly)
Attachments
test.pk3
(1.32 KiB) Downloaded 52 times
User avatar
Nightfall
Posts: 555
Joined: Thu Aug 06, 2009 4:00 am
Location: Finland

Re: Set victim as tracer?

Post by Nightfall »

That is a very ugly hack. Blood actors are visual effects and shouldn't have any impact on the gameplay. What about +NOBLOOD or non-shootable actors?
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Re: Set victim as tracer?

Post by Ghastly »

That is also really unrelated to this thread.
cybermind
Posts: 64
Joined: Mon Jan 03, 2011 3:33 pm

Re: Set victim as tracer?

Post by cybermind »

You can use blood actor to give or take items from projectile's target, as it was described in the link of the thread's first post. The only problem is that this method is only applicable for all projectiles, not the specific ones. But I think that this method is more convenient, rather than using homing projectiles with SCREENSEEKER flag
User avatar
edward850
Posts: 5902
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

Re: Set victim as tracer?

Post by edward850 »

And this would be more convenient to, say implementing a version suggested feature so that gratuitous guesswork isn't actually needed at all? Why do people keep ignoring the stickied guidelines thread?
Graf Zahl wrote:If you want to suggest a workaround for a requested feature please think first if your workaround meets the suggester's needs. I have seen it too many times that some people post stuff that completely ignores the original post's motivation or suggests some laborious things that would be more an annoyance than anything else to do repeatedly. Often these things come equipped with the word 'just' as if it was the most normal thing to do repeated cumbersome routines.

Such posts tend to create tension because the OP might feel ignored on purpose by that. Here's a good example of this kind of behavior which I really don't want to see anymore on the Feature Suggestions forum.
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 »

NeuralStunner wrote: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!
#1 and #2 I support. However, if we are forced down to #3, +TRACERIMPACT could allow for this to happen. Maintains compatibility too.
User avatar
Fishytza
Posts: 793
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them
Contact:

Re: Set victim as tracer?

Post by Fishytza »

How about instead of a flag or having it hardcoded to a specific pointer (like lastenemy) we make a new actor property instead?

It would be like Activation where you can specify via flag which pointer you want the store the victim to. (And by "flag" I mean like Activation's THINGSPEC_TriggerActs and not an actor flag. Just to clear up any confusion.)

For example, if you wanted a projectile that stores its victim into both tracer and master (for some odd reason) you would specify:

Code: Select all

SaveVictimTo    AAPTR_TRACER|AAPTR_MASTER
This ought to be flexible enough and shouldn't break any existing compatibility.

Then again, this might be more work than it's worth?
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Set victim as tracer?

Post by Gez »

If you add a new actor property for that, the simplest approach is to make this new property a pointer to the victim, rather than a gizmo where you choose which pointer gets the victim.
User avatar
Fishytza
Posts: 793
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them
Contact:

Re: Set victim as tracer?

Post by Fishytza »

In that case it might as well be just another actor flag (TRACERONIMPACT or whatever). Just one thing I'm curious about...
Gez wrote:...rather than a gizmo where you choose which pointer gets the victim.
Why is that a bad thing?
User avatar
edward850
Posts: 5902
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

Re: Set victim as tracer?

Post by edward850 »

Because one requires More Flags™, even though there is no pre-existing behaviour to change and the alternative is a pointer reference. I myself would rather add a new pointer reference.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Set victim as tracer?

Post by Gez »

The entire point of using an existing pointer like lastenemy is that you avoid bloating the actor class even more than it already is with a new field that'll be used in maybe 0.0013% of ZDoom game sessions. If you're going to add a new field anyway, you can as well make it do the thing you want to do in the first place. That way, it'll be larger, instead of larger and more complex.
User avatar
edward850
Posts: 5902
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

Re: Set victim as tracer?

Post by edward850 »

I'm not sure how well lastenemy will work out, as it's already used by projectiles. The Hexen lightning projectile to be precised. And a lot. Then again, maybe none of it will be affected by setting a tracer on death. Maybe. I'll test it out later if I get the chance.
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 »

edward850 wrote:Then again, maybe none of it will be affected by setting a tracer on death. Maybe. I'll test it out later if I get the chance.
The only case i can find is, for whatever reason, a modder wanting to know what actor a seeker missile was tracking (even if it hit something else).

Also of note: Setting the pointer even for "non-interactive" actors like lamps or statues, since one might want them to react to certain specialty projectiles.
User avatar
Fishytza
Posts: 793
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them
Contact:

Re: Set victim as tracer?

Post by Fishytza »

edward850 wrote:I'm not sure how well lastenemy will work out, as it's already used by projectiles. The Hexen lightning projectile to be precised.
IMO it shouldn't be an issue as long as it's not standard behavior, i.e. only store whatever it hits to lastenemy if the specific actor flag is set.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Set victim as tracer?

Post by Graf Zahl »

This is never, ever, EVER going to work if it's implemented as a hack. Frankly, the whole thing is in despeate need of being cleaned up, unfortunately that will break lots of existing mods.
Really, the only solution I see is to add a few new pointers with completely unambiguous semantics and NO WRITE ACCESS from DECORATE at all!
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”