Set victim as tracer?
Moderator: GZDoom Developers
Re: Set victim as tracer?
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)
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
Re: Set victim as tracer?
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?
Re: Set victim as tracer?
That is also really unrelated to this thread.
Re: Set victim as tracer?
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
Re: Set victim as tracer?
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.
- 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?
#1 and #2 I support. However, if we are forced down to #3, +TRACERIMPACT could allow for this to happen. Maintains compatibility too.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):
- A new pointer. ("victim" works.) Open it for access and assignent.
- Use a pointer that projectiles don't normally use. (E.G. lastenemy.) Also needs to be opened up for use.
- Use tracer or master. (Least work involved as far as access, but cuts into future uses for these.)
- Bad Decorate/ACS hacks!
Re: Set victim as tracer?
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:
This ought to be flexible enough and shouldn't break any existing compatibility.
Then again, this might be more work than it's worth?
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_MASTERThen again, this might be more work than it's worth?
Re: Set victim as tracer?
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.
Re: Set victim as tracer?
In that case it might as well be just another actor flag (TRACERONIMPACT or whatever). Just one thing I'm curious about...
Why is that a bad thing?Gez wrote:...rather than a gizmo where you choose which pointer gets the victim.
Re: Set victim as tracer?
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.
Re: Set victim as tracer?
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.
Re: Set victim as tracer?
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.
- 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?
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).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.
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.
Re: Set victim as tracer?
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.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.
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Set victim as tracer?
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!
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!
