Difference between revisions of "Modding:Constants"

From DoomRL Wiki

Jump to: navigation, search
(Being Flags)
m (DamageType: DAMAGE_SPLASMA 0997)
Line 91: Line 91:
 
|colspan=2 style="background: darkred; color: yellow; font-size: 120%; text-align: center"|'''TDamageType'''
 
|colspan=2 style="background: darkred; color: yellow; font-size: 120%; text-align: center"|'''TDamageType'''
 
|-
 
|-
|style="vertical-align:top; padding-right: 2ex;"|DAMAGE_BULLET
+
|style="vertical-align:top; padding-right: 2ex;"|DAMAGE_BULLET <!-- 0 -->
 
|- style="background: #333;"
 
|- style="background: #333;"
|style="vertical-align:top; padding-right: 2ex;"|DAMAGE_MELEE
+
|style="vertical-align:top; padding-right: 2ex;"|DAMAGE_MELEE <!-- 1 -->
 
|-
 
|-
|style="vertical-align:top; padding-right: 2ex;"|DAMAGE_SHARPNEL [sic]
+
|style="vertical-align:top; padding-right: 2ex;"|DAMAGE_SHARPNEL [sic] <!-- 2 -->
 
|- style="background: #333;"
 
|- style="background: #333;"
|style="vertical-align:top; padding-right: 2ex;"|DAMAGE_ACID
+
|style="vertical-align:top; padding-right: 2ex;"|DAMAGE_ACID <!-- 3 -->
 
|-
 
|-
|style="vertical-align:top; padding-right: 2ex;"|DAMAGE_FIRE
+
|style="vertical-align:top; padding-right: 2ex;"|DAMAGE_FIRE <!-- 4 -->
 
|- style="background: #333;"
 
|- style="background: #333;"
|style="vertical-align:top; padding-right: 2ex;"|DAMAGE_PLASMA
+
|style="vertical-align:top; padding-right: 2ex;"|DAMAGE_PLASMA <!-- 5 -->
 
|-
 
|-
|style="vertical-align:top; padding-right: 2ex;"|DAMAGE_IGNOREARMOR
+
|style="vertical-align:top; padding-right: 2ex;"|DAMAGE_SPLASMA <!-- 6 -->
 +
|- style="background: #333;"
 +
|style="vertical-align:top; padding-right: 2ex;"|DAMAGE_IGNOREARMOR <!-- 7 -->
 
|}
 
|}
  

Revision as of 11:54, 2 July 2013

Constants and Enumerations are common in any game and DoomRL is no exception. Internally, as most programmers are aware, these are integers. But to modders they are all important magic values, looked up here.

Contents

Engine Enums

ItemType

Every item has a type that determines how the engine treats it.

TItemType
ITEMTYPE_NONE
ITEMTYPE_RANGED
ITEMTYPE_NRANGED
ITEMTYPE_ARMOR
ITEMTYPE_MELEE
ITEMTYPE_AMMO
ITEMTYPE_PACK
ITEMTYPE_POWER
ITEMTYPE_BOOTS
ITEMTYPE_TELE
ITEMTYPE_LEVER
ITEMTYPE_AMMOPACK

BodyTarget

Sources of damage must specify a body target to determine which sources of armor are used. Inherent armor bonuses always apply.

TBodyTarget
TARGET_INTERNAL Protection from boots and armor will be ignored.
TARGET_TORSO Protection from armor counts but protection from boots does not.
TARGET_FEET Protection from boots counts but protection from armor does not.

EqSlot

It is preferred to use the (equivalent) slot constants.

TEqSlot
EFTORSO
EFWEAPON
EFBOOTS
EFWEAPON2

StatusEffect

Affects specify one of these status effects that will apply a color scheme to all the tiles on the HUD.

TStatusEffect
STATUSNORMAL
STATUSINVERT
STATUSRED
STATUSGREEN

DamageType

Sources of damage usually specify a damage type that determines how the damage regards protection, resistances, gibbing, and other things. For details on the differences between the damage types, look here.

TDamageType
DAMAGE_BULLET
DAMAGE_MELEE
DAMAGE_SHARPNEL [sic]
DAMAGE_ACID
DAMAGE_FIRE
DAMAGE_PLASMA
DAMAGE_SPLASMA
DAMAGE_IGNOREARMOR

