» Sun May 27, 2012 9:22 am
Because if you do not know where the player is aiming, then how do you know if the player is aiming at a head/arm/leg/chest?
For example, we have two bumper cars in an arena. We have GPS coordinates for car A, but have no idea where car B is. How can we know, without looking at the cars, if car A has come close enough to car B or vica versa at any time to hit each other?
Finding the locations of the different body parts on the target shortly after the moment they are hit is pretty easy, but finding where the player was aiming is a much different story. It likely wouldn't be a problem if there was some GetHeadingAngle equivalent for vertical angles. GetHeadingAngle is great for determining the player's rotation around the Z axis, but gives us no information on where an object is relative to the player's rotation around the Y axis (which is the axis that you "rotate" around when you look up and down.)
Otherwise, we could just move an activator to a node, then do getheadingangle between the node and the attacker, then get the elevationangle and determine easily if those angles are below some absolute value, then we know the player or attacker was looking pretty close to where the node is and thus should achieve a headshot/armshot or whatever.
I guess you could do GetAngleY() on the player and GetPositionX, GetPositionY, GetPositionZ, and GetHeadingAngle(), then also get the positions of the activator at the node and do a little trig, but all of those are time sensitive as it is important that that specific information be gathered at the moment or as close to the moment that you strike the enemy as possible. With that many functions, you start reducing the accuracy of the calculations simply because you give the player more time to move before the "measurements" are taken.
I will try some different methods and see what I can come up with, but bottom line, I and many others are overlooking some efficient method of doing this (with melee attacks) that a few modders have discovered, and it would be really nice if those modders would contribute this information to the community.