From ZDoom Wiki
Jump to: navigation, search
Note: Wait! Stop! Before you copy this actor's definition into your mod, remember the following things:
  1. You do not need to copy that actor, since it is already defined.
  2. In fact, it's not just useless, it's actually harmful as it can cause problems.
  3. If you want to modify it, or use a modified version, using inheritance is the way to go.
  4. The actor definitions here are put on the wiki for reference purpose only. Learn from them, don't copy them.
  5. There is only one exception: if what you want is changing Ammo capacity, you need to create a new type from Ammo.
Player pawn
Actor type Internal Game MiniZDoomLogoIcon.png
DoomEd Number None Class Name PlayerPawn

Classes: PlayerPawn

PlayerPawn is the base class for player actors. By inheriting from it you can create custom player classes.


The PlayerPawn base class defines the following properties which are available to all player subclasses:

  • Player.AirCapacity value (New from 2.8.1)
Sets the air supply for the player class. This acts as a multiplier for the level's air supply value. A value of 2 will double the air supply, for instance. A value of 0 or less means the air supply is infinite, and thus the player class cannot drown.
Default is 1.0.
  • Player.AttackZOffset value
The height offset (in Doom map pixels) from the center of the player at which his attacks are fired. Scales according to crouched height.
  • Player.ColorRange start, end
Defines the color range in which to translate the player's sprite.
Default is no translation (0, 0).
  • Player.ColorSet number, name, start, end, color [...]
Defines a preset color set for the player class. The number must be unique. The name is used to identify the preset in the player setup menu. The start and end parameters determine the translation for the ColorRange, and the color parameter is used as the visual identifier for the set in the scoreboard.
Up to six additional color ranges can be defined, each with four parameter for range_start, range_end, first_color and last_color, in this order. See StrifePlayer for an example.
  • Player.ColorSetFile number, name, table, color
Defines a preset color set for the player class. The number must be unique. The name is used to identify the preset in the player setup menu. The translation is indicated by a translation table lump using the format defined by Hexen (TRANTBL0 to TRANTBLD). The color parameter is used as the visual identifier for the set in the scoreboard.
  • Player.ClearColorSet number
Removes a color set from the player class. This allows to remove color sets inherited from a parent class.
  • Player.CrouchSprite sprite
Defines the sprites for when your skin is crouching. If you don't define them your sprite will shrink half its vertical size to show it is crouching. For the crouch sprites you have to define all frames apart from the dying and gib frames. Please note that there is no "Crouch" state that is definable for players, as the engine would not support such a feature. Players need to be able to move seamlessly between crouching and standing during any given state (See, Missile, Melee, etc.) without losing their place in that state, hence there can be no generic "Crouch" state to jump to.
  • Player.DamageScreenColor color[, intensity[, damagetype]]
The colour the player's display turns when the player is in pain. This can be specified as three hex values for R, G, B respectively, or as a literal color name (e.g. "blue"). If this isn't defined, it defaults to red. The intensity of the flash can be scaled from 0.0 to 1.0. If a damagetype is specified, the color only applies when the last damage type received is that type. If there is no color specified for a given damage type, it defaults to what is set without one.
  • Player.DisplayName string
This is the identification string of the player class. It is used in addplayerclass KEYCONF command, in playerclass console variable, in skin definitions, and in menus. Each player class used in game must have an unique display name!
  • Player.Face string
This is the three-character prefix that will be used by the status bar face display built into DOOM and by custom status bars that define faces; note that with custom status bars in SBARINFO, faces can be used in all games (not just DOOM), provided the necessary graphics are supplied. This is like the face property of S_SKIN but for player classes. To include a status bar face you must put the 3 first letters of the sprite for the face here. For example, if one of the animations was BUGST00 you would put Face "BUG".
When deciding which face to use, the engine checks for STF**** (DOOM games only), the SBARINFO face, the current player class face, the face of the currently loaded skin and finally the morphed animal player class face; whichever it finds last "wins".
The engine also maintains faces across morphing; for example, if you were playing deathmatch in HeXen and have loaded an SBARINFO which defines faces for the fighter and also a DECORATE script containing a custom morph attack weapon that changes your enemy into a dog and includes dog face graphics; if you are turned into a dog, the status bar would change to show your face as a dog and turn back to a human again when you unmorph.
  • Player.FallingScreamSpeed value_min, value_max
When a player is falling within this range of speeds, they will play *falling sound.
Default is (35.0, 40.0).
  • Player.FlechetteType string
Type of fléchette used by this player class.
  • Player.ForwardMove value[, value-run]
