Very useful possible upgrade to A_FindTarget/A_FindTracer
I have a suggestion regarding SOCs. I think it would be quite practical to us SOCers if A_FindTarget and A_FindTracer were a bit more versatile. Perhaps it could be set up like this: Var2 lower bits (nearest or farthest object) could be moved to Var1 upper bits with the addition of adding 2 (or 131072) making the object go to its DeathState if there is no target to be found, Var2 upper bits could be used to determine the distance limit in fracunits (if there is one), and Var2 lower bits, if set to something other than 0, could be used to find an object with specific flags to look for, with multiple flags capable of being stacked on top of one another. So, basically, it would be set up like this:
VAR1 Upper = If 1, use farthest object instead of nearest, if 2, commit suicide if the desired object does not exist, if 3, do both.
VAR1 Lower = Object type
VAR2 Upper = Distance limit in fracunits
VAR2 Lower = If not 0, object must have at least these Object Flags in order to be targeted
A few examples are listed below.
VAR1 = 196610 (3 x 65536 + 2)
VAR2 = 0
(Farthest Red Crawla. If there are no Red Crawlas, the actor kills itself.)
VAR1 = 0
VAR2 = 6553602 (100 x 65536 + 2)
(Nearest object with MF_SOLID within 100 fracunits.)
VAR1 = 65536 (1 x 65536)
VAR2 = 33161728 (250 x 65536 + 16777728)
(Farthest object with both MF_NOGRAVITY and MF_ENEMY within 250 fracunits.)
This would be enormously useful, allowing everything from a custom-ability lightdash (thokitem keeps A_RemoteAction capechasing the player to the nearest ring within a certain distance until it runs out of rings and kills itself) to a turret that only targets players who are not in pain (only A_FireShots at objects of type 0 with MF_SHOOTABLE). I sincerely hope that one of the devs reads this and implements it in 2.1 or some later version, as it would be enormously useful to SOCers everywhere.