Set victim as tracer?
Moderator: GZDoom Developers
Re: Set victim as tracer?
In the meantime, how does TracerOnHit itself sound? Considering the projectile has already hit something, I don't think we would necessarily care about our original tracer in that case.
			
			
									
						
										
						- XutaWoo
 - Posts: 4005
 - Joined: Sat Dec 30, 2006 4:25 pm
 - Location: beautiful hills of those who are friends
 - Contact:
 
Re: Set victim as tracer?
There are the scenarios where you want to check if the projectile hit its intended target or not.Ghastly_dragon wrote:In the meantime, how does TracerOnHit itself sound? Considering the projectile has already hit something, I don't think we would necessarily care about our original tracer in that case.
Just for reference, if that wants to be put up for consideration.
- 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?
"Write" access? You mean things like A_RearrangePointers and the likes?Graf Zahl wrote:...and NO WRITE ACCESS from DECORATE at all!
I can foresee ripper missiles being one of them. But I could imagine a special projectile seeking after its tracer, and having the ability to immediately change to ripping another monster it touches in its place.XutaWoo wrote:There are the scenarios where you want to check if the projectile hit its intended target or not.
Just for reference, if that wants to be put up for consideration.
Re: Set victim as tracer?
Okay, yeah, I can see that.
The "NO write access from Decorate" made me a little nervous, but as long as it would be useful in all the same functions such as A_GiveToTarget, A_Warp and etc., then I don't see a problem. After this, we would need A_JumpIfNullPointer, though.
			
			
									
						
										
						The "NO write access from Decorate" made me a little nervous, but as long as it would be useful in all the same functions such as A_GiveToTarget, A_Warp and etc., then I don't see a problem. After this, we would need A_JumpIfNullPointer, though.
- phantombeta
 - Posts: 2185
 - Joined: Thu May 02, 2013 1:27 am
 - Operating System Version (Optional): Windows 10
 - Graphics Processor: nVidia with Vulkan support
 - Location: Brazil
 
Re: Set victim as tracer?
Like this?Ghastly_dragon wrote:After this, we would need A_JumpIfNullPointer, though.
Re: Set victim as tracer?
No, like this:
			
			
									
						
										
						Code: Select all
A_JumpIf(AAPTR_VICTIM == AAPTR_NULL, "state")- 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?
It would still need a dedicated action function, since "pointer selectors" are just arbitrary bitfield values (classy!) and nothing like actual pointers. 
 
Working with actual (or "virtual") actor pointers would be one of the best features for ZScript.
			
			
									
						
										
						Working with actual (or "virtual") actor pointers would be one of the best features for ZScript.
- Graf Zahl
 - Lead GZDoom+Raze Developer

 - Posts: 49252
 - Joined: Sat Jul 19, 2003 10:19 am
 - Location: Germany
 
Re: Set victim as tracer?
A real scripting language can do that easily. DECORATE, on the other hand is ill equipped for that.
			
			
									
						
										
						Re: Set victim as tracer?
I just dug through the source, and apparently the only way a projectile can use the lastenemy pointer is with the native and not-very-customizable MWeapLightning functions. Everything else is monster behavior. The only other existing pointer I can think to use is maybe goal, if we don't make a new pointer.
Ryan_Cordell posted a patch preview on the first page for a flag that worked in testing. Some of the work is done already (though for the p_railattack one, I'd've put it in the if(spawnpuff) part at about line 4062). Ripping projectiles are an interesting subject, though, as is the ability to check if the pointer in question is the same actor as the projectile's tracer, as was brought up earlier.
			
			
									
						
										
						Ryan_Cordell posted a patch preview on the first page for a flag that worked in testing. Some of the work is done already (though for the p_railattack one, I'd've put it in the if(spawnpuff) part at about line 4062). Ripping projectiles are an interesting subject, though, as is the ability to check if the pointer in question is the same actor as the projectile's tracer, as was brought up earlier.
- 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?
Request made. But all it is, is just three flags. Better than nothing at least.
			
			
									
						
										
						