AltFire

TAltFire
ALT_NONE
ALT_CHAIN
ALT_THROW
ALT_SCRIPT
ALT_AIMED
ALT_SINGLE
ALT_WHIRLWIND

AltReload

TAltReload
RELOAD_NONE
RELOAD_SCRIPT
RELOAD_FULL
RELOAD_DUAL
RELOAD_SINGLE

ExplosionFlag

TExplosionFlag
EFSELFHALF Deals half damage to the active being.
EFSELFKNOCKBACK Gives extra knockback to the active being.
EFSELFSAFE Deals no damage to the active being.
EFAFTERBLINK Blinks the screen after the explosion finishes.
EFCHAIN Causes secondary explosions (as the BFG 9000).
EFHALFKNOCK Causes half the usual knockback.
EFNOKNOCK Doesn't cause knockback.
EFRANDOMCONTENT Transmutes some cells in the explosion to the explosion's content cell; the rules is to transmute when damage is greater than 20.

Level Flag

Level Flags
LF_NOHOMING Causes homing phase devices to act like normal phase devices.
LF_UNIQUEITEM Used by the level generation code to keep track of whether a unique item has dropped on the current level (in order to prevent multiple uniques from dropping on one level). This flag also causes a level feeling to occur indicating that a unique item is present.
LF_BONUS This flag is automatically set for so-called special levels like Halls of Carnage. (It is not set for those special levels like Hellgate that replace normal levels, only by those reached from red stairs.)
LF_SCRIPT This flag is automatically set for scripted levels, ie levels defined with the level blueprint.
LF_NORESPAWN Prevents the Nightmare! respawn feature.
LF_NUKED This flag is automatically set when the level is nuked.
LF_NONUKE Causes the thermonuclear bomb to have no effect when it is used. It is not respected by other nuke effects.
LF_ITEMSVISIBLE Allows the player to see all items on the level (as with a Computer Map).
LF_BEINGSVISIBLE Allows the player to see all beings on the level (as with a Tracking Map).
LF_RESPAWN Causes monsters to randomly respawn as when playing the game on Nightmare!
LF_SHARPFLUID  ???

Light Flag

Light Flags
LFEXPLORED This flag is set for explored cells. It can be modified to create computer map-like effects or Angel of Darkness-like effects.
LFVISIBLE This flag is set for cells in the player's current LOS. This flag is automatically recalculated on every player action. It may be useful to manually modify this flag if LOS needs to be updated more often.
LFLIGHTED This flag is always set on the same cells as LFVISIBLE; both flags must be set for a cell to be visible.
LFDAMAGE This is a bookkeeping flag for shotgun area-of-effect. Cells are set with this flag if they are calculated as in the shotgun blast but haven't yet been processed.
LFFRESH This is a bookkeeping flag for explosions. New corpses are set with this flag to keep them from being immediately destroyed. This flag can also be set to make any cell indestructible, but it may be cleared by the engine.
LFPERMANENT This flag marks a cell as being indestructible.
LFCORNER This flag only exists in debug builds of DoomRL. It identifies a cell that is visible but that enemies will not return fire from, ie, corner shooting.
LFBLOOD This flag marks a cell as being bloody. Bloody cells can only have cosmetic differences.
LFNOSPAWN
LFMARKER1
LFMARKER2

Constants

Maximums

Maximums
MAXX 78
MAXY 20
BOSS_LEVEL 25
MAXDEPTH 26
MAXAFFECT 5
MAX_INV_SIZE 22
MAX_EQ_SIZE 4

Cellsets

Cellsets
CELLSET_WALLS
CELLSET_FLOORS
CELLSET_CORPSES

Challenges

Challenges
CHALLENGE_BERSERK
CHALLENGE_MARKSMANSHIP
CHALLENGE_SHOTGUNNERY
CHALLENGE_LIGHTTRAVEL
CHALLENGE_IMPATIENCE
CHALLENGE_HASTE
CHALLENGE_PURITY
CHALLENGE_REDALERT
CHALLENGE_CARNAGE
CHALLENGE_MASOCHISM
CHALLENGE_100
CHALLENGE_PACIFISM
CHALLENGE_HUMANITY

Difficulty

