Category:Constants

From NWN Lexicon
Revision as of 15:11, 18 March 2023 by DoctorDeth (talk | contribs) (→‎Constant Groups)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Constants

Constants are names that usually represent a numeric value. Constants are used because they act as a single point of entry for a particular value (for example if you need to change the year from 2002 to 2003, rather than updating the number from 2002 to 2003 in a dozen or more places you would just update the constant value YEAR). Constants are also used because they give human readable names to numeric codes (its easier to discern that WHITE means the color white than its integer counterpart, #ffffff). Constants are unlike variables because their values cannot be changed. When compiled, the precompiler will go through the source code and strip out any constant expressions, replacing them with their actual values.


The const keyword is now available for making real constants (rather than declaring variables for a value).

Constant Groups

Constant Group Description

ABILITY_*

The standard six ability scores, used in GetAbilityModifier, EffectAbilityIncrease etc.

AC_*

Armor class types, used to specify what armor is being added in functions like EffectACIncrease.

ACTION_*

A non-exhuastive list of standard actions, returned by GetCurrentAction.

ACTION_MODE_*

Action modes a creature can enter. Used with SetActionMode and GetActionMode.

AI_LEVEL_*

Determines the AI (artificial intelligence) level of a creature controlled by the computer. A lower level means less CPU time. See SetAILevel and GetAILevel for more information.

ALIGNMENT_*

Alignment settings (covers both ethos and disposition).

AMBIENT_SOUND_*

These constants must match those in the AmbientSound.2da and are used for AmbientSoundChangeDay and AmbientSoundChangeNight.

ANIMAL_COMPANION_CREATURE_TYPE_*

Categories of possible animal companions. Note that animal companions are different from familiars.

ANIMATION_*

List of animations for PlayAnimation.

AOE_MOB_*

vfx_persistent.2da line reference. EffectAreaOfEffect defined as mobile areas, which should be applied to a creature which moves with them.

AOE_PER_*

vfx_persistent.2da line reference. EffectAreaOfEffect area effects centered on a fixed point and applied to a location.

APPEARANCE_TYPE_*

appearance.2da line reference. Determines the physical appearance of a creature.

AREA_*

Constants pertaining to the properties of the area as set in the area's properties, and used with GetIsAreaAboveGround and GetIsAreaNatural.

AREA_TRANSITION_*

Defines the various different categories of area transition screens that are displayed when an area is loading, ie lines from loadscreens.2da.

ASSOCIATE_COMMAND_*

Used to define various commands that can be issued to NPC associates, and captured via. listening patterns via. GetListenPatternNumber.

ASSOCIATE_TYPE_*

Various groups of NPC companions available to check, see GetAssociateType and GetAssociate.

ATTACK_BONUS_*

Used to specify which attacks are modified by an EffectAttackIncrease() or EffectAttackDecrease() effect.

ATTITUDE_*

Determines attitudes between creatures for faction reputation functions.

BASE_ITEM_*

Base items that other items can be built on top of. baseitems.2da reference for the given item, usually found with GetBaseItemType.

BODY_NODE_*

Location on a body; either hand or chest. Used for the EffectBeam effect.

CAMERA_MODE_*

Selects one of the three perspective views available in the game with SetCameraMode.

CAMERA_TRANSITION_TYPE_*

Used with SetCameraFacing to determine how smoothly to transition the camera.

CASSOWARY_STRENGTH_*

Used with cassowary functions to sort the strength of a cassowary.

CLASS_TYPE_*

Defines the standard class types, ie a line from classes.2da. See GetLevelByClass and GetClassByPosition.

COMBAT_MODE_*

Different combat modes, used for GetLastAttackMode.

COLOR_CHANNEL_*

Used for setting an objects colour with SetColor and GetColor.

CREATURE_MODEL_TYPE_*

Used to define the model type in SetCreatureBodyPart.

CREATURE_PART_*

For use with GetCreatureBodyPart and SetCreatureBodyPart.

CREATURE_SIZE_*

The size classes that creatures can belong to, can be got with GetCreatureSize. These values are hardcoded in the game engine but do related to creaturesize.2da

CREATURE_TAIL_TYPE_*

For use with GetCreatureTailType and SetCreatureTailType.

CREATURE_TYPE_*

Used to choose certain attributes to test against for GetNearestCreature.

CREATURE_WING_TYPE_*

For use with GetCreatureWingType and SetCreatureWingType.

DAMAGE_BONUS_*

Determines magical adjustments to damage. Not treated the same as DAMAGE_POWER_*, which determines if an attack can penetrate damage reduction. See EffectDamage.

DAMAGE_POWER_*

Determines the magical strength of a melee or missile attack (for harming creatures with damage reduction). Does not determine actual magical bonus (see DAMAGE_BONUS_*), just determines what damage reductions an attack bypasses. See EffectDamage.

DAMAGE_TYPE_*

The type of damage that can be inflicted, eg in EffectDamage and other effect functions.

DC_*

Difficulty Class constants used by the AutoDC function. These constants require you to include nw_i0_plot, which is where they are declared. They are in this order, difficulty wise: DC_EASY DC_MEDIUM DC_HARD DC_SUPERIOR DC_MASTER DC_LEGENDARY DC_EPIC

DEFENSIVE_CASTING_MODE_*

Determines if a creature is casting a spell defensively so they suffer no attacks of opportunity. See GetDefensiveCastingMode.

DETECT_MODE_*

Determines how a perceptive a creature is being, although you might have passive perception (eg if an Elf). See GetDetectMode.

DIRECTION_*

Used for determining compass direction.

DISEASE_*

Different types of Diseases used in creating disease effect objects, lines from disease.2da and used in EffectDisease.

DISTANCE_*

Distances used for determining positions. See x0_i0_position.nss

DOOR_ACTION_*

A list of actions that can be done on a door with DoDoorAction and GetIsDoorActionPossible.

DURATION_TYPE_*

Duration types for ApplyEffectAtLocation and ApplyEffectToObject functions.

EFFECT_ICON_*

Lines from effecticon.2da which can be used in EffectIcon.

EFFECT_TYPE_*

Constants that reflect the different effects that can be applied to creatures used with GetEffectType.

ENCOUNTER_DIFFICULTY_*

The list of encounter difficulties, can be retrieved by GetEncounterDifficulty.

EVENT_*

User-defined event codes; not hardcoded to any use just shortcuts for Bioware's default AI.

EVENT_SCRIPT_*

User-defined event codes for GetEventScript and SetEventScript.

FADE_SPEED_*

Determines the amount of time a fade screen effect takes with FadeFromBlack and FadeToBlack.

FAMILIAR_CREATURE_TYPE_*

Familiars are creatures specially summoned and bound to a wizard or sorcerer. They help the caster with tasks such as gathering spell components, delivering messages, or even combat, although most of them just perch on the wizards shoulder or pointing hat and grin impishly. When a wizard's or sorcerer's familiar dies, the caster suffers physical shock. Note that familiars are different from animal companions.

FEAT_*

Constants that deal with different feats that can be performed. Line into feat.2da.

FOG_COLOR_*

The color of the fog, to be specified within SetFogColor. Remember to check the documentation of SetFogColor for the ability to get exactly the right color you want.

FOG_TYPE_*

For use with SetFogColor, it is to specify which time of day the color change will affect.

FOOTSTEP_TYPE_*

For use with GetFootstepType and SetFootstepType.

GAME_DIFFICULTY_*

Specifies the list of available setting for game difficulty. Retrieve with GetGameDifficulty

GENDER_*

List of genders. See GetGender.

Globals

Global, non-grouped/misc constant and special values.

GUI_PANEL_*

List of all graphical panels (dialogs in windows programming terminology). See PopUpGUIPanel but since only one is defined use PopUpDeathGUIPanel usually.

IMMUNITY_TYPE_*

Constants to identify different immunities that creatures could possible have. See GetIsImmune and EffectImmunity.

INVENTORY_DISTURB_TYPE_*

The list of possible ways an inventory can be disturbed in the OnDisturbed event, retrieved by GetInventoryDisturbType..

INVENTORY_SLOT_*

Constant group for inventory equipment slots. These are the slots where items are placed when that are equipped (in use), and not the slots where items are just stored. Also there exists a constant NUM_INVENTORY_SLOTS which can be used with a for loop as an upper limit (start at 0) to iterate through all inventory slots for equipped items. See ActionEquipItem and GetItemInSlot.

INVISIBILITY_TYPE_*

Determines how a creature is protected from the sight of other creatures. See EffectInvisibility.

IP_CONST_ABILITY_*

Itemproperty constants regarding abilities.

IP_CONST_ACMODIFIERTYPE_*

Itemproperty constants relating to armor class modifier types.

IP_CONST_ADDITIONAL_*

UNKNOWN

IP_CONST_ALIGNMENT_*

Itemproperty constants relating to specific alignments, such as AC bonus against an alignment.

IP_CONST_ALIGNMENTGROUP_*

Constants used for itemproperties relating to specific alignment groups - for instance AC bonus vs an alignment group.

IP_CONST_AMMOTYPE_*

Different types of ranged ammuniations.

IP_CONST_ARCANE_SPELL_FAILURE_*

Itemproperty constants relating to arcane spell failure.

IP_CONST_CASTSPELL_*

Itemproperty constants for adding "cast spell" to items.

IP_CONST_CASTSPELL_NUMUSES_*

Itemproperty constants relating to the number of uses an item has of a specific spell.

IP_CONST_CLASS_*

Itemproperty constants relating to classes.

IP_CONST_CONTAINERWEIGHTRED_*

Itemproperty constants relating to containers reducing the weight of their contents.

IP_CONST_DAMAGEBONUS_*

Itemproperty constants relating to damage bonus.

IP_CONST_DAMAGEIMMUNITY_*

Itemproperty constants relating to damage immunity.

IP_CONST_DAMAGEREDUCTION_*

Itemproperty constants relating to damage reduction.

IP_CONST_DAMAGERESIST_*

Itemproperty constants relating to damage resistance.

IP_CONST_DAMAGESOAK_*

Itemproperty constants relating to damage soaking.

IP_CONST_DAMAGETYPE_*

Constants relating to itemproperties specific to damagetypes, such as AC bonus against a specific damagetype.

IP_CONST_DAMAGEVULNERABILITY_*

Itemproperty constants relating to damage vulnerability.

IP_CONST_FEAT_*

Constants for feat related itemproperties. The descriptions here are identical to the ones in the FEAT_* constants section. Far from all the feats can be added to items. Note that even if a description says that a feat requires a prerequisite, this isn't the case when granting that feat through the use of an item.

IP_CONST_IMMUNITYMISC_*

Itemproperty constants relating to miscellaneous immunities.

IP_CONST_IMMUNITYSPELL_*

Itemproperty constants relating to spell immunities.

IP_CONST_LIGHTBRIGHTNESS_*

Itemproperty constants relating to the brightness of light an item emits.

IP_CONST_LIGHTCOLOR_*

Itemproperty constants relating to the color of light an item emits.

IP_CONST_MONSTERDAMAGE_*

Different damage range (dice) for monsters.

IP_CONST_ONHIT_*

Itemproperty constants relating to when a weapons successfully hits something.

IP_CONST_ONHIT_CASTSPELL_*

Itemproperty constants relating to OnHit: Cast spell. Please consult the SPELL_* constant section of the Lexicon for further info.

IP_CONST_ONHIT_DURATION_*

Itemproperty constants relating to the duration / percentage of effecting the target of certain OnHit properties.

IP_CONST_ONHIT_SAVEDC_*

Itemproperty constants relating to the save DC (saving throw difficulty class) against an OnHit property.

IP_CONST_ONMONSTERHIT_*

Special abilities a monster can perform when it scores a successful hit.

IP_CONST_POISON_*

Itemproperty constants relating to OnHit: poison.

IP_CONST_QUALITY_*

UNKNOWN

IP_CONST_RACIALTYPE_*

Itemproperty constants relating to racial types - e.g. AC bonus against a certain racial type.

IP_CONST_REDUCEDWEIGHT_*

Constants for the reduced weight itemproperty.

IP_CONST_SAVEBASETYPE_*

Itemproperty constants relating to saving throw base types.

IP_CONST_SAVEVS_*

Itemproperty constants relating to saving throws versus specific effects or damage types.

IP_CONST_SPELLLEVEL_*

Denotes different levels of magical spells.

IP_CONST_SPELLRESISTANCEBONUS_*

Itemproperty constants relating to spell resistance bonuses.

IP_CONST_SPELLSCHOOL_*

Itemproperty constants relating to spell schools.

IP_CONST_TRAPSTRENGTH_*

Itemproperty constants relating to traps' strength.

IP_CONST_TRAPTYPE_*

Itemproperty constants relating to trap types.

IP_CONST_UNLIMITEDAMMO_*

Itemproperty constants relating to unlimited ammunition.

IP_CONST_WEIGHTINCREASE_*

Itemproperty constants relating to weight increase of items.

ITEM_APPR_*

Various item appearance constants which describe the way certain classes of items can appear.

ITEM_PROPERTY_*

Magical or other properties that can be applied to an item.

ITEM_VISUAL_*

Visual effects performed by an item.

METAMAGIC_*

Metamagic feats applied to a spell. See GetMetaMagicFeat.

MISS_CHANCE_TYPE_*

Used to specify the miss chance type for EffectMissChance.

MOUSECURSOR_*

Used to specify the mouse cursor to use with EnterTargetingMode.

NAME_*

These constants determine which name table to use when generating random names with RandomName.

NW_ASC_*

Covers miscellaneous skills and settings not categorized into other subgroups. These are not actually constants, and do not exist in nwscript.nss. To use these, you must include nw_i0_generic.

NW_ASC_AGGRESSIVE_*

Determines what skills or abilities an NPC associate uses automatically. These are not actually constants, and do not exist in nwscript.nss. To use these, you must include x0_i0_assoc.

NW_ASC_DISTANCE_*

Determines the distance, in meters, the NPC associate follows the PC at. These are not actually constants, and do not exist in nwscript.nss. To use these, you must include nw_i0_generic.

NW_ASC_HEAL_AT_*

Used to determine at which percentage of the master's hit points an NPC associate should attempt to heal the master. These are not actually constants, and do not exist in nwscript.nss. To use these, you must include nw_i0_generic.

NW_FLAG_*

Used to cause events to fire various numeric signals to OnUserDefined and set other attributes of a creature during the OnSpawn script using SetSpawnInCondition. The OnUserDefined event can thus be used to customize the behavior of an object without actually modifying the default behavior.

NW_FLAG_BEHAVIOR_*

Determines how an NPC reacts, irregardless of faction.

OBJECT_VISUAL_TRANSFORM_*

Used with GetObjectVisualTransform and SetObjectVisualTransform to do interpolated visual transforms.

OBJECT_VISUAL_TRANSFORM_LERP_*

Used with GetObjectVisualTransform and SetObjectVisualTransform to do interpolated visual transforms.

OBJECT_TYPE_*

Used to categorize types of objects.

PACKAGE_*

Represent the default packages for classes. Used in conjunction with the LevelUpHenchman command.

PANEL_BUTTON_*

Client panel buttons including character sheet, inventory, journal, map, options, player vs player, resting and spellbook.

PERCEPTION_*

Determines if a creature perceives another creature using its Spot skill vs. the other creature's Hide skill and its Listen skill vs. the other creature's Move Silently skill.

PERSISTENT_ZONE_*

Used with GetFirstInPersistentObject() and GetNextInPersistentObject() functions.

PHENOTYPE_*

Phenotype constants (all 3) are meant to be used with the functions GetPhenoType() and SetPhenoType(). They should really only be used by custom content people who aim to take advantage of the new way of altering a Player Characters appearance easily.

PLACEABLE_ACTION_*

Actions that can be performed on placeable objects with GetIsPlaceableObjectActionPossible and DoPlaceableObjectAction.

PLAYER_CHAR_*

Used for testing if a PC is actually controlled by a player.

POISON_*

This constant group defines the many in game poisons. Index into poison.2da.

POLYMORPH_TYPE_*

These constants define the properties applied to targets when they are polymorphed into different creatures.

PROJECTILE_PATH_TYPE_*

Different types of projectile paths (the path a missile weapon or other projectile follows as it travels) for ActionCastSpellAtObject and ActionCastSpellAtLocation.

QUEST_*

Various quest statuses for quest functions. See x0_i0_plotgiver.nss

RACIAL_TYPE_*

Constants used to identify different races (human, dwarf etc), line in racialtypes.2da.

RADIUS_SIZE_*

Different degrees of radius size used in area-based functions such as GetFirstObjectInShape.

REPUTATION_TYPE_*

Determines how creatures react to one another.

REST_EVENTTYPE_*

Determines the status of the last rest event for the PC, see GetLastRestEventType.

RUNSCRIPT_EFFECT_SCRIPT_TYPE_*

Determines what last event was fired for EffectRunScript, via. GetLastRunScriptEffectScriptType.

SAVING_THROW_*

Core saving throws.

SAVING_THROW_TYPE_*

Describes different saving throw types.

SCREEN_ANCHOR_*

Used for setting the anchor point of PostString.

SHAPE_*

SHAPE_* constants are used in the GetFirstObjectInShape() and GetNextObjectInShape() functions.

SKILL_*

Skills used in NWN. The SKILL_* constants are actually integers, the corresponding values of which can be found in nwscript.nss. Those integers, in turn, are references to row-numbers in the gamefile skills.2da.

SKYBOX_*

Skybox constants must match those in the skyboxes.2da file. They are to be used with the SetSkyBox function.

SPECIAL_ATTACK_*

Special attacks that can be performed during combat, see GetLastAttackType.

SPELL_*

Magical spells cast by classes such as wizards, sorcerers, bards, clerics, and druids. More information about what the spells do can be found in the descriptions in manuals / spell scrolls, and by looking in the "spells.2da" file. Known bug: the spells which summon elements (Summon Creature VII through IX) can successfully summon air, water, and fire elements, but earth elements cannot be summoned.

SPELL_CRAFT_*

Actually just more constants for spells.2da entries but generally tied to dye and poisoning items.

SPELL_SCHOOL_*

Schools of spells; can be sought with GetSpecialization.

SPELLABILITY_*

Magical spell-like abilities some creatures possess. spells.2da reference.

STANDARD_FACTION_*

The four generic factions used to determine enmity and friendship by NPCs.

STEALTH_MODE_*

Determines if stealth mode (moving silently, hiding in shadows) is activated. Characters move slower when stealth mode is activated.

STRING_COLOR_*

Used to specify predefined RGB encoded colorization strings used with the x3_inc_string.

SUBSKILL_*

Subskills for dealing with traps; additions for Rogues to their standard Search skill.

SUBTYPE_*

Effect subtypes. See GetEffectSubtype and SupernaturalEffect, ExtraordinaryEffect and MagicalEffect.

TALENT_CATEGORY_*

Groups the talents into categories. Talents are spells or feats (no skills by default) and usually is sought with GetCreatureTalentBest.

TALENT_TYPE_*

Primary category of talents for use by creatures in game. See GetTypeFromTalent.

TALKVOLUME_*

Sets the broadcast range of text displayed using SpeakString and ActionSpeakString functions, and GetPCChatVolume/SetPCChatVolume.

TILE_MAIN_LIGHT_COLOR_*

List of available colors to be used as the main light source of a tile.

TILE_SOURCE_LIGHT_*

Colors for dynamic lighting to shine upon tiles.

TILESET_RESREF_*

The following resrefs (string format) must match those in the tileset's set file.

TRACK_*

Musical tracks played throughout the game, lines from ambientmusic.2da

TRAP_BASE_TYPE_*

Used to catagorize the strength and type of traps, lines from traps.2da

TREASURE_*

Treasure types, see nw_o2_coninclude.

VFX_BEAM_*

Beams fire in a straight line towards their targets. These constants are actually integers which can be found in nwscript.nss and refer to row numbers in the file visualeffects.2da - this file also contains visual effects for which there are no constants. If you want to use one of those, just use EffectBeam(XXX) where XXX is the rownumber.

VFX_COM_*

Common visual special effects. These constants are actually integers which can be found in nwscript.nss and refer to row numbers in the file visualeffects.2da - this file also contains visual effects for which there are no constants. If you want to use one of those, just use EffectVisualEffect(XXX) where XXX is the rownumber.

VFX_DUR_*

Temporary visual effects that last for a specified duration. These constants are actually integers which can be found in nwscript.nss and refer to row numbers in the file visualeffects.2da - this file also contains visual effects for which there are no constants. If you want to use one of those, just use EffectVisualEffect(XXX) where XXX is the rownumber.

VFX_EYES_*

Race specific glowing eye effects. These constants are actually integers which can be found in nwscript.nss and refer to row numbers in the file visualeffects.2da - this file also contains visual effects for which there are no constants. If you want to use one of those, just use EffectVisualEffect(XXX) where XXX is the rownumber.

VFX_FNF_*

Bigger, flashier visual effects. These constants are actually integers which can be found in nwscript.nss and refer to row numbers in the file visualeffects.2da - this file also contains visual effects for which there are no constants. If you want to use one of those, just use EffectVisualEffect(XXX) where XXX is the rownumber.

VFX_IMP_*

Impact visual effects that are generally used for spells when the spell effect hits someone. VFX_IMP_* -type effects can only be applied with DURATION_TYPE_INSTANT These constants are actually integers which can be found in nwscript.nss and refer to row numbers in the file visualeffects.2da - this file also contains visual effects for which there are no constants. If you want to use one of those, just use EffectVisualEffect(XXX) where XXX is the rownumber.

VIBRATOR_MOTOR_*

Used with Vibrate for controller vibrations.

VOICE_CHAT_*

List of character voice sayings. Used with PlayVoiceChat.

WEATHER_*

Different weather types, can be used with SetWeather and GetWeather and is an index into weathertypes.2da

X2_IP_ADDPROP_POLICY_*

These constants are only available if you include x2_inc_itemprop in your script. They are used in the IPSafeAddItemProperty command in the same include file and determine what should happen when adding a type of itemproperty to an item that already has one of that type.

X2_IP_ARMORTYPE_*

Armortype constants for use with various of the x2_inc_itemprop itemproperty functions.

X2_TL_GROUNDTILE_*

Tile visual effects for use with the tile magic (tm) system.



Subcategories

This category has only the following subcategory.

G

Pages in category "Constants"

The following 200 pages are in this category, out of 210 total.

(previous page) (next page)
(previous page) (next page)