A_Teleport
From ZDoom Wiki
(New from 2.5.0)
A_Teleport [(string teleportstate[, string targettype[, string fogtype[, int flags[, float mindist[, float maxdist]]]]])]
Attempts to teleport the actor to a SpecialSpot-derived actor that is at least mindist away and at most maxdist away. If maxdist is 0, there is no maximum distance limit. If successful, an actor of type fogtype is spawned at the old location and calling actor is placed in the state indicated by teleportstate.
Note that despite requiring an actor at the target location, this function can be used in a monster without a specially prepared field. It should be possible, for instance, for that monster to drop SpecialSpot-derived actors around (possibly with a timed life) to teleport to later.
- teleportstate: The state in which the actor should go after teleporting. If the actor does not have this state, or an empty string ("") is given, "Teleport" is assumed. If the actor does not have a Teleport state either, no teleportation or state jump is performed.
- targettype: The type of the target. This needs to be an actor type derived from SpecialSpot. By default, BossSpot is used.
- fogtype: The actor to spawn at the position being left. By default, TeleportFog is used.
- flags: The following flags can be combined by using the | character between the constant names:
- TF_TELEFRAG — Telefrag: Allow telefrag in order to teleport.
- TF_RANDOMDECIDE — Random decision: Randomly choose not to teleport based on current health ratio, like A_Srcr2Decide:
Health fraction Teleportation chance 8/8 or more 0% 7/8 6.25% 6/8 12.5% 4/8 25% 1/8 46.875% Less than 1/8 75%
- mindist: The minimum distance between the current location and an eligible target spot. By default, 0.
- maxdist: The maximum distance between the current location and an eligible target spot. The default value of 0 means there is no upper limit.
Examples
|
Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contibutions are greatly appreciated. |