Difficulty
DIFF_EASY
DIFF_MEDIUM
DIFF_HARD
DIFF_VERYHARD
DIFF_NIGHTMARE

PlayerRank

PlayerRank
RANKEXP
RANKSKILL

Player Statistics

Player Statistics
RANK_KILLTOTAL
RANK_KILLMELEE
RANK_KILLPISTOL
RANK_LEVEL
RANK_BADGE

Equip Slots

Equip Slots
SLOT_ARMOR
SLOT_WEAPON
SLOT_BOOTS
SLOT_PREPARED

Colors

Usually, it is possible to specify a foreground color and a background color. Since DoomRL uses 4 bit color, the lowest 4 bits determine the foreground color, and the next 4 bits determine the background color (zero is black). Occasionally, one of these may conflict with one of the special color constants. See Modding:Color for details.

Also, note that the exact color the end-user sees may depend on his system settings. For the basic 16 colors, the valkyrie string coloring escape is noted.

Colors
Color ID Valkyrie ID Looks Like
BLACK 0 @D
BLUE 1 @b
GREEN 2 @g
CYAN 3 @c
RED 4 @r
MAGENTA 5 @v
BROWN 6 @n or @N
LIGHTGRAY 7 @l
DARKGRAY 8 @d
LIGHTBLUE 9 @B
LIGHTGREEN 10 @G
LIGHTCYAN 11 @C
LIGHTRED 12 @R
LIGHTMAGENTA 13 @V
YELLOW 14 @y or @Y
WHITE 15 @L
Colors
Color ID Looks Like Comments
MULTIBLUE 17 Missile only
MULTIYELLOW 18 Missile only
MULTIPORTAL 20 Map object only
COLOR_WATER 21 Map object only
COLOR_ACID 22 Map object only
COLOR_LAVA 23 Map object only

Flags

Being Flags

