Classes:CustomBridge

From ZDoom Wiki
Jump to navigation Jump to search
Note: Wait! Stop! You do not need to copy this actor's code into your project! Here's why:
  1. This actor is already defined in GZDoom, there's no reason to define it again.
  2. In fact, trying to define an actor with the same name will cause an error (because it already exists).
  3. If you want to make your own version of this actor, use inheritance.
  4. Definitions for existing actors are put on the wiki for reference purpose only.
Custom bridge
Actor type Bridge Game MiniZDoomLogoIcon.png (ZDoom)
DoomEd Number 9991 Class Name CustomBridge


Classes: CustomBridge
 →Bridge
 →ZBridge

CustomBridge can be used to create either a Doom-style or Hexen-style invisible bridge, and can also further customize the appearance and behavior of the rotating "bridge balls" when used as a Hexen-style bridge.

When placed in a map, the bridge's arguments control its appearance and behavior, as follows:

  • Arg 1: Bridge radius, in mapunits
  • Arg 2: Bridge height, in mapunits
  • Arg 3: Number of bridge balls to display.
  • Arg 4: Rotation speed and direction of bridge balls. 0 uses Hexen's default. Values from 1-128 rotate counterclockwise, while values from 129-255 go clockwise. For example:
  • 0: Hexen default
  • 11: 15° / second
  • 21: 30° / second
  • 32: 45° / second
  • 64: 90° / second
  • 128: 180° / second
  • 192: -90° / second
  • 223: -45° / second
  • 233: -30° / second
  • 244: -15° / second
  • Arg 5: Rotation radius of bridge balls, in bridge radius %. 0 is Hexen-default (15 units regardless of bridge radius)

Note: When inheriting from this actor in Decorate, you can redefine the Spawn state to change the way the bridge behaves as a Doom-format bridge (Arg 3 set to 0), or the See state to alter the way it behaves as a Hexen bridge. This can be used, for example, to change which actors are spawned instead of the bridge balls.

DECORATE definition

ACTOR CustomBridge native
{
  +SOLID
  +NOGRAVITY
  +NOLIFTDROP
  +ACTLIKEBRIDGE
  Radius 32
  Height 2
  RenderStyle None

  action native A_BridgeInit(class<Actor> balltype = "BridgeBall");

  States
  {
  Spawn:
    TLGL ABCDE 3 Bright 
    Loop
  See:
    TLGL A 2
    TLGL A 2 A_BridgeInit
    TLGL A -1
    Stop
  Death:
    TLGL A 2
    TLGL A 300
    Stop
  }
}