Speed modifier for forward/backward movement. The value is for walking and value-run is for running.
Default is 1 for both values. The default run speed is double the walking speed, so Player.ForwardMove 1, 0.5
would disable running.
  • Player.GruntSpeed value
The minimum speed a player must be falling at the time of landing to play *grunt sound.
Default is 12.0.
  • Player.HealRadiusType string
The nature of the healing effect the player offers to his allies in cooperative multiplayer when using a Mystic Ambit Incant.
Value can be Health, Armor or Mana. Default is Health.
The player's armor class values in Hexen. All values must be a multiple of five (they are divided by five when displayed on the HUD). Base value is the player class's minimum, all other values are the increases gained by picking up the corresponding Hexen armor item.
  • Player.InvulnerabilityMode string
The secondary effect an invulnerability powerup will have on the player, in addition to the invulnerability and display gimmick.
Ghost will make the player phase in an out of ghost mode rapidly; Reflective will make the player reflect projectile attacks.
Default is unnamed. To obtain the default effect, just make sure the line is not present.
  • Player.JumpZ value (fixed point)
The player's jump speed. The player's jump height in normal gravity is (value)²/2.
Default is 8.0 .
  • Player.MaxHealth value
Default is 100.
The maximum health reachable by using normal health items.
  • Player.RunHealth value
The minimum health the player can have and still be able to run. (This is normally 16% for Strife)
Default is 0.
  • Player.Portrait string
Replaces the player portrait in the Class Selection screen to show a customized image, much like Hexen's Player Classes.
  • Player.ScoreIcon sprite
The icon visible next to the player's name on multiplayer scoreboard.
  • Player.SideMove value [value-run]
Speed modifier for left/right movement. The value is for walking and value-run is for running.
Default is 1 for both values. The default run speed is double the walking speed, so Player.SideMove 1, 0.5
would disable side-running.
NOTE: Side movement running speed is actually 4/5ths forward running speed, and the side walk speed is 24/25ths forward walk.
  • Player.SoundClass string
The sound class used by SNDINFO's $playersound command.
Default is "player".
  • Player.SpawnClass spawnclass
This is the filter for spawning things in a map. The spawnclass can be one of Any, Fighter, Cleric, Mage or a number between 1 and 16. 1 is synonymous with Fighter, 2 with Cleric and 3 with Mage.
  • Player.StartItem classname [amount]
Adds an item to player's start inventory. First weapon added is the weapon selected at start.
Note: The initial startitem list is never inherited and must be specified in full for each player class.
  • Player.UseRange range (New from 2.8.1)
Determines how far away a player class can activate lines or objects with the +use command.
Default is 64.0.
  • Player.WeaponSlot slot, weapon1[, weapon2, weapon3, ...]
Assigns the specified weapons to the given slot number for this player class. slot can be any single digit from 0 - 9. This is followed by a comma-separated list of each weapon's class name that should be assigned to that slot. If there is more than one weapon assigned to a given slot, the player can cycle between them by repeatedly pressing the slot button. For other ways to assign weapons to slots, see weapon slots.
  • Player.ViewHeight value
Specifies how high above the floor the player's eyes are.
Default is 41.0.
  • Player.MorphWeapon weapon
Sets the weapon the player will use when morphed to this class.
  • Player.MugShotMaxHealth value
Defines the value that is considered to be max health for the status bar mugshot. Negative values use the player's max health as the mug shot max health, zero (default value) uses 100 as the mug shot max health, and positive values are used directly as the mug shot max health.

PlayerPawn-specific flags also exist:

Player is not thrusted by attacks when invulnerable.
If this flag is given to a player morph, the morphed player recieves a tome of power if they are attempted to be morphed again. This is used by the chicken morph to reproduce the original behavior of Heretic and its "super chickens".
Enables crouching for morphed player classes.

DECORATE definition

ACTOR PlayerPawn native
  Health 100
  Radius 16
  Height 56
  Mass 100
  Painchance 255
  Speed 1
  Player.AttackZOffset 8
  Player.JumpZ 8
  Player.GruntSpeed 12
  Player.FallingScreamSpeed 35, 40
  Player.ViewHeight 41
  Player.UseRange 64
  Player.ForwardMove 1,1
  Player.SideMove 1,1
  Player.ColorRange 0,0
  Player.SoundClass "player"
  Player.DamageScreenColor "ff 00 00"
  Player.MugShotMaxHealth 0
  Player.FlechetteType "ArtiPoisonBag3"
  Player.AirCapacity 1
  Obituary "$OB_MPDEFAULT"