A_FaceTracer [(float angle [, float pitch])]
A_FaceTracer [(float max_turn [, float max_pitch [, float ang_offset [, float pitch_offset [, int flags [, float z_add]]]]])] (New from )
Changes the calling actor's angle to face its current tracer. The tracer field can be set by spawning with A_SpawnItemEx.
- angle: If 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.
- pitch: If specified to a value no greater than 180, then the calling actor's pitch is adjusted 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 (New from):
- 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).
- z_add: Offsets the z position distance of the tracer by this number. Unlike pitch_offset, this takes into account how far away the actor is at all times.
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