Being Flags
BF_BOSS Killing this being will end the game. Other boss-only actions are usually scripted in Lua based on this flag.
BF_ENVIROSAFE Hazard tiles should not affect this being. Engine pathfinding algorithms are affected. Protection is not engine based; modders must make custom hazard cells check for this flag to prevent damage.
BF_CHARGE Hazard tiles do not concern this being. Engine pathfinding algorithms are affected.
BF_OPENDOORS This being can open doors. Engine pathfinding algorithms are affected.
BF_NODROP This being will not drop their inventory or equipment when they die.
BF_NOEXP This being will not award experience to the player. Often used to prevent exp farming.
BF_QUICKSWAP This being has the benefits of the Juggler trait.
BF_HUNTING This being always knows where the player is and will hunt them down. This flag is not engine based; modders must make custom AIs respect this flag before it will have any effect.
BF_BACKPACK This being has the ammo stacking benefits of the Backpack powerup.
BF_UNIQUENAME This being's name is a proper noun and UI messages will treat it as such.
BF_IMPATIENT This being will consume packs automatically. This flag is the main component of the Angel of Impatience challenge.
BF_SHOTTYMAN This being will reload shotguns on the move as part of the Shottyman trait. A shotgun is defined as any weapon with the IF_SHOTGUN flag.
BF_ROCKETMAN This being will reload rocket launchers on the move as part of the Shottyman trait. A rocket launcher is defined as any weapon with the IF_ROCKET flag.
BF_BERSERKER This being has the benefits of the Berserker trait.
BF_DARKNESS This being does not record exploration. This is one component of the Angel of Darkness challenge.
BF_DUALGUN This being has the benefits of the Dualgunner trait.
BF_POWERSENSE This being can sense powerups, one of the benefits of the first level Intuition trait.
BF_BEINGSENSE This being can sense enemies, one of the benefits of the second level Intuition trait.
BF_LEVERSENSE1 This being can sense if a lever is harmful, beneficial, or neutral, one of the benefits of the first level Intuition trait.
BF_LEVERSENSE2 This being can sense the exact effect of a lever, one of the benefits of the second level Intuition trait.
BF_NOMELEE This being cannot perform a melee attack. This is only seen on the Angel of Pacifism challenge and is probably not safe to use on an enemy. A custom AI can achieve a better effect.
BF_CLEAVE This being has the benefits of the Blademaster trait.
BF_MAXDAMAGE This being always rolls maximum damage. Every being gets this flag in the Angel of Max Carnage challenge.
BF_SESSILE This being cannot move. Only seen with the Gothic Arms set. This flags is not correctly implemented for non-player creatures; if you want an immobile enemy use a custom AI instead.
BF_VAMPYRE This being has the benefits of the Vampyre trait.
BF_REGENERATE This being regenerates one health per second if they have less than 20 health remaining. This used to be the benefit of a trait called Regenerator but it is no longer used anywhere in DoomRL.
BF_ARMYDEAD This being has the benefits of the Army of the Dead trait.
BF_FIREANGEL This being has the benefits of the Fireangel trait.
BF_GUNKATA This being has the benefits of the Gun Kata trait.
BF_AMMOCHAIN This being has the benefits of the Ammochain trait.
BF_MASTERDODGE This being has the benefits of the Dodgemaster trait.
BF_INV This being will not take any damage. This is the main component of the Invulnerable status effect. Be careful not to directly set an invincible being's HP to zero.
BF_BERSERK This being has the face pounding benefits of the Berserk status effect. The speed and resistance bonuses are not included.
BF_NORUNPENALTY This being has the benefits of the Running Man trait.
BF_PISTOLMAX This being has the benefits of the Sharpshooter trait.
BF_MEDPLUS This being can heal beyond 100% with med-packs alone as part of the Survivalist trait. This flag is not engine based; modders must make custom sources of healing respect this flag.
BF_HARDY This being can reduce damage all the way down to zero as part of the Survivalist trait. Normally all attacks do a minimum of one damage regardless of how much armor you have.
BF_SCAVENGER This being has the benefits of the Scavenger trait.
BF_INSTAUSE This being uses consumable items in 0.1s instead of the usual 1.0s. Part of the Technician class bonus.
BF_STAIRSENSE This being always knows the location of stair tiles. Part of the Scout class bonus.
BF_POWERBONUS Powerup effects last longer for this being. The exact bonus depends on difficulty. Part of the Marine class bonus.
BF_MAPEXPERT Computer maps will work like tracking maps for this being. Part of the Technician class bonus. This flag is not engine based obviously.
BF_DUALBLADE This being can attack with two melee weapons at once with each weapon attacking in half the time. Part of the Malicious Blades trait. A bladed weapon is defined as any weapon with the IF_BLADE flag.
BF_BLADEDEFEND This being gains extra resistances by having a bladed weapon in the prepared. Part of the Malicious Blades trait. A bladed weapon is defined as any weapon with the IF_BLADE flag.
BF_BULLETDANCE This being has the benefits of the Bullet Dance trait.
BF_SHOTTYHEAD This being has the benefits of the Shottyhead trait.
BF_ENTRENCHMENT This being has the benefits of the Entrenchment trait.
BF_MODEXPERT This being can mod unique items. Part of the Technician class bonus.
BF_SELFIMMUNE This being cannot be hurt by its own attack. Arch-Viles and Cyberdemons are two such beings.
BF_KNOCKIMMUNE This being is immune to knockback. Largely a characteristic of boss level enemies.
BF_NOHEAL This being cannot be healed. This is only seen on the Angel of Masochism challenge. This flag is not engine based; modders must make custom sources of healing respect this flag.
BF_GUNRUNNER This being has the benefits of the Gunrunner trait.

Some flags have no effect on non-player beings. Most trait flags are that way.

Generic Flags

Generic Flags
F_OVERLAY This flag is related to the graphical version.

Empty Flags

Empty flags are used with various functions to control the selection of random coords.

Empty Flags
EF_NOITEMS Excludes cells that contain an item.
EF_NOBEINGS Excludes cells that contain a being.
EF_NOBLOCK Excludes cells that block movement (CF_BLOCKMOVE).
EF_NOVISION Excludes cells that block vision (CF_BLOCKLOS).
EF_NOSTAIRS Excludes stairs (cells with an OnExit hook).
EF_NOTELE Excludes cells with a teleporter (an item with ITEMTYPE_TELE).
EF_NOHARM Excludes hazardous cells (CF_HAZARD).
EF_NOSAFE Excludes cells that are too near to the player (currently the threshold is less than or equal to distance of 5).
EF_NOSPAWN Excludes cells with LF_NOSPAWN.
Personal tools