This is the last of my barrage of editing questions, I swear. :P I had a feeling these individual threads would prove useful for future search results, but if you moderators feel that it's cluttering the forum too much, feel free to merge them all into a single thread (and call it "Nash's editing questions" or something).
Anyway, my question is, is it possible to retrieve any kind of information from the actor that got hit by a hitscan produced from the player?
I have a feeling the recent pointer addition can be utilized to achieve this but to be honest I have no clue how to use the new pointer stuff... :S
Retrieving information from a hitscanned actor?
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Re: Retrieving information from a hitscanned actor?
Warning: None of the following can actually be done as of yet, and the future possibility of any of this depends on what the devs choose to include of suggested code/features.
I don't think the victim of an actual hitscan with possible autoaim and spread/inaccuracy can be explicitly or 100% safely acquired. The pointer of any one actor directly in the player's aim (which should imply that a perfectly straight hitscan attack would hit it) can be retrieved by means that have not been included in the latest svn. (AAPTR_PLAYER_GETTARGET)
Getting the victim of a fully customisable hitscan has this issue: Hitscan code pointers can cause hits on 0 or more actors, meaning it is not a guaranteed single value.
It would be possible to customise A_FireBullets with new flags to store the first victim hit in a code pointer, or to add a function called A_TestHitScan. That doesn't mean they would be added if I wrote them, however.
I don't think the victim of an actual hitscan with possible autoaim and spread/inaccuracy can be explicitly or 100% safely acquired. The pointer of any one actor directly in the player's aim (which should imply that a perfectly straight hitscan attack would hit it) can be retrieved by means that have not been included in the latest svn. (AAPTR_PLAYER_GETTARGET)
Getting the victim of a fully customisable hitscan has this issue: Hitscan code pointers can cause hits on 0 or more actors, meaning it is not a guaranteed single value.
It would be possible to customise A_FireBullets with new flags to store the first victim hit in a code pointer, or to add a function called A_TestHitScan. That doesn't mean they would be added if I wrote them, however.
Re: Retrieving information from a hitscanned actor?
Thanks for the explanation. Knowing this isn't currently possible, and won't be for possibly a long time, I came up with another solution to my problem.