1. Determine who fired the projectile, then once it's within some set distance of the player, destroy it.
Problem with this method is, I have no idea how to determine who fired a projectile. There must be some way to do this, because projectiles that impact neutrals will make them hostile to whomever fired the projectile. I just haven't found anything in standard functions that will tell me this. Is there anything in NVSE for it?
2. Determine velocity vector, figure out if it's going towards or away from the player, then if it's going towards the player and falls within a certain set distance, destroy it.
This avoids the "who fired" problem, because anything going away from the player is most likely fired by the player or an ally, or since it's going away from the player, we don't care about it. The problem with this method is determining that a velocity vector is pointing *vaguely* towards the player, not necessarily directly at a player. Near-misses can impact walls, ceiling, or flooring around the player, still allowing the missile to damage the player, so I need to be able to account for this. I'm thinking that if I can determine that the vector is within a cone of set radius (not angle, mind you, as that will be determined by distance) whose center points towards the player and the projectile is within some distance, that should be fine, but really, what is the best way to do this?