A_FaceTracer [(float angle)[, float pitch]]
A_FaceTracer (float max_turn, float max_pitch, float ang_offset, float pitch_offset, int flags) (development version only)
Changes the calling actor's angle to face its current tracer. The tracer field is used by homing projectiles to store its homing target.
If angle is specified, then the calling actor cannot turn by more than said angle. (A value of 0 is interpreted as unlimited angle.) However, the SHADOW flag has no effect in such case.
If pitch is specified to a value no greater than 180, then the calling actor's pitch is adjusted by up to said value to face its current tracer. (A value of 0 is interpreted as unlimited angle; and technically a pitch change will never be greater than 180 degrees.) By default this is 270, which means its disabled. It will also aim at the actor's feet when set to 0.
The following is (development version only):
- ang_offset: Specifies the amount of degrees to offset the actor's angle. This is factored in after max_turn (otherwise known as angle) is performed. Note that it works just like A_SetAngle's parameter -- positive values will turn it left, negative values will turn it right. This does not factor in distance due to limitations.
- pitch_offset: Adjusts pitch by this many degrees after max_pitch (also known as just pitch) has been taken into account.
- flags: These may be combined by using the "|" character (without the quotes (")). Note that all of these flags are taken into account first before anything else.
- FAF_BOTTOM - Aim for the bottom of the victim, otherwise known as the raw Z position. Whenever max pitch is taken into account, it will aim towards the actor's feet + 32 units above. This flag disables adding that 32 units.
- FAF_MIDDLE - Aim for the middle of the victim (z position + height / 2).
- FAF_TOP - Aim for the top of the victim (z position + height).
- FAF_NODISTFACTOR - Don't take into account how far away the victim is when calculating pitch offset by distance. This is exactly like calling A_SetPitch after this function, where the raw value of pitch_offset is unfiltered by distance. Due to limitations, this flag only applies to offset_pitch as offset_angle does not filter distance.
This function can cause homing projectiles to face their targets at all times.
Spawn: BALL A 4 A_FaceTracer BALL B 4 A_SeekerMissile(5, 10) loop