## OBSE v0017 Command Documentation

New values and functions available in v0017 are marked with an asterisk
OBSE @ Oblivion Construction Set Wiki
New 0017 features:
Array variables
Complex expressions
Ability to use string variables as arguments to ordinary commands
Bracket and slice notation for strings
Loops
New v0017 functions:
Let
Eval
TestExpr
While
ForEach
Loop
Continue
Break
ToString
Print
TypeOf
ar_Construct
ar_Size
ar_Dump
ar_DumpID
ar_Erase
ar_Find
ar_Sort
ar_SortAlpha
IsKeyDisabled
IsControlDisabled
GetFollowers
GetCurrentRegion
Activate2
GetEquippedItems
GetBaseItems
GetItems
GetSpells
GetNthEffectItemName
ActorValueToString
GetParentWorldSpace
GetEditorID
MatchPotion
MagicEffectFromCode
MagicEffectFromChars
IncrementPlayerSkillUseC
GetSkillUseIncrementC
SetSkillUseIncrementC
SetCellWaterHeight
DispelNthActiveEffect
IsRefDeleted
ModPCMovementSpeed
GetPCMovementSpeedModifier
IsRacePlayable
IsGameMessageBox
GetMessageBoxType
GetTileChildren
GetTileTraits
PrintTileInfo
GetMagicEffectName
GetMagicEffectNameC
GetMagicEffectHitShader
GetMagicEffectHitShaderC
GetMagicEffectEnchantShader
GetMagicEffectEnchantShaderC
GetMagicEffectLight
GetMagicEffectLightC
GetMagicEffectCastingSound
GetMagicEffectCastingSoundC
GetMagicEffectBoltSound
GetMagicEffectBoltSoundC
GetMagicEffectHitSound
GetMagicEffectHitSoundC
GetMagicEffectAreaSound
GetMagicEffectAreaSoundC
GetMagicEffectNumCounters
GetMagicEffectNumCountersC
GetMagicEffectResistValue
GetMagicEffectResistValueC
GetNthMagicEffectCounter
GetNthMagicEffectCounterC
GetMagicEffectCounters
GetMagicEffectCountersC
GetMagicEffectIcon
GetMagicEffectIconC
GetMagicEffectModel
GetMagicEffectModelC
SetMagicEffectIsHostile
SetMagicEffectIsHostileC
SetMagicEffectCanRecover
SetMagicEffectCanRecoverC
SetMagicEffectIsDetrimental
SetMagicEffectIsDetrimentalC
SetMagicEffectMagnitudePercent
SetMagicEffectMagnitudePercentC
SetMagicEffectOnSelfAllowed
SetMagicEffectOnSelfAllowedC
SetMagicEffectOnTouchAllowed
SetMagicEffectOnTouchAllowedC
SetMagicEffectOnTargetAllowed
SetMagicEffectOnTargetAllowedC
SetMagicEffectNoDuration
SetMagicEffectNoDurationC
SetMagicEffectNoMagnitude
SetMagicEffectNoMagnitudeC
SetMagicEffectNoArea
SetMagicEffectNoAreaC
SetMagicEffectFXPersists
SetMagicEffectFXPersistsC
SetMagicEffectForSpellmaking
SetMagicEffectForSpellmakingC
SetMagicEffectForEnchanting
SetMagicEffectForEnchantingC
SetMagicEffectNoIngredient
SetMagicEffectNoIngredientC
SetMagicEffectUsesWeapon
SetMagicEffectUsesWeaponC
SetMagicEffectUsesArmor
SetMagicEffectUsesArmorC
SetMagicEffectUsesCreature
SetMagicEffectUsesCreatureC
SetMagicEffectUsesSkill
SetMagicEffectUsesSkillC
SetMagicEffectUsesAttribute
SetMagicEffectUsesAttributeC
SetMagicEffectUsesActorValue
SetMagicEffectUsesActorValueC
SetMagicEffectNoHitEffect
SetMagicEffectNoHitEffectC
SetMagicEffectName
SetMagicEffectNameC
SetMagicEffectSchool
SetMagicEffectSchoolC
SetMagicEffectBaseCost
SetMagicEffectBaseCostC
SetMagicEffectResistValue
SetMagicEffectResistValueC
SetMagicEffectIcon
SetMagicEffectIconC
SetMagicEffectCastingSound
SetMagicEffectCastingSoundC
SetMagicEffectBoltSound
SetMagicEffectBoltSoundC
SetMagicEffectHitSound
SetMagicEffectHitSoundC
SetMagicEffectAreaSound
SetMagicEffectAreaSoundC
SetMagicEffectEnchantFactor
SetMagicEffectEnchantFactorC
SetMagicEffectBarterFactor
SetMagicEffectBarterFactorC
SetMagicEffectModel
SetMagicEffectModelC
SetMagicEffectHitShader
SetMagicEffectHitShaderC
SetMagicEffectEnchantShader
SetMagicEffectEnchantShaderC
SetMagicEffectProjectileSpeed
SetMagicEffectProjectileSpeedC
SetMagicEffectLight
SetMagicEffectLightC
AddMagicEffectCounter
AddMagicEffectCounterC
RemoveNthMagicEffectCounter
RemoveNthMagicEffectCounterC
SetMagicEffectCounters
SetMagicEffectCountersC
SetMagicEffectOtherActorValue
SetMagicEffectOtherActorValueC
SetMagicEffectUsedObject
SetMagicEffectUsedObjectC
GetCombatStyle
GetCombatStyleDodgeChance
GetCombatStyleDodgeLRChance
GetCombatStyleDodgeLRTimerMin
GetCombatStyleDodgeLRTimerMax
GetCombatStyleDodgeFWTimerMin
GetCombatStyleDodgeFWTimerMax
GetCombatStyleDodgeBackTimerMin
GetCombatStyleDodgeBackTimerMax
GetCombatStyleIdleTimerMin
GetCombatStyleIdleTimerMax
GetCombatStyleBlockChance
GetCombatStyleAttackChance
GetCombatStyleStaggerBonusToAttack
GetCombatStyleKOBonusToAttack
GetCombatStyleH2HBonusToAttack
GetCombatStylePowerAttackChance
GetCombatStyleStaggerBonusToPowerAttack
GetCombatStyleKOBonusToPowerAttack
GetCombatStyleHoldTimerMin
GetCombatStyleHoldTimerMax
GetCombatStyleAcrobaticsDodgeChance
GetCombatStyleRangeOptimalMult
GetCombatStyleRangeMaxMult
GetCombatStyleSwitchDistMelee
GetCombatStyleSwitchDistRanged
GetCombatStyleBuffStandoffDist
GetCombatStyleRangedStandoffDist
GetCombatStyleGroupStandoffDist
GetCombatStyleRushAttackChance
GetCombatStyleRushAttackDistMult
GetCombatStyleDodgeFatigueModMult
GetCombatStyleDodgeFatigueModBase
GetCombatStyleEncumberedSpeedModBase
GetCombatStyleEncumberedSpeedModMult
GetCombatStyleDodgeUnderAttackMult
GetCombatStyleDodgeNotUnderAttackMult
GetCombatStyleDodgeBackUnderAttackMult
GetCombatStyleDodgeBackNotUnderAttackMult
GetCombatStyleDodgeFWAttackingMult
GetCombatStyleDodgeFWNotAttackingMult
GetCombatStyleBlockSkillModMult
GetCombatStyleBlockSkillModBase
GetCombatStyleBlockUnderAttackMult
GetCombatStyleBlockNotUnderAttackMult
GetCombatStyleAttackSkillModMult
GetCombatStyleAttackSkillModBase
GetCombatStyleAttackUnderAttackMult
GetCombatStyleAttackNotUnderAttackMult
GetCombatStyleAttackDuringBlockMult
GetCombatStylePowerAttackFatigueModBase
GetCombatStylePowerAttackFatigueModMult
SetCombatStyleDodgeChance
SetCombatStyleDodgeLRChance
SetCombatStyleDodgeLRTimerMin
SetCombatStyleDodgeLRTimerMax
SetCombatStyleDodgeFWTimerMin
SetCombatStyleDodgeFWTimerMax
SetCombatStyleDodgeBackTimerMin
SetCombatStyleDodgeBackTimerMax
SetCombatStyleIdleTimerMin
SetCombatStyleIdleTimerMax
SetCombatStyleBlockChance
SetCombatStyleAttackChance
SetCombatStyleStaggerBonusToAttack
SetCombatStyleKOBonusToAttack
SetCombatStyleH2HBonusToAttack
SetCombatStylePowerAttackChance
SetCombatStyleStaggerBonusToPowerAttack
SetCombatStyleKOBonusToPowerAttack
SetCombatStyleHoldTimerMin
SetCombatStyleHoldTimerMax
SetCombatStyleAcrobaticsDodgeChance
SetCombatStyleRangeOptimalMult
SetCombatStyleRangeMaxMult
SetCombatStyleSwitchDistMelee
SetCombatStyleSwitchDistRanged
SetCombatStyleBuffStandoffDist
SetCombatStyleRangedStandoffDist
SetCombatStyleGroupStandoffDist
SetCombatStyleRushAttackChance
SetCombatStyleRushAttackDistMult
SetCombatStyleDodgeFatigueModMult
SetCombatStyleDodgeFatigueModBase
SetCombatStyleEncumberedSpeedModBase
SetCombatStyleEncumberedSpeedModMult
SetCombatStyleDodgeUnderAttackMult
SetCombatStyleDodgeNotUnderAttackMult
SetCombatStyleDodgeBackUnderAttackMult
SetCombatStyleDodgeBackNotUnderAttackMult
SetCombatStyleDodgeFWAttackingMult
SetCombatStyleDodgeFWNotAttackingMult
SetCombatStyleBlockSkillModMult
SetCombatStyleBlockSkillModBase
SetCombatStyleBlockUnderAttackMult
SetCombatStyleBlockNotUnderAttackMult
SetCombatStyleAttackSkillModMult
SetCombatStyleAttackSkillModBase
SetCombatStyleAttackUnderAttackMult
SetCombatStyleAttackNotUnderAttackMult
SetCombatStyleAttackDuringBlockMult
SetCombatStylePowerAttackFatigueModBase
ar_First
ar_Last
ar_Next
ar_Prev
ar_Keys
ar_HasKey
ar_BadStringIndex
ar_BadNumericIndex
ar_Copy
ar_Null
ar_DeepCopy
ActorValueToStringC
GetKeyName
AsciiToChar
GetFormIDString
NumToHex
DeleteReference
IsOblivionGate
CanCastPower
SetCanCastPower
GetUsedPowers
SetPowerTimer
Table of Contents

- Function Syntax Format
- Function Calling Conventions
- Qualities
- Types
- General Functions
- Cloning Functions
- Flow Control Functions
- Console Functions
- Input Functions
- Math Functions
- Mod Functions
- Trig Functions
- Output Functions
- Spam-Blocking Functions
- Mod Functions
- Hotkey Functions
- File Functions
- UI Functions
- Text Input Functions
- String Variables
- Type Codes
- Function Index

Function Syntax Format
(returnValueName:returnValueType) reference.FunctionName parameter1:type parameter2:type
optional - optional parameters or references are in italics
Parameter Types: designated after colon
float a positive or negative decimal number
long a positve whole number with large values
short a positive whole number with smaller values
ref a ref (usually an objectID)
chars a 4 character magic effect code (for example: FIDG, Z001)
string a set of characters in quotes
bool a short with only 2 values: 1 for true and 0 for false
Additional OBSE paramter types
formatString a string containing zero or more format specifiers followed by up to twenty variables
string_var a variable defined as a string_var, with a unique ID representing a string of characters
array_var an array_var variable, with a unique ID representing an array of keys and values
array an array, not necessarily stored in a variable. (ex: someArr[1:4] is an array but not an array_var)
arrayKey an array key (either a string, integer, or float)
Array an array of type Array, with integer keys
StringMap an array of type StringMap, with string keys
Map an array of type Map, with floating point keys
expr an OBSE expression
Function Calling Conventions:
By Reference or ObjectID
reference.FunctionName someParameters objectID:ref
Examples:
(health:long) reference.GetObjectHealth objectID:ref
(oldEnchantment:ref) reference.SetEnchantment nuEnchantment:ref objectID:ref
These functions can either be called on a reference or have an objectID passed in as an argument. If an objectID is passed in, it takes precedence over a calling reference.
By Reference only:
reference.FunctionName someParameters
Examples:
(oldPoison:ref) reference.SetEquippedWeaponPoison nuPoison:ref
These functions must be called on a reference.
By ObjectID only
FunctionName someParamters objectID:ref
(masterLevel:short) GetSpellMasteryLevel spell:ref
(effectCode:long) GetNthEffectItemCode magicItem:ref whichEffect:long
Qualities
Qualities are a set of related values and functions which apply to multiple Oblivion object types. For documentation purposes I have gathered the related values together. Any type which has a given quality has all of values listed and all of the quality's functions may be applied to the type.

- Actor
- Attacking
- Audible
- Breakable
- Class
- Container
- Edible
- Enchantable
- Equippable
- Inventory
- Lockable
- Magic
- Magic Target
- Named
- Ownable
- Race
- Simple
- Scriptable
- Wearable

Actor
Includes creatures and NPCs. All changes to actor flags such as Respawn and Low Level Processing are saved in the savegame.
Functions:
IsRefEssential - returns whether the referenced actor is essential
(isEssential:bool) reference.IsRefEssential
SetRefEssential - sets the calling ref to be essential or not
reference.SetRefEssential isEssential:bool
HasSpell - returns whether the actor has the specified spell
(hasSpell:bool) reference.HasSpell spell:ref
GetActorValueC - returns the actor value specified by the actor value code
(actorValue:long) reference.GetActorValueC actorValueCode:short
(actorValue:long) reference.GetAVC actorValueCode:short
ModActorValueC - modifies the actor value without changing the base value. Acts like a spell: a negative number reduces the value which can be restored and a positive value restores values without exceeding the maximum of the stat.
(nothing) reference.ModActorValueC actorValueCode:short value:long
(nothing) reference.ModAVC actorValueCode:short value:long
SetActorValueC - sets the actor value specified by the actor value code
(nothing) reference.SetActorValueC actorValueCode:short value:long
(nothing) reference.SetAVC actorValueCode:short value:long
ModActorValue2 - modifies the current value without changing the base value. Acts like a spell: a negative number reduces the value which can be restored and a positive value restores values without exceeding the maximum of the stat.
(nothing) reference.ModActorValue2 actorValueName:string value:long
GetActorLightAmount - returns a float describing the amount of light falling on an actor, or 100 if the actor is not in high/medium-high process.
(lightAmount:float) reference.GetActorLightAmount
CanCorpseCheck - returns 1 if the Can Corpse Check flag is set on the actor
(canCoprseCheck:bool) reference.CanCorpseCheck actor:ref
GetActorMinLevel - returns the minimum level of the actor if the PC Level Offset flag is set
(minLevel:short) reference.GetMinLevel actor:ref
GetActorMaxLevel - returns the maximum level of the actor if the PC Level Offset flag is set
(maxLevel:short) reference.GetMaxLevel actor:ref
GetNumFactions - returns the number of factions to which the actor belongs
(numFactions:short) reference.GetNumFactions actor:ref
GetNthFaction - returns the nth faction to which the actor belongs
(faction:ref) reference.GetNthFaction actor:ref
GetActorSoulLevel - returns the soul level of any actor. If an NPC it returns Grand, otherwise if a creature it returns the creature's soul level.
(soulLevel:short) reference.GetActorSoulLevel actor:ref
HasLowLevelProcessing - returns 1 if the actor has low level processing enabled
(hasLowProc:bool) reference.HasLowLevelProcessing actor:ref
HasNoPersuasion - returns 1 if the No Persuasion flag is set on the actor
(hasNoPers) reference.HasNoPersuasion actor:ref
IsActorRespawning - returns 1 if the Respawn flag is set on the actor
(respawns:bool) reference.IsActorRespawning actor:ref
IsPCLevelOffset - returns 1 if the actor's level is calculated relative to the player's level
(isLevOffset:bool) reference.IsPCLevelOffset actor:ref
IsSummonable - returns 1 if the Summonable flag is set on the actor
(isSummonable:bool) reference.IsSummonable actor:ref
SetActorRespawns - changes the Respawn flag on the actor
(nothing) reference.SetActorRespawns flag:short actor:ref
SetCanCorpseCheck - changes the Can Corpse Check flag on the actor
(nothing) reference.SetCanCorpseCheck flag:short actor:ref
SetFemale - changes the Female flag on the actor. Changes are saved but may not be immediately visible.
(nothing) reference.SetFemale flag:short actor:ref
SetLowLevelProcessing - turns low level processing on or off for the actor. Note that this sets the No Low Level Processing flag to the opposite of the passed value.
(nothing) reference.SetLowLevelProcessing flag:short actor:ref
SetNoPersuasion - changes the No Persuasion flag on the actor
(nothing) reference.SetNoPersuasion flag:short actor:ref
SetSummonable - changes the Summonable flag on the actor
(nothing) reference.SetSummonable flag:short actor:ref
SetPCLevelOffset - changes the PC Level Offset flag on the actor, and optionally specifies the minimum and maximum levels. If minLevel or maxLevel is omitted or passed as -1, the existing value will be retained. Note that changes to the min/max levels are not saved in the savegame.
(nothing) reference.SetPCLevelOffset flag:short minLevel:short maxLevel:short actor:ref
GetNumPackages - returns the number of AI packages in the actor's package list
(numPackages:short) reference.GetNumPackages actor:ref
GetNthPackage - returns the Nth AI package in the NPC's package list, in the order in which they were added in the editor.
(package:ref) reference.GetNthPackage actor:ref
GetSpellEffectiveness - returns the actor's spell effectiveness based on the armor he or she has equipped as a floating point value from 0 to 1.0. The return value is always 1.0 for creatures and NPCs other than the player. When called on the player, this command returns the player's base spell effectiveness as calculated by the game plus any script modifier applied by ModPCSpellEffectiveness.
(spellEffectiveness:float) reference.GetSpellEffectiveness
CanCastPower* - returns false if the calling actor has already used the specified greater power within the last 24 hours. This command does not check for the presence of the greater power in the actor's spellbook.
(CanCast:bool) ref.CanCastPower spell:ref
SetCanCastPower* - indicates whether the calling actor can cast the specified greater power. Passing 1 allows the actor to cast the power even if he has already used it within the past 24 hours. Passing 0 disallows the actor from casting the spell for the next 24 hours, unless the actor has already cast the power, in which case the power will become usable as normal 24 hours after the last casting.
(nothing) ref.SetCanCastPower spell:ref allowCasting:bool
SetPowerTimer* - sets the amount of time that must pass until the calling actor can cast the specified power. The time is a float representing the number of real-time seconds until the power becomes usable. When an actor uses a power, the game calculates the 24-hour timer as 3600 / TimeScale * 24 where TimeScale is a global variable representing the number of game-time miutes which elapse per real-tme minute. The timer value passed to this function should similarly take TimeScale into account. Passing a value of zero or less will cause the power to become usable the very next frame.
(nothing) ref.SetPowerTimer spell:ref timer:float
GetUsedPowers* - returns an Array containing information about all greater powers which the calling actor has used. This includes powers cast by the actor within the last 24 hours as well as any powers flagged as used by SetCanCastPower and SetPowerTimer. The return value is an Array of StringMaps:
GetUsedPowers[n]["power"] := ref: the greater power
GetUsedPowers[n]["timer"] := float: number of real-time seconds until the power becomes usable again
(powers:Array) ref.GetUsedPowers
Attacking
Types with this quality are used for attacks.
Values:
Attack Damage - long the base damage of the type; used in a forumla with the appropriate skill to determine damage actually done
Speed - float the speed factor of the type; used in a forumla to determine the rate of attack
Ignores Resistance flag - bool determines whether the type will ignore normal damage resistance.
Functions:
GetAttackDamage - returns the base attack damage
(damage:long) reference.GetAttackDamage objectID:ref
SetAttackDamage - sets the base attack damage
(nothing) reference.SetAttackDamage nuDamage:long objectID:ref
ModAttackDamage - modifies the base attack damage up or down
(nothing) reference.ModAttackDamage modifyBy:float objectID:ref
GetWeaponSpeed - returns the weapon speed
(speed:float) reference.GetWeaponSpeed objectID:ref
SetWeaponSpeed - sets the weapon speed
(nothing) reference.SetWeaponSpeed nuSpeed:float obejctID:ref
ModWeaponSpeed - modifies the weapon speed up or down
(nothing) reference.ModWeaponSpeed modifyBy:float obejctID:ref
GetIgnoresResistance - returns whether the object ignores normal damage resistance
(ignores:bool) reference.GetIgnoresResistance objectID:ref
SetIgnoresResistance - sets whether the object ignores normal damage resistance
(nothing) reference.SetIgnoresResistance shouldIgnore:bool objectID:ref
Audible
Types with this quality have one or more sounds associated with them.
Values:
Open Sound - ref the sound played upon opening. (Containers and Doors)
Close Sound - ref the sound played upon closing. (Containers and Doors)
Loop Sound - ref the looping sound associated with an object. (Doors, Lights, and Activators)
Functions:
GetOpenSound - Returns the "open" sound
(sound:ref) reference.GetOpenSound baseObject:ref
GetCloseSound - Returns the "close" sound
(sound:ref) reference.GetCloseSound baseObject:ref
GetLoopSound - Returns the looping sound
(sound:ref) reference.GetLoopSound baseObject:ref
SetOpenSound - Sets the "open" sound
(nothing) reference.SetOpenSound sound:ref baseObject:ref
SetCloseSound - Sets the "close" sound
(nothing) reference.SetCloseSound sound:ref baseObject:ref
SetLoopSound - Sets the looping sound
(nothing) reference.SetLoopSound sound:ref baseObject:ref
Breakable
Types with this quality can be broken.
Values:
Health - long the base health of the object. Cannot be negative.
Current Health - float the current health of the object. the object is damaged when the current value is less than the base object value and is broken when the current health reaches 0. The effectiveness of the object may be decreased as damage increases.
Functions:
GetObjectHealth - returns the base object health
(health:long) reference.GetObjectHealth objectID:ref
SetObjectHealth - sets the base object health
(nothing) reference.SetObjectHealth nuHealth:long objectID:ref
ModObjectHealth - modifies the base object health up or down
(nothing) reference.ModObjectHealth modifyBy:float objectID:ref
GetCurrentHealth - returns the current health of the calling reference
(health:float) reference.GetCurrentHealth
GetEquippedCurrentHealth - gets the current health of the object in the specified equipment slot
(health:float) reference.GetEquippedCurrentHealth slot:short
SetEquippedCurrentHealth - sets the current health of the object in the specified equipment slot
(nothing) reference.SetEquippedCurrentHealth nuHealth:long slot:short
ModEquippedCurrentHealth - modifies the current health of the object in the specified equipment slot up or down
(nothing) reference.ModEquippedCurrentHealth modifyBy:float slot:short
Class
Types with this quality have a player class.
Values:
Attributes - short the two attributes of the class
Skills - short the five major skills of the class
Specialization - short the specialization of the class
Functions:
GetClass - returns the class of the NPC
(class:ref) reference.GetClass npc:ref
GetClassAttribute - returns the Nth attribute of the class. If called on a reference it will attempt to find the class from that referenced NPC and use that.. If a class FormID is passed, that takes precedence.
(attribute:short) reference.GetClassAttribute whichAttribute:short class:ref
GetClassSkill - returns the Nth skill of the class. If called on a reference it will attempt to find the class from that referenced NPC and use that.. If a class FormID is passed, that takes precedence.
(skill:short) reference.GetClassSkill whichSkill:short class:ref
GetClassSpecialization - returns the class specialization. If called on a reference it will attempt to find the class from that referenced NPC and use that.. If a class FormID is passed, that takes precedence.
(specialization:short) reference.GetClassSpecialization class:ref
IsClassSkill - returns whether the passed skill is a skill of the class. If called on a reference it will attempt to find the class from that referenced NPC and use that.. If a class FormID is passed, that takes precedence.
(isClassSkill:bool) reference.IsClassSkill skill:short class:ref
(isClassSkill:bool) reference.IsMajor skill:short class:ref
IsClassAttribute - returns whether the passed attribute is an attribute of the class. If called on a reference it will attempt to find the class from that referenced NPC and use that.. If a class FormID is passed, that takes precedence. (available in v0011)
(isClassAttribute:bool) reference.IsClassAttribute attribute:short class:ref
Container
Something that holds inventory items.
Functions:
GetNumItems - returns the number of different object types in the container
(count:long) reference.GetNumItems
GetInventoryObject - returns the objectID of the Nth item type in the container
(objectID:ref) reference.GetInventoryObject whichObject:long
IsContainer - returns whether the reference or passed objectID is a container
(isContainer:bool) reference.IsContainer objectID:ref
GetContainerRespawns - returns whether the container's contents repawn
(respawns:bool) reference.GetContainerRespawns objectID:ref
(respawns:bool) reference.IsUnsafeRespawns objectID:ref
SetContainerRespawns - sets whether the container's contents respawn. Note - this change is not persisted in the save game.
(nothing) reference.SetContainerRespawns respawns:bool objectID:ref
(nothing) reference.SetUnsafeContainer respawns:bool objectID:ref
GetItems* - returns an Array containing all of the items in a container's or actor's inventory. Up to 10 form types may be passed in to restrict the returned items to only include items matching those type(s).
(items:Array) reference.GetItems type1:short type2:short ... type10:short
GetBaseItems* - returns an Array of StringMaps containing the items present in a base container or actor inventory and the quantity of each. These are the items added to the base object in the editor and may include leveled items. Some, all, or none of the items may be present in the inventory of a specific reference to the base object. Each element of the returned Array is a StringMap with two elements:
"item" : (ref) the item
"count" : (short) the quantity of this item
(items:Array) reference.GetBaseItems baseContainer:ref
Values are accessed like:
array_var baseItems
let baseItems := someChestRef.GetBaseItems
Print "First item: " + (GetName baseItems[0][item] + " Quanitity: " + ToString baseItems[0][count]
Edible
Types with this quality may be considered food.
Values:
Is Food flag - bool is the object considered to be food
Functions:
IsFood - returns whether the object is considered to be food
(isFood:bool) reference.IsFood objectID:ref
SetIsFood - sets whether the object is considered to be food
(nothing) reference.IsFood isFood:bool objectID:ref
Enchantable
Types with this quality may be enchanted. A couple notes: Enchantments and the ranges of their effects need to be appropriate for the enchantable object's type. The Enchantment Type needs to match the object the enchantment applies to. Also, when adding an enchantment to an object, be sure that the object has a charge, or the enchantment cannot work. If the object was not previously enchanted, call SetObjectCharge to assign a charge to the object.
Values:
Enchantment - ref the specific enchantment on the enchantable item
Charge - long the maximum charge available on the enchantable item
Current Charge - float the current charge of the enchantable item
Functions:
GetEnchantment - returns the specific enchantment on the object
(enchantment:ref) reference.GetEnchantment objectID:ref
SetEnchantment - sets the specific enchantment on the object and returns any previous enchantment
(oldEnchantment:ref) reference.SetEnchantment nuEnchantment:ref objectID:ref
RemoveEnchantment - removes the enchantment from the object and returns any previous enchantment
(oldEnchantment:ref) reference.RemoveEnchantment objectID:ref
GetObjectCharge - returns the max charge of the object
(charge:long) reference.GetObjectCharge objectID:ref
SetObjectCharge - sets the max charge of the object
(nothing) refernce.SetObjectCharge nuCharge:long objectID:ref
ModObjectCharge - modifies the max charge of the object up or down
(nothing) reference.ModObjectCharge modifyBy:float objectID:ref
GetCurrentCharge - returns the current charge of the calling reference
(charge:float) reference.GetCurrentCharge
GetEquippedCurrentCharge - returns the current charge of the object in the specified slot
(charge:float) reference.GetEquippedCurrentCharge slot:short
SetEquippedCurrentCharge - sets the current charge of the object in the specified slot
(nothing) reference.SetEquippedCurrentCharge nuCharge:long slot:short
ModEquippedCurrentCharge - modifies the current charge of the object in the specified slot up or down
(nothing) reference.ModEquippedCurrentCharge modifyBy:float slot:short
Equippable
Types with this quality can be equipped by a character.
Values:
Slot - short the equipment slot of the object
Functions:
GetEquipmentSlot - returns the equipment slot of the object
(slot:short) reference.GetEquipmentSlot objectID:ref
GetEquippedObject
Inventory
Types with this quality are objects that can be either stored in an inventory or exist as a reference outside of an inventory.
Values:
Object - long the base object id of a reference
Weapon Type- short the type of weapon
Weight - float the weight of one object of this type
Gold Value - long the gold value of one object of this type. this value may not match the value displayed in the interface as that could include additional value from an enchantment.
Is Quest Item flag - bool whether the type is a quest item. quest items cannot be activated and cannot be dropped.
Functions:
GetBaseObject - returns the base object of the reference
(objectID:ref) reference.GetBaseObject
GetObjectType - returns a type code for each type of object
(type:long) reference.GetObjectType objectID:ref
IsWeapon - returns whether the object is a weapon
(isWeapon:bool) reference.IsWeapon objectID:ref
IsAmmo - returns whether the object is ammunition
(isAmmo:bool) reference.IsAmmo objectID:ref
IsArmor - returns whether the object is armor
(isArmor:bool) reference.IsArmor objectID:ref
IsBook - returns whether the object is a book
(isBook:bool) reference.IsBook objectID:ref
IsClothing - returns whether the object is clothing
(isClothing:bool) reference.IsClothing objectID:ref
IsIngredient - returns whether the object is an ingredient
(isIngredient:bool) reference.IsIngredient objectID:ref
IsKey - returns whether the object is a key
(isKey:bool) reference.IsKey objectID:ref
IsAlchemyItem - returns whether the object is an alchemy item
(isAlchemyItem:bool) reference.IsAlchemyItem objectID:ref
IsApparatus - returns whether the object is an alchemy apparatus
(isApparatus:bool) reference.IsApparatus objectID:ref
IsSoulGem - returns whether the object is a soul gem
(isSoulGem:bool) reference.IsSoulGem objectID:ref
IsSigilStone - returns whether the object is a sigil stone
(isSigilStone:bool) reference.IsSigilStone objectID:ref
IsLight - returns whether the object is a light source
(isLight:bool) reference.IsLight objectID:ref
IsFlora - returns 1 if the object is a harvestable plant.
(isFlora:bool) reference.IsFlora objectID:ref
GetWeight - returns the weight of the type
(weight:float) reference.GetWeight objectID:ref
SetWeight - sets the weight of the type
(nothing) reference.SetWeight nuWeight:float objectID:ref
ModWeight - modifies the weight of the type up or down
(nothing) reference.ModWeight modifyBy:float objectID:ref
GetGoldValue - returns the base gold value of the type
(goldValue:long) reference.GetGoldValue objectID:ref
GetFullGoldValue - returns the full gold value of an item, including the value added by enchantments.
(goldValue:long) reference.GetFullGoldValue objectID:ref
SetGoldValue - sets the base gold value of the type
(nothing) reference.SetGoldValue nuGoldValue:long objectID:ref
ModGoldValue - modifies the base gold value of the type up or down
(nothing) reference.ModGoldValue modifyBy:float objectID:ref
IsQuestItem - returns whether the type is a quest item
(isQuestItem:bool) reference.IsQuestItem objectID:ref
SetQuestItem - sets whether the type is a quest item
(nothing) reference.SetQuestItem isQuestItem:bool objectID:ref
SetCurrentSoulLevel - sets the current soul level of the calling soulgem reference.
(nothing) reference.SetCurrentSoulLevel newLevel:short
Lockable
Types with this quality can be locked.
Functions:
GetOpenKey - returns the key used to unlock the calling reference.
(key:ref) reference.GetOpenKey
SetOpenKey - sets the key used to unlock the reference to the specified key.
(nothing) reference.SetOpenKey key:ref
Magic
Types with this quality have a group of magical effects
Values:
Magic Item Type - short the type of magic item (Spell, Enchantment, AlchemyItem, Ingredient)
Effect Count - long the number of magic effect items in the type
IsAutocalc - bool whether the cost is autocalculated or set to a specific amount
EffectItem Code - long the magic effect code for the effect item
EffectItem Magnitude - long the magnitude of the magic effect item
EffectItem Area - long the area affected by the magic effect item
EffectItem Duration - long the time in seconds the magic effect lasts
EffectItem Range - short the range of the effect (Self, Touch, Target)
EffectItem Actor Value - long a code for the attribute or skill affected by the effect item
EffectItemScripted - bool whether the effect item is a ScriptEffect (SEFF)
EffectItemScript - refID the refID of the script used by the scripted effect item
EffectItemScriptVisualEffect - long the magic effect code used for the visual effects of the scripted effect item
EffectItemScriptSchool - short the magic school assigned to the scripted effect
EffectItemScriptIsHostile - bool whether the scripted effect is hostile
Functions:
GetMagicItemType - returns the magic item type
(magicItemType:short) GetMagicItemType magicItem:ref
(magicItemType:short) GetMIType magicItem:ref
GetMagicItemEffectCount - returns the number of magic effect items
(count:long) GetMagicItemEffectCount magicItem:ref
(count:long) GetMIEffectCount magicItem:ref
MagicItemHasEffect - returns whether the magic item has an effect item with the specifed effect. Uses the 4 letter codes for the magic effects listed in the CS. Uses an optional actor value name for use with effects like fortify skill and fortify attribute.
(hasEffect:bool) MagicItemHasEffect effect:chars actorValue:chars
(hasEffect:bool) MagicHasEffect effect:chars actorValue:chars
MagicItemHasEffectCode - returns whether the magic item has an effect item with the specified effect code. Uses a long value returned from GetNthEffectItemCode or GetMagicEffectCode. Uses an optional actor value code for use with effects like fortify skill and fortify attribute.
(hasEffect:bool) MagicItemHasEffectCode effectCode:long actorValueCode:short
(hasEffect:bool) MagicHasEffectC effectCode:long actorValueCode:short
MagicItemHasEffectCount - returns the count of the specified effects on the magic item. Has an optional actorValue name for use with effects like fortify skill and fortify attribute.
(effectCount:short) MagicItemHasEffectCount effect:chars actorValueName:chars
MagicItemHasEffectCountCode - returns the count of effects with the specified effect code on the magic item. Uses a long value returned from GetNthEffectItemCode or GetMagicEffectCode. Has an optional actorValueCode for use with effects like fortify skill and fortify attribute.
(effectCount:short) MagicItemHasEffectCountCode effectCode:long actorValueCode:short
(effectCount:short) MagicItemHasEffectCountC effectCode:long actorValueCode:short
GetNthEffectItemCode - returns the magic effect code of the specified effect item
(code:long) GetNthEffectItemCode magicItem:ref whichEffect:short
(code:long) GetNthEICode magicItem:ref whichEffect:short
GetNthEffectItemMagnitude - returns the magnitude of the specified effect item
(magnitude:long) GetNthEffectItemMagnitude magicItem:ref whichEffect:short
(magnitude:long) GetNthEIMagnitude magicItem:ref whichEffect:short
SetNthEffectItemMagnitude - sets the magnitude of the specified effect item
(nothing) SetNthEffectItemMagnitude nuMagnitude:long magicItem:ref whichEffect:short
(nothing) SetNthEIMagnitude nuMagnitude:long magicItem:ref whichEffect:short
ModNthEffectItemMagnitude - modifies the magnitude of the specified effect item up or down
(nothing) ModNthEffectItemMagnitude modifyBy:float magicItem:ref whichEffect:short
(nothing) ModNthEIMagnitude modifyBy:float magicItem:ref whichEffect:short
GetNthEffectItemArea - returns the area of the specified effect item
(area:long) GetNthEffectItemArea magicItem:ref whichEffect:short
(area:long) GetNthEIArea magicItem:ref whichEffect:short
SetNthEffectItemArea - sets the area of the specified effect item
(nothing) SetNthEffectItemArea nuArea:long magicItem:ref whichEffect:short
(nothing) SetNthEIArea nuArea:long magicItem:ref whichEffect:short
ModNthEffectItemArea - modifies the effect area of the specified effect item up or down
(nothing) ModNthEffectItemArea modifyBy:float magicItem:ref whichEffect:short
(nothing) ModNthEIArea modifyBy:float magicItem:ref whichEffect:short
GetNthEffectItemDuration - returns the duration of the specified effect item
(duration:long) GetNthEffectItemDuration magicItem:ref whichEffect:short
(duration:long) GetNthEIDuration magicItem:ref whichEffect:short
SetNthEffectItemDuration - sets the duration of the specified effect item
(nothing) SetNthEffectItemDuration nuDuration:long magicItem:ref whichEffect:short
(nothing) SetNthEIDuration nuDuration:long magicItem:ref whichEffect:short
ModNthEffectItemDuration - modifies the duration of the specified effect item up or down
(nothing) ModNthEffectItemDuration modifyBy:float magicItem:ref whichEffect:short
(nothing) ModNthEIDuration modifyBy:float magicItem:ref whichEffect:short
GetNthEffectItemRange - gets the range of the specified effect item
(range:short) GetNthEffectItemrange magicItem:ref whichEffect:short
(range:short) GetNthEIRange magicItem:ref whichEffect:short
SetNthEffectItemRange - sets the range of the specified effect item
(nothing) SetNthEffectItemRange nuRange:short magicItem:ref whichEffect:short
(nothing) SetNthEIRange nuRange:short magicItem:ref whichEffect:short
GetNthEffectItemActorValue - gets the actor value of the specified effect item
(actorValueCode:long) GetNthEffectItemActorValue magicItem:ref whichEffect:short
(actorValueCode:long) GetNthEIAV magicItem:ref whichEffect:short
SetNthEffectItemActorValue - sets the actor values of the specified effect item
(nothing) SetNthEffectItemActorValue nuActorValue:long magicItem:ref whichEffect:short
(nothing) SetNthEIAV nuActorValue:long magicItem:ref whichEffect:short
RemoveNthEffectItem - removes the specified effect item
(nothing) RemoveNthEffectItem magicItem:ref whichEffect:short
(nothing) RemoveNthEffect magicItem:ref whichEffect:short
RemoveAllEffectItems - removes all effect items from the magic item
(nothing) RemoveAllEffectItems magicItem:ref
CopyNthEffectItem - copies the specified effect item from one magic item to another
(index:short) CopyNthEffectItem fromObjectID:ref toObjectID:ref whichEffect:short
CopyAllEffectItems - copies all effect items from one magic item to another
(nothing) CopyAllEffectItems fromObjectID:ref toObjectId:ref
AddEffectItem - adds a basic, empty EffectItem of the specified MagicEffect to the magic item
(index:short) AddEffectItem nuEffect:chars magicItem:ref
(index:short) AddEffectItemC nuEffectCode:long magicItem:ref
AddFullEffectItem - adds a fully defined EffectItem to the magic item with the specified MagicEffect, magnitude, area, duration and range
(index:short) AddFullEffectItem nuEffect:chars magnitude:long area:long duration:long range:short magicItem:ref
(index:short) AddFullEffectItemC nuEffectCode:long magnitude:long area:long duration:long range:short magicItem:ref
IsMagicItemAutoCalc - returns 1 if the MagicItem determines magicka cost by autocalculation. Now works on all Magic Items (spells, alchemy, ingredients, enchantments)
(isAutocalc:bool) IsMagicItemAutoCalc magicItem:ref
SetMagicItemAutoCalc - sets whether the Magic Item determines cost by autocalculation. Currently works for Spells, AlchemyItems, Ingredients and Enchantments.
(nothing) SetMagicItemAutoCalc isAutocalc:bool objectID:ref
IsNthEffectItemScripted - returns whether the specified effect item is scripted
(isScriptEffect:bool) IsNthEffectItemScripted magicItem:ref whichEffect:short
GetNthEffectItemScript - returns the refID of the script associated with the specified scripted effect
(script:ref) GetNthEffectItemScript objectID:ref whichEffect:short
(script:ref) GetNthEIScript objectID:ref whichEffect:short
SetNthEffectItemScript - sets the script for the specified scripted effect item. Note that the CS doesn't have a variable type for a script, so you must assign the script editor id to a ref variable to use this function.
(nothing) SetNthEffectItemScript scriptObjectID:ref magicItem:ref whichEffect:short
(nothing) SetNthEIScript scriptObjectID:ref magicItem:ref whichEffect:short
GetNthEffectItemScriptVisualEffect - returns the magic effect code for the scripted effect item's visual effect
(magicEffectCode:long) GetNthEffectItemScriptVisualEffect magicItem:ref whichEffect:short
(magicEffectCode:long) GetNthEISVisualEffect magicItem:ref whichEffect:short
SetNthEffectItemScriptVisualEffect - sets the scrited effect item's visual effect
(nothing) SetNthEffectItemScriptVisualEffect magicEffect:chars magicItem:ref whichEffect:short
(nothing) SetNthEISVisualEffect magicEffect:chars magicItem:ref whichEffect:short
(nothing) SetNthEffectItemScriptVisualEffectC magicEffectCode:long magicItem:ref whichEffect:short
(nothing) SetNthEISVisualEffectC magicEffectCode:long magicItem:ref whichEffect:short
GetNthEffectItemScriptSchool - returns the school of the scripted effect item
(magicSchool:short) GetNthEffectItemScriptSchool magicItem:ref whichEffect:short
(magicSchool:short) GetNthEISSchool magicItem:ref whichEffect:short
SetNthEffectItemScriptSchool - sets the school of the scripted effect item
(nothing) SetNthEffectItemScriptSchool magicItem:ref whichEffect:short
(nothing) SetNthEISSchool magicItem:ref whichEffect:short
IsNthEffectItemScriptHostile - returns whether the scripted effect is hostile
(isHostile:bool) IsNthEffectItemScriptHostile magicItem:ref whichEffect:short
(isHostile:bool) IsNthEISHostile magicItem:ref whichEffect:short
SetNthEffectItemScriptHostile - sets whether the scripted effect is hostile
(nothing) SetNthEffectItemScriptHostile magicItem:ref whichEffect:short
(nothing) SetNthEISHostile magicItem:ref whichEffect:short
GetNthEffectItemScriptName - returns the name of the nth effect item, provided that effect item is a script effect.
(name:string_var) GetNthEffectItemScriptName whichEffect:short
SetNthEffectItemScriptName - sets the name of the scripted effect
(nothing) SetNthEffectItemScriptName name:string magicItem:ref whichEffect:short
(nothing) SetNthEISName name:string magicItem:ref whichEffect:short
SetNthEffectItemScriptNameEX - sets the name of the scripted effect
(nothing) SetNthEffectItemScriptNameEX name:formatString magicItem:ref whichEffect:short
ModNthEffectItemScriptName - modifies the name of the scripted effect. The toReplaceAndReplaceWith string has the following format: "toReplace|replaceWith". We will do a case insensitve search for the toReplace portion and if found will replace it with the replaceWith portion. The | character is used to separate the portions of the string. If there is nothing before the | character, the replaceWith string is prepended to the name. If called from the console, use @ instead of |.
(nothing) ModNthEffectItemScriptName toReplaceAndReplaceWith:string magicItem:ref whichEffect:short
(nothing) ModNthEISName toReplaceAndReplaceWith:string magicItem:ref whichEffect:short
MagicItemHasEffectItemScript - returns 1 if the magic effect has a scripted item with the specified script.
(hasScript:bool) MagicItemHasEffectItemScript script:ref magicItem:ref
GetNthEffectItemName* - returns the name of the specified active effect, i.e. "Fortify Strength".
(name:string_var) GetNthEffectItemName magicItem:ref whichEffect:short
(name:string_var) GetNthEIName magicItem:ref whichEffect:short
Magic Target
Types with this quality can be the target of magic. They can have Active Effects working on them.
Values:
Count - long the number of active effects on the target
ActiveEffect Code - long the effect code of the given ActiveEffect
ActiveEffect Magnitude -long the magnitude of the given ActiveEffect
ActiveEffect Duration - float the duration of the total ActiveEffect
ActiveEffect TimeElapsed - float the time in seconds since the ActiveEffect was applied to the target
ActiveEffect MagicItem - ref the magic item which applied the ActiveEffect
ActiveEffect Caster - ref the caster of the ActiveEffect
ActiveEffect Data - ref the extra data (summoned creature, armor, etc.) of the ActiveEffect
ActiveEffect MagicItemIndex - long the index of the EffectItem on the magic item which applied the ActiveEffect
Functions:
GetActiveEffectCount - returns the number of ActiveEffects on the target
(count:long) reference.GetActiveEffectCount
GetNthActiveEffectCode - returns the effect of the Nth ActiveEffect on the target
(effectCode:long) reference.GetNthActiveEffectCode whichEffect:long
(effectCode:long) reference.GetNthAECode whichEffect:long
GetNthActiveEffectMagnitude - returns the magnitude of the Nth ActiveEffect on the target
(magnitude:long) reference.GetNthActiveEffectMagnitude whichEffect:long
(magnitude:long) reference.GetNthAEMagnitude whichEffect:long
GetNthActiveEffectDuration - returns the total duration of the Nth ActiveEffect on the target
(duration:float) reference.GetNthActiveEffectDuration whichEffect:long
(duration:float) reference.GetNthAEDuration whichEffect:long
GetNthActiveEffectTimeElapsed - returns the time that the Nth ActiveEffect has been applied to the target
(timeElapsed:float) reference.GetNthActiveEffectTimeElapsed whichEffect:long
(timeElapsed:float) reference.GetNthAETime whichEffect:long
GetNthActiveEffectMagicItem - returns the magic item which applied theNth ActiveEffect to the target
(magicItem:ref) reference.GetNthActiveEffectMagicItem whichEffect:long
(magicItem:ref) reference.GetNthAEMagicItem whichEffect:long
GetNthActiveEffectCaster - return the caster of the Nth ActiveEffect on the target
(caster:ref) reference.GetNthActiveEffectCaster whichEffect:long
(caster:ref) reference.GetNthAECaster whichEffect:long
GetNthActiveEffectData - return the data of the NthActiveEffect on the target
(data:ref) reference.GetNthActiveEffectData whichEffect:long
(data:ref) reference.GetNthAEData whichEffect:long
GetNthActiveEffectMagicItemIndex - returns the index on its magic item of the Nth ActiveEffect on the target
(index:long) reference.GetNthActiveEffectMagicItemIndex whichEffect:long
(index:long) reference.GetNthActiveEffectMagicItemIndex whichEffect:long
SetNthActiveEffectMagnitude - sets the magnitude of the corresponding ActiveEffect
(nothing) SetNthActiveEffectMagnitude magnitude:float whichEffect:long
(nothing) SetNthAEMagnitude magnitude:float whichEffect:long
ModNthActiveEffectMagnitude - modifies the magnitude of the corresponding ActiveEffect
(nothing) ModNthActiveEffectMagnitude magnitude:float whichEffect:long
(nothing) ModNthAEMagnitude magnitude:float whichEffect:long
GetTotalActiveEffectMagnitude - returns the total magnitude of all ActiveEffects with a given code on the target
(totalMag:long) reference.GetTotalActiveEffectMagnitude effectCode:chars actorValue:chars
(totalMag:long) reference.GetTotalAEMagnitude effectCode:chars actorValue:chars
(totalMag:long) reference.GetTotalActiveEffectMagnitudeC effectCode:long actorValueCode:short
(totalMag:long) reference.GetTotalAEMagnitudeC effectCode:long actorValueCode:short
GetTotalAENonAbilityMagnitude - returns the total magnitude of all non-ability ActiveEffects with a given code on the target
(totalMag:long) reference.GetTotalAENonAbilityMagnitude effectCode:chars actorValue:chars
(totalMag:long) reference.GetTotalAENonAbilityMagnitudeC effectCode:long actorValueCode:short
GetTotalAEAbilityMagnitude - returns the total magnitude of all ability ActiveEffects with a given code on the target
(totalMag:long) reference.GetTotalAEAbilityMagnitude effectCode:chars actorValue:chars
(totalMag:long) reference.GetTotalAEAbilityMagnitudeC effectCode:long actorValueCode:short
GetTotalAESpellMagnitude - returns the total magniude of all spell ActiveEffects with a given code on the target
(totalMag:long) reference.GetTotalAESpellMagnitude effectCode:chars actorValue:chars
(totalMag:long) reference.GetTotalAESpellMagnitudeC effectCode:long actorValueCode:short
GetTotalAEDiseaseMagnitude - returns the total magnitude of all disease ActiveEffects with a given code on the target.
(totalMag:long) reference.GetTotalAEDiseaseMagnitude effectCode:chars actorValue:chars
(totalMag:long) reference.GetTotalAEDiseaseMagnitudeC effectCode:long actorValueCode:short
GetTotalAELesserPowerMagnitude - returns the total magnitude of all lesser power ActiveEffects with a given code on the target
(totalMag:long) reference.GetTotalAELesserPowerMagnitude effectCode:chars actorValue:chars
(totalMag:long) reference.GetTotalAELesserPowerMagnitudeC effectCode:long actorValueCode:short
GetTotalAEPowerMagnitude - retuns the total magnidue of all greater power ActiveEffects with a given code on the target
(totalMag:long) reference.GetTotalAEPowerMagnitude effectCode:chars actorValue:chars
(totalMag:long) reference.GetTotalAEPowerMagnitudeC effectCode:long actorValueCode:short
GetTotalAEAllSpellsMagnitude - returns the total magnitude of all spells (Spell, Ability, Disease, Lesser Power, Power) with a given code on the target.
(totalMag:long) reference.GetTotalAEAllSpellsMagnitude effectCode:chars actorValue:chars
(totalMag:long) reference.GetTotalAEAllSpellsMagnitudeC effectCode:long actorValueCode:short
GetTotalAEEnchantmentMagnitude - retuns the total magnitude of all enchantments with a given code on the target.
(totalMag:long) reference.GetTotalAEEnchantmentMagnitude effectCode:chars actorValue:chars
(totalMag:long) reference.GetTotalAEEnchantmentMagnitudeC effectCode:long actorValueCode:short
GetTotalAEAlchemyMagnitude - returns the total magnitude of all potions with a given code on the target.
(totalMag:long) reference.GetTotalAEAlchemyMagnitude effectCode:chars actorValue:chars
(totalMag:long) reference.GetTotalAEAlchemyMagnitudeC effectCode:long actorValueCode:short
GetScriptActiveEffectIndex - returns the index of the corresponding ActiveEffect for the running script effect. Note this cannot detect the difference between two active effects running with the same script.
(index:long) GetScriptActiveEffectIndex
DispelNthActiveEffect* - dispels the effects of the specified active effect and removes it from the actor's active effect list. Note that the effect will not be removed until the next gamemode frame, so the indexes into an actor's effect list do not change immediately.
(effectWasRemoved:bool) reference.DispelNthActiveEffect whichEffect:short
(effectWasRemoved:bool) reference.DispelNthAE whichEffect:short
Named
Types with this quality have a setable name
Values:
Name - string the display name of the type
Functions:
SetName - sets the display name of the type. SetName is a special function. It is defined to work on Inventory items, but it can be used with any form. To use with a non-Inventory item you must first assign the objectID to a ref. For most forms the name is part of the base form and changing the name will change it for all instances of the type.
(nothing) reference.SetName name:string objectID:ref
GetName - returns the name of an object.
(name:string_var) reference.GetName object:ref
CompareName - returns 1 if stringToFindInName is found in the name if the object
(nameContainsString) reference.CompareName toFindInName:string objectID:ref
(nameContainsString) reference.NameIncludes toFindInName:string objectID:ref
CompareNames - compares the names of two objects and returns -1 if the first occurs alphabetically before the second, 1 if the first occurs after the second, or 0 for equality. Comparison is case-insensitive.
(comparison:short) reference.CompareNames compareTo:ref compare:ref
CopyName - copies the name from the source to the target. It is defined to work on Inventory items, but it can be used with any form. To use with a non-Inventory item you must first assign the objectID to a ref. For most forms the name is part of the base form and changing the name will change it for all instances of the type.
(nothing) CopyName srcObjectID:ref targetObjectID:ref
ModName - modifies the name of the calling reference or passed objectID. The toReplaceAndReplaceWith string has the following format: "toReplace|replaceWith". We will do a case insensitve search for the toReplace portion and if found will replace it with the replaceWith portion. The | character is used to separate the portions of the string. If there is nothing before the | character, the replaceWith string is prepended to the name. In the console, use @ instead of |.
(nothing) reference.ModName toReplaceAndReplaceWith:string toObject:ref
AppendToName - appends the passed string to the end of the name of the calling reference or passed objectID.
(nothing) reference.AppendToName toAppend:string toObject:ref
HasName - returns 1 if the object has a name consisting of at least one character.
(hasName:bool) reference.HasName objectID:ref
SetNameEx - sets the name of the base object. The new name is a string constructed from a format string using the same format specifiers used by OBSE's output functions. Unlike SetName, SetNameEx cannot be called on a reference.
(nothing) reference.SetNameEx formatString:string var1 var2 ... var20 object:ref
Ownable
Types with this quality can be owned by an NPC or faction.
Values:
Owner - NPC or faction the owner of the reference.
Required Rank - short the rank a member of the owning faction must hold in order to legally activate the reference.
Global Variable - global a global variable which, when set to a value other than zero, allows legal activation of the reference.
Functions:
GetOwner - returns the NPC or faction which owns the calling reference.
(owner:ref) reference.GetOwner
GetParentCellOwner - returns the NPC or faction which owns the calling reference's parent cell..
(owner:ref) reference.GetParentCellOwner
GetOwningFactionRequiredRank - returns the rank in the owning faction required to legally activate the calling reference.
(rank:short) reference.GetOwningFactionRequiredRank
(rank:short) reference.GetOwningFactionRank
GetParentCellOwningFactionRequiredRank - returns the rank required for ownership of the calling reference's parent cell.
(rank:short) reference.GetParentCellOwningFactionRequiredRank
(rank:short) reference.GetCellFactionRank
IsOffLimits - returns 1 if it is illegal for the specified actor to activate the calling reference, based on the calling reference's ownership.
(isOffLimits:bool) reference.IsOffLimits actor:ref
Race
Values:
Base Attribute - each sex of a race has base values for all eight attributes
Bonus Skill - each race has seven attributes which get a bonus
Name - each race has a name
Functions:
GetRaceAttribute - returns the specified base attribute value. If passes a raceFormID you must also pass whether you want the female value or not. If called directly on an reference the function will determine the race and sex of the reference and the raceFormID and isFemale are not needed. The C version of the function takes a number rather than the actorvalue name (0 instead of Strength)
(value:short) reference.GetRaceAttribute attributeActorValue:chars raceFormID:ref isFemale:bool
(value:short) reference.GetRaceAttributeC attributeActorValueCode:short raceFormID:ref isFemale:bool
GetRaceSkillBonus - returns the bonus for the specified skill for the race. If called on a reference the function will determine the race of the reference. Returns 0 if there is no bonus for that skill. The C version specifies the specific skill by number rather than by name.
(value:short) reference.GetRaceSkillBonus skillActorValue:chars raceFormID:ref
(value:short) reference.GetRaceSkillBonusC skillActorValueCode:short raceFormID:ref
IsRaceBonusSkill - returns whether the specified skill is a bonus for the race. If called on a reference the function will determine the race of the reference. The C version specifies the skill by number rather than by name.
(isBonusSkill:bool) reference.IsRaceBonusSkill skillActorValue:chars raceFormID:ref
(isBonusSkill:bool) reference.IsRaceBonusSkillC skillActorValue:short raceFormID:ref
GetNthRaceBonusSkill - returns the actor value code for the specified index into the bonus skills. Can be followed up with a call to GetRaceSkillBonusC to determine the actual bonus to the skill. If called on a reference the function will determine the race of the reference.
(skill:short) reference.GetNthRaceBonusSkill whichSkill:short raceFormID:ref
GetRaceSpellCount - returns the number of spells provided by the race. If no race is specified, the race of the calling NPC is used.
(numSpells:short) reference.GetRaceSpellCount race:ref
GetNthRaceSpell - returns the nth spell provided by the race, using the race of the calling NPC if none is specified.
(spell:ref) reference.GetNthRaceSpell whichSpell:short race:ref
SetRaceAlias - creates an alias for a race. If a race has an alias, then calling GetIsRace aliasRace will return true for any actor of that race. For example, SetRaceAlias Nord Argonian will cause GetIsRace to recognize Nords as Argonians. However, Argonians will not be recognized as Nords.
(nothing) SetRaceAlias actualRace:ref aliasRace:ref
SetRaceVoice - changes the voice of a race to the specified race. Specify 0 for male, 1 for female, or 2 for both genders.
(nothing) SetRaceVoice actualRace:ref voiceRace:ref whichGender:short
SetRacePlayable - flags a race as playable or unplayable. Unplayable races cannot speak most of the dialog defined in the game.
(nothing) SetRacePlayable race:ref isPlayable:bool
IsRacePlayable* - returns 1 if the specified race is flagged as playable in the editor.
(isPlayable:bool) IsRacePlayable race:ref
Scriptable
Types with this quality can have a script associated with them.
Functions:
IsScripted - returns whether the scriptable object has a script attached to it or not
(isScripted:bool) reference.IsScripted targetObjectID:ref
GetScript - returns the refID of the script attached to the object
(script:refID) reference.GetScript targetObjectID:ref
RemoveScript - removes and returns the script attached to the object. The object is no longer scripted
(script:refID) reference.RemoveScript targetObjectID:ref
SetScript - sets the specified script onto the calling object and returns any previous script. Note that Oblivion doesn't have a script variable type so you must assign the script to a ref variable for this to work. This function is currently considered a Beta function which will get official support after it gets some more testing. For now, please do not use in a shipping mod until further testing is done.
(script:refID) reference.SetScript scriptID:ref targetObjectID:ref
IsFormValid - returns 1 if the specified ref variable contains a valid object or reference.
(valid:bool) IsFormValid refVar:var
IsReference - returns 1 if the specified ref variable contains a reference, as opposed to a base object.
(isReference:bool) IsReference refVar:var
HasVariable - returns 1 if the calling reference or specified quest has a variable with the specified name.
(hasVariable:bool) reference.HasVariable varName:string questID:ref
GetVariable - returns the value of a numeric variable by name, either from the calling reference's script or the specified quest.
(variableValue:float) reference.GetVariable varName:string questID:ref
GetRefVariable - returns the reference stored in a ref variable by name, either from the calling reference's script or the specified quest.
(reference:ref) reference.GetRefVariable varName:string questID:ref
CompareScripts - compares the compiled code of two scripts and returns 1 if they are identical. Note that this doesn't mean the text of the scripts are identical, only that they call the same functions in the same order with the same parameters.
(scriptsAreIdentical:bool) CompareScripts script:ref script:ref
ResetAllVariables - sets all variables in the calling script to zero.
(numVars:short) ResetAllVariables
GetNumExplicitRefs - returns the number of explicit references in the calling object's script or in the passed script object. Explicit references are any objects mentioned by name in the script; for instance, if a script contains an "OnHit Player" block or a "Player.AddItem" command, its explicit references will include the player.
(numRefs:short) reference.GetNumExplicitRefs script:ref
GetNthExplicitRef - returns the nth explicit ref in the calling object's script or the passed script object. See GetNumExplicitRefs are a description of explicit references.
(object:ref) reference.GetNthExplicitRef index:short script:ref
Simple
Types with this quality have a single model path and a single icon texture
Values:
Model Path - string the path to the NIF model for the type
Icon Path - string the path to the DDS icon texture for the type
Functions:
SetModelPath - sets the model path for the type
(nothing) reference.SetModelPath modelPath:string objectID:ref
GetModelPath - returns the model path for the object.
(path:string_var) reference.GetModelPath object:ref
SetIconPath - sets the icon path for the type
(nothing) reference.SetIconPath iconPath:string objectID:ref
GetIconPath - returns the icon path for the object.
(path:string_var) reference.GetIconPath object:Ref
CompareModelPath - returns whether the passed string is part of the model path. This is a case insensitive search.
(found:bool) reference.CompareModelPath toFind:string objectID:ref
(found:bool) reference.ModelPathIncludes toFind:string objectID:ref
CompareIconPath - returns whether the passed string is part of the icon path. This is a case insensitive search.
(found:bool) reference.CompareIconPath toFind:string objectID:ref
(found:bool) reference.IconPathIncludes toFind:string objectID:ref
CopyModelPath - sets the model path of the calling reference or passed objectID to the model path of fromObject
(nothing) reference.CopyModelPath fromObject:ref toObject:ref
CopyIconPath - sets the icon path of the calling reference or passed objectID to the icon path of fromObject
(nothing) reference.CopyIconPath fromObject:ref toObject:ref
ModModelPath - modifies the model path of the calling reference or passed objectID. The toReplaceAndReplaceWith string has the following format: "toReplace|replaceWith". We will do a case insensitve search for the toReplace portion and if found will replace it with the replaceWith portion. The | character is used to separate the portions of the string. If there is nothing before the | character, the replaceWith string is prepended to the model path. In the console, use @ instead of |.
(nothing) reference.ModModelPath toReplaceAndReplaceWith:string toObject:ref
ModIconPath - modifies the icon path of the calling reference or passed objectID. The toReplaceAndReplaceWith string has the following format: "toReplace|replaceWith". We will do a case insensitve search for the toReplace portion and if found will replace it with the replaceWith portion. The | character is used to separate the portions of the string. If there is nothing before the | character, the replaceWith string is prepended to the icon path. In the console, use @ instead of |.
(nothing) reference.ModIconPath toReplaceAndReplaceWith:string toObject:ref
IsModelPathValid - returns 1 if the model path for the object exists in the user's Data folder or within one of the BSA archives.
(isPathValid:bool) reference.IsModelPathValid object:ref
IsIconPathValid - returns 1 if the icon path for the object exists in the user's Data folder or within one of the BSA archives.
(isPathValid:bool) reference.IsIconPathValid object:ref
Wearable
Types with this quality can be worn by actors and can have different models and textures for males and females
Values
Slot - short the equipment slot or slots taken by the object
Male Model Path - string the path to the NIF file for the male or only model while worn
Female Model Path - string the path to the NIF file for the female model while worn
Male Ground Path - string the path to the NIF for the male or only model when dropped
Female Ground Path - string the path to the NIF for the female model when dropped
Male Icon Path - string the path to the DDS icon file for the male or only model
Female Icon Path - string the path to the DDS icon file for the female model
Playable - bool whether the item is useable by the player or not
Functions:
GetEquipmentSlot - returns the equipment slot or slots taken by the object
(slot:short) reference.GetEquipentSlot objectID:ref
SetEquipmentSlot - sets the equipment slot or slots taken by the object
(nothing) reference.SetEquipmentSlot slot:short objectID:ref
SetMaleBipedPath - sets the male NIF model path when worn
(nothing) reference.SetMaleModelPath modelPath:string objectID:ref
SetFemaleBipedPath - sets the female NIF model path when worn
(nothing) reference.SetFemaleModelPath modelPath:string objectID:ref
SetMaleGroundPath - sets the male model path when dropped
(nothing) reference.SetMaleGroundPath modelPath:string objectID:ref
SetFemaleGroundPath - sets the female model path when dropped
(nothing) reference.SetFemaleGroundPath modelPath:string objectID:ref
SetMaleIconPath - sets the male icon texture
(nothing) reference.SetMaleIconPath iconPath:string objectID:ref
SetFemaleIconPath - sets the female icon texture
(nothing) reference.SetFemaleIconPath iconPath:string objectID:ref
ModXXXPath - modifies the specified path of the calling reference or passed obectID. The toReplaceAndReplaceWith string has the following format: "toReplace|replaceWith". We will do a case insensitve search for the toReplace portion and if found will replace it with the replaceWith portion. The | character is used to separate the portions of the string. If there is nothing before the | character, the replaceWith string is prepended to the specified path. In the console, use @ instead of |.
(nothing) reference.ModMaleBipedPath toReplaceAndReplaceWith:string toObject:ref
(nothing) reference.ModFemaleBipedPath toReplaceAndReplaceWith:string toObject:ref
(nothing) reference.ModMaleGroundPath toReplaceAndReplaceWith:string toObject:ref
(nothing) reference.ModFemaleGroundPath toReplaceAndReplaceWith:string toObject:ref
(nothing) reference.ModMaleIconPath toReplaceAndReplaceWith:string toObject:ref
(nothing) reference.ModFemaleIconPath toReplaceAndReplaceWith:string toObject:ref
CompareXXXPath - returns whether the specified path of the calling reference or objectID contains the toFind string. This does a case insensitive search.
(found:bool) reference.CompareMaleBipedPath toFind:string objectID:ref
(found:bool) reference.CompareFemaleBipedPath toFind:string objectID:ref
(found:bool) reference.CompareMaleGroundPath toFind:string objectID:ref
(found:bool) reference.CompareFemaleGroundPath toFind:string objectID:ref
(found:bool) reference.CompareMaleIconPath toFind:string objectID:ref
(found:bool) reference.CompareFemaleIconPath toFind:string objectID:ref
(found:bool) reference.MaleBipedPathIncludes toFind:string objectID:ref
(found:bool) reference.FemaleBipedPath Includes toFind:string objectID:ref
(found:bool) reference.MaleGroundPath Includes toFind:string objectID:ref
(found:bool) reference.FemaleGroundPath Includes toFind:string objectID:ref
(found:bool) reference.MaleIconPath Includes toFind:string objectID:ref
(found:bool) reference.FemaleIconPath Includes toFind:string objectID:ref
CopyXXXPath - sets the specified path of the calling reference or objectID to the same path from the fromObject.
(nothing) reference.CopyMaleBipedPath fromObject:ref toObject:ref
(nothing) reference.CopyFemaleBipedPath fromObject:ref toObject:ref
(nothing) reference.CopyMaleGroundPath fromObject:ref toObject:ref
(nothing) reference.CopyFemaleGroundPath fromObject:ref toObject:ref
(nothing) reference.CopyMaleIconPath fromObject:ref toObject:ref
(nothing) reference.CopyFemaleIconPath fromObject:ref toObject:ref
IsPlayable - returns whether the specified object is playable or not. Returns true only if the object is of a type which can be flaggd as playable in the editor.
(isPlayable:bool) reference.IsPlayable objectID:ref
SetIsPlayable - specifies whether the object can be used by the player
(nothing) reference.SetIsPlayable isPlayable:bool objectID:ref
IsPlayable2 - returns whether the specified object is playable or not. If the object is of a type which cannot be flagged as playable in the editor, this function returns true.
(isPlayable:bool) reference.IsPlayable2 objectID:ref
IsBipedIconPathValid - returns 1 if the icon path for the object exists in the user's Data folder or within one of the BSA archives.
(isPathValid:bool) reference.IsBipedIconPathValid bipedPathCode:short object:ref
IsBipedModelPathValid - returns 1 if the model path for the object exists in the user's Data folder or within one of the BSA archives.
(isPathValid:bool) reference.IsBipedModelPathValid bipedPathCode:short object:ref
GetBipedModelPath - returns the file path of one of the models for the specified biped object.
(path:string_var) reference.GetBipedModelPath bipedPathCode:short object:ref
SetBipedModelPathEX - sets the file path of the male or female model for the specified biped object.
(nothing) reference.SetBipedModelPathEX path:formatString bipedPathCode:short object:ref
GetBipedIconPath - returns the file path of one of the icons for the specified biped object.
(path:string_var) reference.GetBipedIconPath bipedPathCode:short object:ref
SetBipedIconPathEX - sets the file path of the male or female icon for the specified biped object.
(nothing) reference.SetBipedIconPathEX path:formatString bipedPathCode:short object:ref
GetHidesRings - returns 1 if the "hides rings" flag is set for the biped object.
(hidesRings:bool) reference.GetHidesRings object:ref
GetHidesAmulet - returns 1 if the "hides amulet" flag is set for the biped object.
(hidesAmulet:bool) reference.GetHidesAmulet object:Ref
SetHidesRings - modifies the "hides rings" flag.
(nothing) reference.SetHidesRings hidesRings:bool object:ref
SetHidesAmulet - modifies the "hides amulet" flag.
(nothing) reference.SetHidesAmulet hidesAmulet:bool object:ref
GetBipedSlotMask - returns the slots occupied by a biped object.
(slotMask:long) reference.GetBipedSlotMask object:ref
SetBipedSlotMask -sets the slots occupied by a biped object.
(nothing) reference.SetBipedSlotMask slotMask:long object:ref
Oblivion Types
Oblivion Types are the various forms available to fill out in the CS. They correspond to real objects or concepts in Oblivion. Types are a collection of values and functions which can be applied to them. Frequently they have Qualities which encapsulate common values and functions across the various types. If a type has a quality listed, that type has all of the values and functions of that quality in addition to any listed directly with the type itself.

- Actor Reference
- Alchemy Item
- Ammo
- Apparatus
- Armor
- Book
- Cell
- Climate
- Clothing
- Combat Style
- Creature
- Door
- Enchantment
- Faction
- Flora
- Ingredient
- Leveled List
- Light
- Magic Effect Setting
- Magic Target
- Map Marker
- NPC
- Player
- Projectile
- Reference
- Skill
- Soul Gem
- Spell
- Weapon
- Weather

Actor Reference
A reference to a creature or NPC in the gameworld. Actor references have AI, animations, and havok states.
Qualities: Actor, Inventory, Magic Target, NPC or Creature
Functions:
GetNumDetectedActors - returns the number of other actors of which the calling actor may detect. This includes actors detected at "Lost" or "Unseen" level.
(numDetectedActors:short) reference.GetNumDetectedActors
GetNthDetectedActor - returns the Nth actor in the calling actor's detection list
(actor:ref) reference.GetNthDetectedActor
SetDetectionState - sets the detection state of the calling actor toward the specified actor reference. Note that Oblivion recalculates this value frequently for actors in high process; the function's main purpose is to reset the detection state of unconscious actors.
(nothing) reference.SetDetectionState actor:ref detection state:short
IsBlocking - returns 1 if the calling actor is blocking
(isBlocking:bool) reference.IsBlocking
IsAttacking - returns 1 if the calling actor is attacking
(isAttacking:bool) reference.IsAttacking
IsRecoiling - returns 1 if the calling actor is recoiling
(isRecoiling:bool) reference.IsRecoiling
IsDodging - returns 1 if the calling actor is dodging
(isDodging:bool) reference.IsDodging
IsStaggered - returns 1 if the calling actor is staggered
(isStaggered:bool) reference.IsStaggered
IsMovingForward - returns 1 if the calling actor is attempting to move forward, even if his path is blocked.
(isMovingForward:bool) reference.IsMovingForward
IsMovingLeft - returns 1 if the calling actor is attempting to strafe left
(isMovingLeft:bool) reference.IsMovingLeft
IsMovingRight - returns 1 if the calling actor is attempting to strafe right
(isMovingRight:bool) reference.IsMovingRight
IsMovingBackward - returns 1 if the calling actor is attempting to move backwards
(isMovingBackwards:bool) reference.IsMovingBackwards
IsTurningLeft - returns 1 if the calling actor is turning left
(isTurningLeft:bool) reference.IsTurningLeft
IsTurningRight - returns 1 if the calling actor is turning right
(isTurningRight:bool) reference.IsTurningRight
IsInAir - returns 1 if the calling actor is airborne, whether jumping or falling
(isInAir:bool) reference.IsInAir
IsJumping - returns 1 if the calling actor is beginning to jump (playing the JumpStart anim group)
(isJumping:bool) reference.IsJumping
IsOnGround - returns 1 if the calling actor is on the ground
(isOnGround:bool) reference.IsOnGround
IsFlying - returns 1 if the calling actor is flying. Only creatures can fly.
(isFlying:bool) reference.IsFlying
IsPowerAttacking - returns 1 if the calling actor is executing a power attack
(isPowerAttacking:bool) reference.IsPowerAttacking
IsCasting - returns 1 if the calling actor is casting a spell
(isCasting:bool) reference.IsCasting
GetFallTimer - returns the length of time for which the actor has been falling
(fallTimer:float) reference.GetFallTimer
IsAnimGroupPlaying - returns 1 if the specified animation group is currently being played by the calling actor
(playing:bool) reference.IsAnimGroupPlaying animationGroup:chars
AnimPathIncludes - returns 1 if one of the calling actor's currently playing animation paths includes the specified substring
(includes:bool) reference.AnimPathIncludes pathString:string
GetProcessLevel - returns the actor's current process level, or -1 if called on a non-actor. Process level determines how frequently the game updates an actor's AI. In general, high process actors are in the same cell as the player, while more distant actors are kept at a lower process level.
(processLevel:short) reference.GetProcessLevel
GetEquippedItems*- returns an array containing all items currently equipped by the calling actor
(items:Array) reference.GetEquippedItems
GetSpells* - returns an array containing all of the spells in an actor's spell list.
(spells:Array) reference.GetSpells baseActor:ref
Alchemy Item
Alchemy Items are potions and poisons.
Qualities: Edible, Inventory, Magic, Named, Simple
Values:
Is Poison Flag- bool whether the alchemy item is considered a poison. A poison is an alchemy item with all hostile effects. An alchemy item with even a single non-hostile effect is not a poison.
Functions:
IsPoison - returns whether the alchemy item is a poison.
(isPoison:bool) reference.IsPoison objectID:ref
MatchPotion* - Oblivion keeps track of potions created by the player and reuses them if another potion is created with the same effects as one created previously. This command takes a potion and returns a previously-created potion bearing the same effects, if one exists. Note that in some cases it may return the same potion that was passed as the argument. Mainly useful during potion creation in the Alchemy menu, or when dynamically modifying potion effects via script.
(matchedPotion:ref) MatchPotion potionToMatch:ref
Ammo
Ammo includes all ammunition like arrows.
Qualities: Attacking, Enchantable, Equippable, Inventory, Named, Simple
Apparatus
Apparatus are used for Alchemy and the creation of alchemy items.
Values:
Type - short the type of alchemy apparatus
Quality - float the level of the alchemy apparatus quality. The Apparatus Quality list shows the basic levels, but any value between 0 and 1.0 is valid.
Functions:
GetApparatusType - returns the alchemy apparatus type of the calling reference or passed objectID
(apparatusType:short) reference.GetApparatusType objectID:ref
SetApparatusType - sets the alchemy type of the calling reference or passed objectID
(nothing) reference.SetApparatusType apparatusType:short objectID:ref
GetQuality - returns the quality level of the calling reference or passed objectID
(quality:float) reference.GetQuality objectID:ref
SetQuality - sets the quality level of the calling reference or passed objectID
(nothing) reference.SetQuality quality:float objectID:ref
ModQuality - modifies the quality of the calling reference or passed objectID
(nothing) reference.ModQuality modQualityBy:float objectID:ref
Armor
Armor is any type of wearable object that provides protection against damage
Qualities: Breakable, Enchantable, Inventory, Named, Wearable
Values:
Armor Rating - long the value of protection provided by the armor
Armor Type - short the type of the armor. Armor Type Codes.
Functions:
GetArmorAR - returns the armor rating of the object
(armorRating:long) reference.GetArmorAR objectID:ref
SetArmorAR - sets the armor rating of the object
(nothing) reference.SetArmorAR nuArmorRating:long objectID:ref
ModArmorAR - modifies the armor rating of the object up or down
(nothing) reference.Mod ArmorAR modifyBy:float objectID:ref
GetArmorType - returns 0 if light armor and 1 if heavy armor
(armorType:short) reference.GetArmorType objectID:ref
SetArmorType - sets whether the armor is heavy or light
(nothing) reference.SetArmorType nuArmorType:short objectID:ref
Book
Qualities: Inventory
Values:
Can Be Taken - bool whether the book can be taken
IsScroll - bool whether the book is a scroll
SkillTaught - bool whether the book teaches a skill or not
Functions:
GetBookCantBeTaken - returns 1 if the book cannot be taken
(cantBeTaken:bool) reference.GetBookCantBeTaken objectID:ref
GetBookIsScroll - returns whether the book is a scroll or not
(isScroll:bool) reference.GetBookIsScroll objectID:ref
GetBookSkillTaught - returns the skill taught by the book. If no skill is taught, returns 255.
(skillTaught:short) reference.GetBookSkillTaught objectID:ref
SetBookCantBeTaken - sets whether the book can be taken
(nothing) reference.SetBookCantBeTaken cantBeTaken:bool objectID:ref
SetBookIsScroll - sets whether the book is a scroll
(nothing) reference.SetBookIsScroll isScroll:bool objectID:ref
SetBookSkillTaught - sets the skill the book teaches. The the skillTaught value is not one of the skills, sets the value to 255.
(nothing) reference.SetBookSkillTaught skillTaught:short objectID:ref
GetBookText - returns the text of a book as a string. The result must be assigned to a string variable.
(bookText:string_var) reference.GetBookText book:ref
Cell
Qualities: Named
Value:
Music Type
Functions:
GetCellMusicType - returns the music type of the player's current cell.
(musicType:short) GetCellMusicType
SetCellWaterHeight* - changes the water height of the specified cell. In order for the command to take full effect, the cell must be reloaded (con_PurgeCellBuffers can be used to forcibly unload it if it is still in memory). If used to alter the water height in a loaded cell, the water shader will reflect the new height and actors will switch between swimming and walking animations appropriately. However, floating physics and the water surface will not be updated until the cell is reloaded. This command has no effect in exteriors or in cells which have no water.
(waterHeightChanged:bool) SetCellWaterHeight cell:ref newHeight:float
Climate
Qualities:
Values: CS Wiki Page Info
Sunrise Begin, Sunrise End, Sunset Begin, Sunset End - short these values are the number of 10 minute increments since midnight the the given event occurs
MoonPhaseLength - short the number of days in the moons' phase.
HasMasser, HasSecunda - bool which moons the climate will show
Volatility - short the volatility of the climate, or how often the weather is likely to change
Functions:
GetCurrentClimateID - returns the refID of the current climate
(currentClimate:ref) GetCurrentClimateID
GetClimateSunriseBegin - returns the time sunrise begins specified as a number of 10 minute units since midnight
(sunriseBegin:short) GetSunriseBegin climate:ref
GetClimateSunriseEnd - returns the time sunrise ends specified as a number of 10 minute units since midnight
(sunriseEnd:short) GetSunriseEnd climate:ref
GetClimateSunsetBegin - returns the time sunset begins specified as a number of 10 minute units since midnight
(sunsetBegin:short) GetSunsetBegin climate:ref
GetClimateSunsetEnd - returns the time sunset ends specified as a number of 10 minute units since midnight
(sunsetEnd:short) GetSunsetEnd climate:ref
GetClimateMoonPhaseLength - returns the number of days in the phase of the moons. The total moon cycle length is 8 x PhaseLength according to the CS.
(phaseLength:short) GetClimateMoonPhaseLength climate:ref
GetClimateHasMasser - returns 1 if the current climate shows the moon Masser
(hasMasser:bool) GetClimateHasMasser climate:ref
GetClimateHasSecunda - returns 1 if the current climate shows the moon Secunda
(hasSecunda:bool) GetClimateHasSecunda climate:ref
RefreshCurrentClimate - refreshes the climate info to reflect changes made by the SetClimateXXX functions
(nothing) RefreshCurrentClimate
SetClimateSunriseBegin - sets the time sunrise begins as a number of 10 minute units since midnight
(nothing) SetClimateSunriseBegin time:short climate:ref
SetClimateSunriseEnd - sets the time sunrise ends as a number of 10 minute units since midnight
(nothing) SetClimateSunriseEnd time:short climate:ref
SetClimateSunsetBegin - sets the time sunset begins as a number of 10 minute units since midnight
(nothing) SetClimateSunsetBegin time:short climate:ref
SetClimateSunsetEnd - sets the time sunset ends as a number of 10 minute units since midnight
(nothing) SetClimateSunsetEnd time:short climate:ref
SetClimateMoonPhaseLength - sets the number of days in the phase of the moons
(nothing) SetClimateMoonPhaseLength nuPhaseLength:short climate:ref
SetClimateHasMasser - sets whether the climate shows the moon Masser
(nothing) SetClimateHasMasser hasMasser:bool climate:ref
SetClimateHasSecunda - sets whether the climate shows the moon Secunda
(nothing) SetClimateHasSecunda hasMasser:bool climate:ref
GetClimateVolatility - returns the volatility of the climate
(volatility:short) GetClimateVolatility climate:ref
SetClimateVolatility - sets the volatility of the climate
(nothing) SetClimateVolatility volatility:short climate:ref
Clothing
Clothing is any wearable object that does not provide armor protection. Includes amulets and rings.
Qualities: Enchantable, Inventory, Named, Wearable
Creature
Qualities: Actor, Attacking (only attack damage), Inventory, Magic Target
Value:
Creature Type - short the type of creature
Combat Skill - short the value for all combat skills for the creature
Magic Skill - short the value for all magic skills for the creature
Stealth Skill - short the value for all stealth skills for the creature
Reach - short the attack reach of the creature
Soul Level - short the soul level of the creature
Base Scale - float the base scale of the creature
Functions:
IsCreature - returns whether the reference or passed id is a creature
(isCreature:bool) reference.IsCreature creature:ref
GetCreatureType - returns the type of the creature (Undead, Humanoid, Daedrea etc)
(creatureType:short) reference.GetCreatureType creature:ref
GetCreatureCombatSkill - returns the combat skill for the creature
(combatSkill:short) reference.GetCreatureCombatSkill creature:ref
GetCreatureMagicSkill - returns the magic skill for the creature
(magicSkill:short) reference.GetCreatureCombatSkill creature:ref
GetCreatureStealthSkill - returns the stealth skill for the creature
(stealthSkill:short) reference.GetCreatureCombatSkill creature:ref
GetCreatureReach - returns the reach of the creature
(reach:short) reference.GetCreatureReach creature:ref
GetCreatureSoulLevel - returns the soul level of the creature
(soulLevel:short) reference.GetCreatureSoulLevel creature:ref
GetCreatureBaseScale - retuns the base scale of the creature
(scale:float) reference.GetCreatureBaseScale creature:ref
GetCreatureWalks - returns 1 if the Walks flag is set on the creature
(walks:bool) reference.GetCreatureWalks creature:ref
GetCreatureSwims - returns 1 if the Swims flag is set on the creature
(swims:bool) reference.GetCreatureSwims creature:ref
GetCreatureFlies - returns 1 if the Flies flag is set on the creature
(flies:bool) reference.GetCreatureFlies creature:ref
IsCreatureBiped - returns 1 if the Biped flag is set on the creature
(biped:bool) reference.isCreatureBiped creature:ref
CreatureHasNoMovement - returns 1 if the No Movement flag is set on the creature
(noMovement:bool) reference.CreatureHasNoMovement creature:ref
CreatureHasNoHead - returns 1 if the No Head flag is set on the creature
(noHead:bool) reference.CreatureHasNoHead creature:ref
CreatureHasNoLeftArm - returns 1 if the No Left Arm flag is set on the creature
(noLeftArm:bool) reference.CreatureHasNoLeftArm creature:ref
CreatureHasNoRightArm - returns 1 if the No Right Arm flag is set on the creature
(noRightArm:bool) reference.CreatureHasNoRightArm creature:ref
CreatureNoCombatInWater - returns 1 if the No Combat In Water flag is set on the creature
(noCombat:bool) reference.CreatureNoCombatInWater creature:ref
CreatureUsesWeaponAndShield - returns 1 if the Uses Weapon and Shield flag is set on the creature
(weaponAndShield:bool) reference.CreatureUsesWeaponAndShield creature:ref
GetRider - returns the NPC currently riding the calling horse.
(rider:ref) reference.GetRider
GetCreatureSoundBase - returns the creature from which the specified creature's sounds are derived, if any.
(creature:ref) reference.GetCreatureSoundBase creature:ref
HasModel - returns 1 if the creature's model list includes the specified .nif file. The file must appear in the creature's meshes folder. String must include the ".nif" extension and is case-insensitive.
(hasModel:bool) reference.HasModel model:string creature:ref
GetCreatureSound - returns the creature's sound associated with the specified action
(sound:ref) reference.GetCreatureSound whichSound:actorSound creature:ref
ToggleCreatureModel - toggles a model within a creature's model list on or off. The model path must be relative to the creature's model folder and include the ".nif" extension. When called on a reference which is currently being rendered, the reference must be disabled and then enabled before the change is visible.
(nothing) reference.ToggleCreatureModel modelPath:string enableModel:bool creature:ref
Combat Style*
Combat styles are used by NPCs and creatures to determine behavior in combat.
GetCombatStyle* - returns the combat style assigned to the calling reference. Note that many actors are assigned no combat style in the editor (i.e. "DEFAULT" appears in the selection box); in that case this function returns zero.
(combatStyle:ref) reference.GetCombatStyle
Additional Combat Style Functions*
Most of these functions get or set the values of properties defined in the Combat Style window for each combat style and follow the same syntax conventions.
Syntax:
(value:numeric) GetCombatStyleXXX combatStyle:ref
(nothing) SetCombatStyleXXX newValue:numeric combatStyle:ref
GetCombatStyle
GetCombatStyleDodgeChance
GetCombatStyleDodgeLRChance
GetCombatStyleDodgeLRTimerMin
GetCombatStyleDodgeLRTimerMax
GetCombatStyleDodgeFWTimerMin
GetCombatStyleDodgeFWTimerMax
GetCombatStyleDodgeBackTimerMin
GetCombatStyleDodgeBackTimerMax
GetCombatStyleIdleTimerMin
GetCombatStyleIdleTimerMax
GetCombatStyleBlockChance
GetCombatStyleAttackChance
GetCombatStyleStaggerBonusToAttack
GetCombatStyleKOBonusToAttack
GetCombatStyleH2HBonusToAttack
GetCombatStylePowerAttackChance
GetCombatStyleStaggerBonusToPowerAttack
GetCombatStyleKOBonusToPowerAttack
GetCombatStyleHoldTimerMin
GetCombatStyleHoldTimerMax
GetCombatStyleAcrobaticsDodgeChance
GetCombatStyleRangeOptimalMult
GetCombatStyleRangeMaxMult
GetCombatStyleSwitchDistMelee
GetCombatStyleSwitchDistRanged
GetCombatStyleBuffStandoffDist
GetCombatStyleRangedStandoffDist
GetCombatStyleGroupStandoffDist
GetCombatStyleRushAttackChance
GetCombatStyleRushAttackDistMult
GetCombatStyleDodgeFatigueModMult
GetCombatStyleDodgeFatigueModBase
GetCombatStyleEncumberedSpeedModBase
GetCombatStyleEncumberedSpeedModMult
GetCombatStyleDodgeUnderAttackMult
GetCombatStyleDodgeNotUnderAttackMult
GetCombatStyleDodgeBackUnderAttackMult
GetCombatStyleDodgeBackNotUnderAttackMult
GetCombatStyleDodgeFWAttackingMult
GetCombatStyleDodgeFWNotAttackingMult
GetCombatStyleBlockSkillModMult
GetCombatStyleBlockSkillModBase
GetCombatStyleBlockUnderAttackMult
GetCombatStyleBlockNotUnderAttackMult
GetCombatStyleAttackSkillModMult
GetCombatStyleAttackSkillModBase
GetCombatStyleAttackUnderAttackMult
GetCombatStyleAttackNotUnderAttackMult
GetCombatStyleAttackDuringBlockMult
GetCombatStylePowerAttackFatigueModBase
GetCombatStylePowerAttackFatigueModMult
SetCombatStyleDodgeChance
SetCombatStyleDodgeLRChance
SetCombatStyleDodgeLRTimerMin
SetCombatStyleDodgeLRTimerMax
SetCombatStyleDodgeFWTimerMin
SetCombatStyleDodgeFWTimerMax
SetCombatStyleDodgeBackTimerMin
SetCombatStyleDodgeBackTimerMax
SetCombatStyleIdleTimerMin
SetCombatStyleIdleTimerMax
SetCombatStyleBlockChance
SetCombatStyleAttackChance
SetCombatStyleStaggerBonusToAttack
SetCombatStyleKOBonusToAttack
SetCombatStyleH2HBonusToAttack
SetCombatStylePowerAttackChance
SetCombatStyleStaggerBonusToPowerAttack
SetCombatStyleKOBonusToPowerAttack
SetCombatStyleHoldTimerMin
SetCombatStyleHoldTimerMax
SetCombatStyleAcrobaticsDodgeChance
SetCombatStyleRangeOptimalMult
SetCombatStyleRangeMaxMult
SetCombatStyleSwitchDistMelee
SetCombatStyleSwitchDistRanged
SetCombatStyleBuffStandoffDist
SetCombatStyleRangedStandoffDist
SetCombatStyleGroupStandoffDist
SetCombatStyleRushAttackChance
SetCombatStyleRushAttackDistMult
SetCombatStyleDodgeFatigueModMult
SetCombatStyleDodgeFatigueModBase
SetCombatStyleEncumberedSpeedModBase
SetCombatStyleEncumberedSpeedModMult
SetCombatStyleDodgeUnderAttackMult
SetCombatStyleDodgeNotUnderAttackMult
SetCombatStyleDodgeBackUnderAttackMult
SetCombatStyleDodgeBackNotUnderAttackMult
SetCombatStyleDodgeFWAttackingMult
SetCombatStyleDodgeFWNotAttackingMult
SetCombatStyleBlockSkillModMult
SetCombatStyleBlockSkillModBase
SetCombatStyleBlockUnderAttackMult
SetCombatStyleBlockNotUnderAttackMult
SetCombatStyleAttackSkillModMult
SetCombatStyleAttackSkillModBase
SetCombatStyleAttackUnderAttackMult
SetCombatStyleAttackNotUnderAttackMult
SetCombatStyleAttackDuringBlockMult
SetCombatStylePowerAttackFatigueModBase
Door
Qualities: Audible
Value:
Functions:
IsLoadDoor - returns 1 if the calling reference is a load door
(isLoadDoor:bool) reference.IsLoadDoor
GetLinkedDoor - returns the door to which the calling load door is linked
(linkedDoor:ref) reference.GetLinkedDoor
GetTeleportCell - returns the cell to which the calling load door teleports
(cell:ref) reference.GetTeleportCell
IsOblivionGate* - returns true if the door is flagged as an Oblivion gate in the editor.
(isOBGate:bool) reference.IsOblivionGate door:ref
Enchantment
An Enchantment is a group of magical effects that can be applied to enchantable objects.
Qualities: Named, Magic
Value:
Enchantment Type - short the type of object to which an enchantment may be applied
Charge - long the charge of the enchantment. Of unknown and dubious use - the number sometimes does not correspond to the value listed in the CS. The CS seems to list cost and charge both from the Cost value on the enchantment item.
Cost - long the cost in magicka charge consumed by each use of the enchantment
Functions:
GetEnchantmentType - returns the type of the enchantment
(enchantType:short) GetEnchantmentType objectID:ref
SetEnchantmentType - sets the type of the enchantment
(nothing) SetEnchantmentType enchantType:short objectID:ref
GetEnchantmentCharge - returns the charge of the enchantment. Of unknown and dubious use.
(charge:long) GetEnchantmentCharge objectID:ref
SetEnchantmentCharge - sets the charge of the enchantment. Of unknown and dubious use.
(nothing) SetEnchantmentCharge nuCharge:long objectID:ref
ModEnchantmentCharge - modifies the charge of the enchantment. Of unknown and dubious use.
(nothing) ModEnchantmentCharge modifyBy:float objectID:ref
GetEnchantmentCost - returns the magicka charge cost for using the enchantment
(cost:long) GetEnchantmentCost objectID:ref
SetEnchantmentCost - sets the cost for using the enchantment
(nothing) SetEnchantmentCost nuCost:long objectID:ref
ModEnchantmentCost - modifies the cost for using the enchantment up or down
(nothing) ModEnchantmentCost modifyBy:float objectID:ref
Faction
Qualities: Named
Functions:
FactionHasSpecialCombat - returns 1 if the Special Combat flag is set on the faction
(hasSpecialCombat:bool) FactionHasSpecialCombat faction:ref
IsFactionEvil - returns 1 if the faction is marked as evil
(isEvil:bool) IsFactionEvil faction:ref
IsFactionHidden - returns 1 if the faction is not shown on the player's faction sheet
(isHidden:bool) IsFactionHidden faction:ref
SetFactionEvil - changes the Evil flag on the faction. Changes are saved in the savegame
(nothing) SetFactionEvil faction:ref isEvil:short
SetFactionHidden - changes the Hidden flag on the faction. Changes are saved in the savegame
(nothing) SetFactionHidden faction:ref isHidden:short
SetFactionSpecialCombat - changes the Special Combat flag on the faction. Changes are saved in the savegame
(nothing) SetFactionSpecialCombat faction:ref hasSpecialCombat:short
GetNumRanks - returns the number of ranks in the faction.
(numRanks:short) GetNumRanks faction:ref
GetNthFactionRankName - returns the title of the nth rank in a faction. Optionally returns the female rank name.
(rankName:string_var) GetNthFactionRankName faction:ref whichRank:short female:bool
SetNthFactionRankNameEX - sets the title of the nth rank in a faction. Optionally sets the female rank name.
(nothing) SetNthFactionRankNameEX path:formatString faction:ref whichRank:short female:bool
Flora
Plants which can be harvested for alchemical ingredients
Functions:
IsHarvested - returns 1 if the calling reference's ingredient has been harvested
(isHarvested:bool) reference.IsHarvested
SetHarvested - mark or unmark the calling reference as having been harvested. Changes are saved in the savegame.
(nothing) reference.SetHarvested isHarvested:short
GetIngredient - returns the ingredient contained in a plant.
(ingredient:ref) reference.GetIngredient flora:ref
SetIngredient - sets the ingredient contained in a plant. Omit the ingredient parameter or pass an empty ref variable to set it to "no ingredient."
(nothing) reference.SetIngredient ingredient:ref flora:ref
GetIngredientChance - returns the % chance of harvesting an ingredient from the plant for a specific season where 0 = spring, 1 = summer, 2 = autumn, and 3 = winter. Return value ranges from 0 to 100.
(chance:short) reference.GetIngredientChance whichSeason:short flora:ref
SetIngredientChance - sets the %chance of harvesting an ingredient based on the specified season.
(nothing) reference.SetIngredientChance whichSeason:short newChance:short flora:ref
Ingredient
Ingredients are items that may be used to create Alchemy Items.
Qualities: Edible, Inventory, Magic, Named, Simple
Leveled List
A list of creatures, NPCs, items, or spells. Changes made to lists using OBSE functions are not saved in the savegame, but persist for the duration of the game session after they are made. To make effectively "permanent" changes to a leveled list, include code similar to the following in a quest script:
if ( GetGameRestarted ) ; runs once each time Oblivion is started
AddToLeveledList list object level
RemoveFromLeveledList list object
endif
Functions:
AddToLeveledList - adds an object to a leveled creature, spell, or item list.. Count defaults to 1 if unspecified.
(nothing) AddToLeveledList leveledList:ref object:ref level:short count:short
RemoveFromLeveledList - removes all occurences of an object from a leveled list and returns the number of occurences removed.
(numRemoved:short) RemoveFromLeveledList leveledList:ref object:ref
CalcLeveledItem - returns one item from a leveled item list, selected randomly for a character of the specified level. Oblivion selects a level range from which to choose using the game setting iLevItemLevelDifferenceMax. The item chosen is within the range [minLevel...maxLevel], where maxLevel is the level in the list closest to but not exceeding the character's level, and minLevel = maxLevel - levelDiff. If the “Calculate for all item <= level” flag is set for the leveled list, minLevel is always zero. This function checks the "Chance None" property of the leveled list, so it may return nothing based on that chance; pass 0 for the third parameter to override this behavior. In the case of leveled lists containing nested leveled lists, the function recurses through each list until it finds a non-leveled item. Omit the levelDiff parameter to use the current value of iLevItemLevelDifferenceMax.
(randomItem:ref) CalcLeveledItem leveledList:ref level:short useChanceNone:bool levelDiff:short
CalcLevItemNR - does the same thing as CalcLeveledItem but will not recurse through nested leveled lists. This means that unlike CalcLeveledItem, CalcLevItemNR can return another leveled list rather than a real object.
(randomItem:ref CalcLevItemNR leveledList:ref level:short useChanceNone:bool levelDiff:short
GetCalcAllLevels - returns 1 if the "calculate for all levels <= PC level" flag is checked.
(calcAllLevels:bool) GetCalcAllLevels leveledList:ref
GetCalcEachInCount - returns 1 if the "calculate for each item in count" flag is checked.
(calcEach:bool) GetCalcEachInCount leveledList:ref
GetChanceNone - returns the chance from 0 to 100 that a leveled list returns no item.
(chanceNone:short) GetChanceNone leveledList:ref
GetNthLevItem - returns the Nth element in a leveled list, as ordered in the Construction Set.
(element:ref) GetNthLevItem index:short leveledList:ref
GetNthLevItemCount - returns the count of the Nth element of a leveled list.
(count:short) GetNthLevItemCount index:short leveledList:ref
GetNthLevItemLevel - returns the level of the Nth element of a leveled list.
(level:short) GetNthLevItemLevel index:short leveledList:ref
GetNumLevItems - returns the number of elements in a leveled list.
(numItems:short) GetNumLevitems leveledList:ref
GetLevItemByLevel - returns the first element of the specified level in the leveled list.
(element:ref) GetLevItemByLevel whichLevel:short leveledList:ref
RemoveLevItemByLevel - removes any elements of the specified level from a leveled list
(numRemoved:short) RemoveLevItemByLevel whichLevel:short leveledList:ref
ClearLeveledList - removes all elements from a leveled list.
(nothing) ClearLeveledList leveledList:ref
RemoveNthLevItem - removes the nth item from a leveled list.
(nothing) RemoveNthLevItem index:short leveledList:ref
GetLevItemIndexByLevel - returns the index of the first item of the specified level within a leveled list, or -1 if no item exists for that level.
(index:short) GetLevItemIndexByLevel level:short leveledList:ref
GetLevItemIndexByForm - returns the index of the first occurrence of the specified form in a leveled list, or -1 if the form is not found.
(index:short) GetLevItemIndexByForm leveledList:ref formToFind:ref
SetChanceNone - sets the chance that a leveled list generates no item.
(nothing) SetChanceNone chance:short levlist:ref
Light
Objects which emit light. They may or may not have a visible model associated with them and may or may not be carriable.
Qualities: Equippable, Inventory, Named, Simple, Audible
Value:
Radius - short the radius illuminated by the light
Functions:
IsLightCarriable - returns 1 if the light may be placed in an inventory.
(isCarriable:bool) reference.IsLightCarriable light:ref
GetLightRadius - returns the radius of the light.
(radius:short) reference.GetLightRadius light:ref
SetLightRadius - sets the radius of the light. Changes are not saved in the savegame.
(nothing) reference.SetLightRadius radius:short light:ref
Magic Effect Setting
Values:
Code - chars or long the magic effect code. In the CS this is a 4 character code (like FIDG or Z001). As a return value from OBSE functions it is a long with the same numerical value.
Base Cost - float the base cost multiplier for the effect
School - short the spell skill controlling the effect
Projectile Speed - float the projectile speed of the magic effect
Enchant Factor - float the constant effect enchantment factor which helps determine the maximum magnitude of the effect when enchanting
Barter Factor - float the constant effect barter factor which helps determine the increase in value when enchanting
Is Hostile flag - bool determines if the effect is hostile. Only hostile effects may be in a poison.
Functions:
GetMagicEffectCode - returns the magic effect code of the effect.
(magicEffectCode:long) GetMagicEffectCode effect:chars
(magicEffectCode:long) GetMECode effect:chars
MagicEffectFromCode* - given an effect code, returns the effect setting matching that code.
(magicEffect:ref) MagicEffectFromCode effectCode:long
MagicEffectFromChars* - given a string representing a four-letter effect code (e.g. "REHE"), returns the effect setting matching that code
(magicEffect:ref) MagicEffectFromChars effectChars:String
GetMagicEffectBaseCost - returns the base cost of the magic effect
(baseCost:float) GetMagicEffectBaseCost effect:chars
(baseCost:float) GetMEBaseCost effect:chars
(baseCost:float) GetMagicEffectBaseCostC effect:long
(baseCost:float) GetMEBaseCostC effect:long
GetMagicEffectSchool - returns the controlling school of the magic effect
(magicSchool:short) GetMagicEffectSchool effect:chars
(magicSchool:short) GetMESchool effect:chars
(magicSchool:short) GetMagicEffectSchoolC effect:long
(magicSchool:short) GetMESchoolC effect:long
GetMagicEffectProjectileSpeed - returns the projectile speed of the magic effect
(projectileSpeed:float) GetMagicEffectProjectileSpeed effect:chars
(projectileSpeed:float) GetMEProjSpeed effect:chars
(projectileSpeed:float) GetMagicEffectProjectileSpeedC effect:long
(projectileSpeed:float) GetMEProjSpeedC effect:long
GetMagicEffectEnchantFactor - returns the constant effect enchantment factor of the magic effect
(enchantFactor:float) GetMagicEffectEnchantFactor effect:chars
(enchantFactor:float) GetMEEnchant effect:chars
(enchantFactor:float) GetMagicEffectEnchantFactorC effect:long
(enchantFactor:float) GetMEEnchantC effect:long
GetMagicEffectBarterFactor - returns the constant effect barter factor of the magic effect
(enchantFactor:float) GetMagicEffectBarterFactor effect:chars
(enchantFactor:float) GetMEEBarter effect:chars
(enchantFactor:float) GetMagicEffectBarterFactorC effect:long
(enchantFactor:float) GetMEBarterC effect:long
IsMagicEffectHostile - returns whether the magic effect is hostile
(isHostile:bool) IsMagicEffectHostile effect:chars
(isHostile:bool) IsMEHostile effect:chars
(isHostile:bool) IsMagicEffectHostileC effect:long
(isHostile:bool) IsMEHostileC effect:long
IsMagicEffectForSpellmaking - returns whether the magic effect can be used for spell making
(isForSpellMaking:bool) IsMagicEffectForSpellmaking effect:chars
(isForSpellMaking:bool) IsMEForSpellmaking effect:chars
(isForSpellMaking:bool) IsMagicEffectForSpellmakingC effect:long
(isForSpellMaking:bool) IsMEForSpellmakingC effect:long
IsMagicEffectForEnchanting - returns whether the magic effect can be used when enchanting
(isForEnchanting:bool) IsMEForEnchanting effect:chars
(isForEnchanting:bool) IsMagicEffectForEnchantingC effect:long
(isForEnchanting:bool) IsMEForEnchantingC effect:long
IsMagicEffectDetrimental - returns whether the magic effect harms the receipient
(isDetrimental:bool) IsMagicEffectDetrimental effect:chars
(isDetrimental:bool) IsMEDetrimental effect:chars
(isDetrimental:bool) IsMagicEffectDetrimentalC effect:long
(isDetrimental:bool) IsMEDetrimentalC effect:long
IsMagicEffectCanRecover - returns whether the target can recover from the effect
(isCanRecover:bool) IsMagicEffectCanRecover effect:chars
(isCanRecover:bool) IsMECanRecover effect:chars
(isCanRecover:bool) IsMagicEffectCanRecoverC effect:long
(isCanRecover:bool) IsMECanRecoverC effect:long
IsMagicEffectMagnitudePercent - returns whether the magic effect's magnitude is a percentage
(isMagPercent:bool) IsMagicEffectMagnitudePercent effect:chars
(isMagPercent:bool) IsMEMagnitudePercent effect:chars
(isMagPercent:bool) IsMagicEffectMagnitudePercentC effect:long
(isMagPercent:bool) IsMEMagnitudePercentC effect:long
MagicEffectFXPersists - returns whether the magic effect's graphics effects persist
(FXPersists:bool) MagicEffectFXPersists effect:chars
(FXPersists:bool) MagicEffectFXPersistsC effect:long
IsMagicEffectOnSelfAllowed - returns whether the magic effect can be cast on self
(onSelfAllowed:bool) IsMagicEffectOnSelfAllowed effect:chars
(onSelfAllowed:bool) IsMEOnSelfAllowed effect:chars
(onSelfAllowed:bool) IsMagicEffectOnSelfAllowedC effect:long
(onSelfAllowed:bool) IsEOnSelfAllowedC effect:long
IsMagicEffectOnTouchAllowed - returns whether the magic effect can be cast on touch
(onTouchAllowed:bool) IsMagicEffectOnTouchAllowed effect:chars
(onTouchAllowed:bool) IsMagicEffectOnTouchAllowed effect:chars
(onTouchAllowed:bool) IsMagicEffectOnTouchAllowedC effect:long
(onTouchAllowed:bool) IsMagicEffectOnTouchAllowedC effect:long
IsMagicEffectOnTargetAllowed - returns whether the magic effect can be cast on target
(onTargetAllowed:bool) IsMagicEffectOnTargetAllowed effect:chars
(onTargetAllowed:bool) IsMEOnTargetAllowed effect:chars
(onTargetAllowed:bool) IsMagicEffectOnTargetAllowedC effect:long
(onTargetAllowed:bool) IsMEOnTargetAllowedC effect:long
MagicEffectHasNoDuration - returns whether the magic effect doesn't use the duration value
(hasNoDuration:bool) MagicEffectHasNoDuration effect:chars
(hasNoDuration:bool) MEHasNoDuration effect:chars
(hasNoDuration:bool) MagicEffectHasNoDurationC effect:long
(hasNoDuration:bool) MEHasNoDurationC effect:long
MagicEffectHasNoMagnitude - returns whether the magic effect doesn't use the magnitude value
(hasNoMag:bool) MagicEffectHasNoMagnitude effect:chars
(hasNoMag:bool) MEHasNoMagnitude effect:chars
(hasNoMag:bool) MagicEffectHasNoMagnitudeC effect:long
(hasNoMag:bool) MEHasNoMagnitudeC effect:long
MagicEffectHasNoArea - returns whether the magic effect doesn't use the area value
(hasNoArea:bool) MagicEffectHasNoArea effect:chars
(hasNoArea:bool) MEHasNoAreaC effect:long
(hasNoArea:bool) MagicEffectHasNoArea effect:chars
(hasNoArea:bool) MEHasNoAreaC effect:long
MagicEffectHasNoIngredient - returns whether the magic effect has no ingredient
(hasNoIngredient:bool) MagicEffectHasNoIngredient effect:chars
(hasNoIngredient:bool) MEHasNoIngredient effect:chars
(hasNoIngredient:bool) MagicEffectHasNoIngredientC effect:long
(hasNoIngredient:bool) MEHasNoIngredientC effect:long
MagicEffectHasNoHitEffect - returns whether the magic effect has a graphic effect when it hits
(hasNoHitEffect:bool) MagicEffectHasNoHitEffect effect:chars
(hasNoHitEffect:bool) MEHasNoHitEffect effect:chars
(hasNoHitEffect:bool) MagicEffectHasNoHitEffectC effect:long
(hasNoHitEffect:bool) MEHasNoHitEffectC effect:long
MagicEffectUsesWeapon - returns whether the magic effect summons a weapon
(usesWeapon:bool) MagicEffectUsesWeapon effect:chars
(usesWeapon:bool) MEUsesWeapon effect:chars
(usesWeapon:bool) MagicEffectUsesWeaponC effect:long
(usesWeapon:bool) MEUsesWeaponC effect:long
MagicEffectUsesArmor - returns whether the magic effect summons armor
(usesArmor:bool) MagicEffectUsesArmor effect:chars
(usesArmor:bool) MEUsesArmorC effect:long
(usesArmor:bool) MagicEffectUsesArmor effect:chars
(usesArmor:bool) MEUsesArmorC effect:long
MagicEffectUsesCreature - returns whether the magic effect summons a creature
(usesCreature:bool) MagicEffectUsesCreature effect:chars
(usesCreature:bool) MEUsesCreature effect:chars
(usesCreature:bool) MagicEffectUsesCreatureC effect:long
(usesCreature:bool) MEUsesCreatureC effect:long
MagicEffectUsesSkill - returns whether the magic effect affects a skill
(usesSkill:bool) MagicEffectUsesSkill effect:chars
(usesSkill:bool) MagicEffectUsesSkillC effect:long
(usesSkill:bool) MagicEffectUsesSkill effect:chars
(usesSkill:bool) MagicEffectUsesSkillC effect:long
MagicEffectUsesAttribute - returns whether the magic effect affects an attribute
(usesAttribute:bool) MagicEffectUsesAttribute effect:chars
(usesAttribute:bool) MEUsesAttribute effect:chars
(usesAttribute:bool) MagicEffectUsesAttributeC effect:long
(usesAttribute:bool) MEUsesAttributeC effect:long
MagicEffectUsesOtherActorValue - returns whether the magic effect affects an actor value that is not a skill or an attribute
(usesOtherActorVal:bool) MagicEffectUsesOtherActorValue effect:chars
(usesOtherActorVal:bool) MEUsesOtherActorValue effect:chars
(usesOtherActorVal:bool) MagicEffectUsesOtherActorValueC effect:long
(usesOtherActorVal:bool) MEUsesOtherActorValueC effect:long
GetMagicEffectOtherActorValue - returns the actor value (skill, attribute or other) affected by the magic effect
(actorValue:short) GetMagicEffectOtherActorValue effect:chars
(actorValue:short) GetMEOtherActorValue effect:chars
(actorValue:short) GetMagicEffectOtherActorValueC effect:long
(actorValue:short) GetMEOtherActorValueC effect:long
GetMagicEffectUsedObject - returns the weapon, armor or creature summoned by the magic effect
(objectID:ref) GetMagicEffectUsedObject effect:chars
(objectID:ref) GetMEUsedObject effect:chars
(objectID:ref) GetMagicEffectUsedObjectC effect:long
(objectID:ref) GetMEUsedObjectC effect:long
RemoveNthMagicEffectCounter(C)* - removes the nth counter-effect for the magic effect. A 'C' version is also provided.
(nothing) RemoveNthMagicEffectCounter whichCounter:short magicEffect:ref
(nothing) RemoveNthMagicEffectCounterC whichCounter:short magicEffectCode:long
AddMagicEffectCounter(C)* - adds a counter-effect to the magic effect. The 'C' version accepts magic effect codes for both arguments.
(nothing) AddMagicEffectCounter counterEffect:ref magicEffect:ref
(nothing) AddMagicEffectCounterC counterEffectCode:long magicEffectCode:long
GetMagicEffectCounters(C)* - returns an Array containing the effect codes of all counter-effects for the specified magic effect.
(counters:Array) GetMagicEffectCounters magicEffect:ref
(counters:Array) GetMagicEffectCountersC magicEffectCode:long
SetMagicEffectCounters(C)* - accepts an Array of effect codes and assigns those effects as counter-effects for the specified magic effect, overriding any existing counter-effects. The user must guarantee that the passed array contains valid effect codes and nothing else. The function returns 1 if the new counter-effects were successfully applied, 0 otherwise.
(effectsApplied:bool) SetMagicEffectCounters counterEffects:Array magicEffect:Ref
(effectsApplied:bool) SetMagicEffectCountersC counterEffects:Array magicEffectCode:long
Additional Magic Effect Functions*
These functions can be used to retrieve or modify the properties of magic effect settings as defined in the Magic Effects window of the editor. Because they all follow similar syntax conventions and are largely self-explanatory, most are not documented individually. Versions of the commands ending in 'C' take a numeric magic effect code rather than a Magic Effect form as the argument to indicate the effect. All of these functions have abbreviated alternate names in which "MagicEffect" is replaced by "ME", i.e. GetMagicEffectName can also be written as GetMEName.
String functions: Get versions of these commands return a string; Set versions take a string as an argument.
Syntax:
(string) GetMagicEffectXXX effect:refOrCode
(nothing) SetMagicEffectXXX newValue:string effect:refOrCode
GetMagicEffectName
GetMagicEffectNameC
GetMagicEffectIcon
GetMagicEffectIconC
GetMagicEffectModel
GetMagicEffectModelC
SetMagicEffectName
SetMagicEffectNameC
SetMagicEffectIcon
SetMagicEffectIconC
SetMagicEffectModel
SetMagicEffectModelC
Form functions: Get versions of these commands a form (i.e. an effect shader, sound, etc). Set versions take a form as an argument.
Syntax:
(object:ref) GetMagicEffectXXX effect:refOrCode
(nothing) SetMagicEffectXXX newValue:ref effect:refOrCode
GetMagicEffectHitShader
GetMagicEffectHitShaderC
GetMagicEffectEnchantShader
GetMagicEffectEnchantShaderC
GetMagicEffectLight
GetMagicEffectLightC
GetMagicEffectCastingSound
GetMagicEffectCastingSoundC
GetMagicEffectBoltSound
GetMagicEffectBoltSoundC
GetMagicEffectHitSound
GetMagicEffectHitSoundC
GetMagicEffectAreaSound
GetMagicEffectAreaSoundC
SetMagicEffectCastingSound
SetMagicEffectCastingSoundC
SetMagicEffectBoltSound
SetMagicEffectBoltSoundC
SetMagicEffectHitSound
SetMagicEffectHitSoundC
SetMagicEffectAreaSound
SetMagicEffectAreaSoundC
SetMagicEffectLight
SetMagicEffectLightC
SetMagicEffectUsedObject
SetMagicEffectUsedObjectC
SetMagicEffectHitShader
SetMagicEffectHitShaderC
SetMagicEffectEnchantShader
SetMagicEffectEnchantShaderC
Numeric Functions: These get or set numeric/boolean properties of Magic Effects.
Syntax:
(value:numeric) GetMagicEffectXXX effect:refOrCode
(nothing) SetMagicEffectXXX newValue:numeric effect:refOrCode
GetMagicEffectNumCounters - returns the number of counter-effects for the magic effect
GetMagicEffectNumCountersC
GetMagicEffectResistValue - returns an actor value
GetMagicEffectResistValueC
GetNthMagicEffectCounter
GetNthMagicEffectCounterC
SetMagicEffectIsHostile
SetMagicEffectIsHostileC
SetMagicEffectCanRecover
SetMagicEffectCanRecoverC
SetMagicEffectIsDetrimental
SetMagicEffectIsDetrimentalC
SetMagicEffectMagnitudePercent
SetMagicEffectMagnitudePercentC
SetMagicEffectOnSelfAllowed
SetMagicEffectOnSelfAllowedC
SetMagicEffectOnTouchAllowed
SetMagicEffectOnTouchAllowedC
SetMagicEffectOnTargetAllowed
SetMagicEffectOnTargetAllowedC
SetMagicEffectNoDuration
SetMagicEffectNoDurationC
SetMagicEffectNoMagnitude
SetMagicEffectNoMagnitudeC
SetMagicEffectNoArea
SetMagicEffectNoAreaC
SetMagicEffectFXPersists
SetMagicEffectFXPersistsC
SetMagicEffectForSpellmaking
SetMagicEffectForSpellmakingC
SetMagicEffectForEnchanting
SetMagicEffectForEnchantingC
SetMagicEffectNoIngredient
SetMagicEffectNoIngredientC
SetMagicEffectUsesWeapon
SetMagicEffectUsesWeaponC
SetMagicEffectUsesArmor
SetMagicEffectUsesArmorC
SetMagicEffectUsesCreature
SetMagicEffectUsesCreatureC
SetMagicEffectUsesSkill
SetMagicEffectUsesSkillC
SetMagicEffectUsesAttribute
SetMagicEffectUsesAttributeC
SetMagicEffectUsesActorValue
SetMagicEffectUsesActorValueC
SetMagicEffectNoHitEffect
SetMagicEffectNoHitEffectC
SetMagicEffectSchool
SetMagicEffectSchoolC
SetMagicEffectBaseCost
SetMagicEffectBaseCostC
SetMagicEffectResistValue
SetMagicEffectResistValueC
SetMagicEffectEnchantFactor
SetMagicEffectEnchantFactorC
SetMagicEffectBarterFactor
SetMagicEffectBarterFactorC
SetMagicEffectProjectileSpeed
SetMagicEffectProjectileSpeedC
SetMagicEffectOtherActorValue
SetMagicEffectOtherActorValueC
Map Marker
A map marker is a reference to a static object of the type "mapmarker" defined as a default object in the editor. Map marker references have additional information such as a name, type of location, etc.
Qualities: Named
Functions:
IsMapMarkerVisible - returns 1 if the map marker can be seen on the player's map
(visible:bool) reference.IsMapMarkerVisible
SetMapMarkerVisible - sets whether the map marker can be seen on the player's map
(nothing) reference.SetMapMarkerVisible visible:bool
CanTravelToMapMarker - returns 1 if the player can travel to the map marker by clicking on it in the map menu
(canTravel:bool) reference.CanTravelToMapMarker
SetCanTravelToMapMarker - sets whether the player can travel to the map marker by clicking it in the map menu
(nothing) reference.SetCanTravelToMapMarker canTravel:bool
GetMapMarkerType - returns the type of icon used to represent the location on the map.
(markerType:short) reference.GetMapMarkerType
SetMapMarkerType - sets the type of icon used to represent the location on the map.
(nothing) reference.SetMapMarkerType markerType:short
NPC
Qualities: Actor, Class, Container , Magic Target
Values:
Equipped Items - NPC can equip and use items
Merchant Container - NPCS may have a merchant container which holds items they sell and buy
Functions:
GetEquippedObject - returns the base object of the item equipped in the specified slot
(objectID:ref) reference.GetEquippedObject slot:short
GetEquipmentSlotMask - Returns the base object of the first equipped object to match the specified equipment slot mask. If no 'value' parameter is specified, it is assumed to be the same value as the 'mask' parameter. For example, an object taking up the UpperBody, LowerBody, and Foot slots would have a mask of 4 + 8 + 32 = 44. See the "equipment slot bit assignments" list for more info.
(objectID:ref) reference.GetEquipmentSlotMask slotMask:long value:long
GetEquippedCurrentCharge
ModEquippedCurrentCharge
SetEquippedCurrentCharge
GetEquippedCurrentHealth
ModEquippedCurrentHealth
SetEquippedCurrentHealth
GetEquippedWeaponPoison
SetEquippedWeaponPoison
RemoveEquippedWeaponPoison
GetMerchantContainer - returns the reference to the NPC's merchant container
(containerReference:ref) npc.GetMerchantContainer
SetMerchantContainer - replaces the specified mechant's container and returns the old container. If the specified NPC does not have a merchant container, or if the passed reference is not a container the function does nothing and will return 0.
(oldContainerRef:ref) npc.SetMerchantContainer nuContainer:ref
GetHorse - returns the horse currently ridden by the calling NPC. Note that this function returns a reference while the NPC is in the process of walking toward a horse with the intention of mounting it.
(horse:ref) reference.GetHorse
GetTravelHorse - returns a reference to the travel horse used by the calling reference.
(horse:ref) reference.GetTravelHorse
IsFemale - returns 1 if the NPC is female.
(isFemale:bool) reference.IsFemale npc:ref
SetTravelHorse - Sets the travel horse used by the calling reference to the horse reference specified. Changes are not saved in the savegame.
(nothing) reference.SetTravelHorse horse:ref
CopyHair - Copies the hair style, length, and color from one NPC to another. Changes alter the base actor and are not saved in the savegame unless called on the player. Changes will not be visible until the actor is reloaded; calling disable followed by enable a frame later will force the NPC to reload, updating the hair. Changes do appear to be saved for the player, but may not be visible until the game is reloaded.
(nothing) reference.CopyHair copyFrom:ref copyTo:ref
CopyEyes - Copies the eyes used by one npc onto another, with the same caveats as CopyHair.
(nothing) reference.CopyEyes copyFrom:ref copyTo:ref
SetHair - Sets the hair on the NPC to a hairstyle predefined in the CS, with the same caveats as CopyHair.
(nothing) reference.SetHair hairStyle:ref npc:ref
SetEyes - Sets the eyes on the NPC to a set of eyes predefined in the CS, with the same caveats as CopyHair.
(nothing) reference.SetEyes eyes:ref npc:ref
GetRace - returns the race of an NPC.
(race:ref) reference.GetRace npc:ref
GetHair - returns the NPC's hairstyle
(hair:ref) reference.GetHair npc:ref
GetEyes - returns the NPC's eyes
(eyes:ref) reference.GetEyes npc:ref
GetHairColor - returns the RGB value of the NPC's hair color
(color:short) reference.GetHairColor npc:ref
GetTrainerLevel - returns the level at which the NPC offers training
(level:short) reference.GetTrainerLevel npc:ref
GetTrainerSkill - returns the skill in which the NPC offers training as an actor value code
(skill:short) reference.GetTrainerSkill npc:ref
SetTrainerLevel - sets the level at which an NPC offers training
(nothing) reference.SetTrainerLevel newLevel:short npc:ref
SetTrainerSkill - sets the skill in which an NPC offers training
(nothing) reference.SetTrainerSkill newSkill:actorValue npc:ref
GetServicesMask - returns an integer code representing the services offered by an NPC. The code is obtained by ORing (adding) service flags
(servicesMask:short) reference.GetServicesMask npc:ref
OffersServicesC - returns 1 if the NPC offers all of the services specified by the services mask
(offersServices:bool) reference.OffersServicesC serviceFlags:short npc:ref
SetOffersServicesC - sets the services offered by the NPC to the specified services mask.
(nothing) reference.SetOffersServicesC serviceFlags:short npc:ref
OffersXXX - these functions return 1 if the NPC offers the specified service
(offersService:bool) reference.OffersXXX npc:ref
OffersWeapons
OffersArmor
OffersClothing
OffersBooks
OffersLights
OffersIngredients
OffersApparatus
OffersMiscItems
OffersMagicItems
OffersSpells
OffersPotions
OffersTraining
OffersRecharging
OffersRepair
SetOffersXXX - these functions toggle the specified service offered by the NPC.
(nothing) reference.SetOffersXXX offersService:bool npc:ref
SetOffersWeapons
SetOffersArmor
SetOffersClothing
SetOffersBooks
SetOffersIngredients
SetOffersSpells
SetOffersLights
SetOffersMiscItems
SetOffersMagicItems
SetOffersApparatus
SetOffersPotions
SetOffersTraining
SetOffersRecharging
SetOffersRepair
SetOffersServicesC
GetServicesMask
Player
Qualities: Actor, Class, Container , Magic Target
Functions:
GetCrosshairRef - returns a reference to whatever is currently under the player's crosshair. Generally returns zero when called during menumode. Note that this function will return non-activatable references as well; use IsActivatable to determine if the reference can be activated normally.
(crosshairRef:ref) GetCrosshairRef
GetPlayersLastRiddenHorse - returns a reference to the horse most recently ridden by the player.
(horse:ref) GetPlayersLastRiddenHorse
(horse:ref) GetPCLastHorse
GetPlayersLastActivatedLoadDoor - returns a reference to the load door most recently activated by the player.
(loadDoor:ref) GetPlayersLastActivatedLoadDoor
(loadDoor:ref) GetPCLastLoadDoor
GetGodMode - returns 1 if the player has toggled god mode on
(godMode:bool) GetGodMode
SetPCAMurderer - sets whether the PC is a murderer or not
(nothing) SetPCAMurderer isMurderer:bool
GetPlayerSpell - returns the objectID of the player's current spell
(spell:ref) GetPlayerSpell
GetPlayerSpellCount - returns the player spell count
(count:long) GetSpellCount
GetNthPlayerSpell - returns the nth player spell. whichSpell is an index that starts at 0 for the first spell in the list. Note that the CS compiler doesn't expect spells to be returned as a ref. If you are calling this function multiple times to set the same ref variable you need to assign that variable to some other type (say a weapon) in between your calls to this function. Otherwise the ref will continue to keep the value from the first call.
(spell:ref) GetNthPlayerSpell whichSpell:long
(spell:ref) GetNthSpell whichSpell:long
GetPCMajorSkillUps - returns the number of major skill advancements toward the player's next level.
(skillUps:short) GetPCMajorSkillUps
SetPCMajorSkillUps - sets the number of major skill advancements toward the player's next level.
(nothing) SetPCMajorSkillUps skillUps:short
GetPCAttributeBonus - returns the number of skill advancements contributing to the specified attribute's bonus for the next level. Note that game setting multipliers applied to these values determine the actual bonus at level-up. Returns -1 if passed an invalid actor value, including Luck.
(bonus:short) GetPCAttributeBonus actorValue:string
SetPCAttributeBonus - sets the number of skill advancements contributing to the specified attribute's bonus for the next level. Note that game setting multipliers applied to these values determine the actual bonus at level-up. Does not affect Luck bonus.
(bonus:short) GetPCAttributeBonus actorValue:string bonus:short
GetTotalPCAttributeBonus - returns the sum of the player's attribute bonuses.
(bonus:short) GetTotalPCAttributeBonus
ModPCSpellEffectiveness - alters the script modifier applied to the player's spell effectiveness. This works similarly to Oblivion's ModAV command. Positive values increases the modifier, negative values decrease it. Any game calculations involving player spell effectiveness will use the modified value (base effectiveness + modifier).
(nothing) ModPCSpellEffectiveness modBy:float
GetPCSpellEffectivenessModifier - returns the current value of the script modifier for player spell effectiveness. Subtract this value from the return value of Player.GetSpellEffectiveness to get the player's base spell effectiveness.
(modifier:float) GetPCSpellEffectivenessModifier
GetPCTrainingSessionsUsed - returns the number of times the player has trained during his current level
(numSessions:short) GetPCTrainingSessionsUsed
SetPCTrainingSessionsUsed - sets the number of times the player has trained during his current level
(nothing) SetPCTrainingSessionsUsed numSessions:short
ModPCMovementSpeed* - applies a positive or negative modifier to the player's speed attribute as used in calculating his movement speed while swimming, walking, or running. The actual attribute is not modified, but movement calculations use the attribute value plus the modifier. Positive modifiers well above the maximum value of the speed attribute are permitted and effective; minimum speed including the modifier is limited to zero.
(nothing) ModPCMovementSpeed modBy:float
GetPCMovementSpeedModifier* - returns the current modifier applied to the player's speed for use in movement speed calculations. Because multiple mods may change the modifier this command returns the sum of all calls to ModPCMovementSpeed.
(modifier:float) GetPCMovementSpeedModifier
Projectile
A reference to an arrow or magic projectile in the gameworld. Note that these references are destroyed by the game after a certain period of time. If stored in a reference variable, make sure the reference is still valid before using it in a function. Also note that calling GetBaseObject on a magic projectile will return the same reference; in other words, magic projectile references are their own base objects.
Functions:
GetProjectileType - returns the type of the projectile
(projectileType:short) reference.GetProjectileType
GetProjectileSource - returns the caster of a magic projectile or the archer who fired an arrow projectile.
(source:ref) reference.GetProjectileSource
GetMagicProjectileSpell - returns the spell attached to a magic projectile
(spell:ref) reference.GetMagicProjectileSpell
(enchantment:ref) reference.GetMPSpell
SetMagicProjectileSpell - changes the spell attached to a magic projectile
(nothing) reference.SetMagicProjectileSpell newSpell:ref
(enchantment:ref) reference.SetMPSpell newSpell:ref
GetArrowProjectileEnchantment - returns the enchantment on an arrow projectile
(enchantment:ref) reference.GetArrowProjectileEnchantment
(enchantment:ref) reference.GetAPEnch
GetArrowProjectileBowEnchantment - returns the enchantment on an arrow derived from the bow from which it was fired
(enchantment:ref) reference.GetArrowProjectileBowEnchantment
(enchantment:ref) reference.GetAPBowEnch
GetArrowProjectilePoison - returns the poison on an arrow projectile
(poison:ref) reference.GetArrowProjectilePoison
(poison:ref) reference.GetAPPoison
SetPlayerProjectile - sets the player as the source of the projectile. Actors hit by the projectile will react as if the player had cast the spell or fired the arrow.
(nothing) reference.SetPlayerProjectile
SetProjectileSource - sets the source of a projectile. If an actor other than the player is set as the source, the target of the projectile will not necessarily respond to the attack.
(nothing) reference.SetProjectileSource actor:ref
SetArrowProjectileEnchantment - sets the arrow enchantment associated with the calling projectile
(nothing) reference.SetArrowProjectileEnchantment enchantment:ref
SetArrowProjectileBowEnchantment - sets the bow enchantment associated with the calling projectile
(nothing) reference.SetArrowProjectileBowEnchantment enchantment:ref
SetArrowProjectilePoison - sets the poison on the calling projectile
(nothing) reference.SetArrowProjectilePoison poison:ref
GetProjectileSpeed - returns the speed of the projectile
(speed:float) reference.GetProjectileSpeed
GetProjectileDistanceTraveled - returns the total distance traveled by the calling projectile. Currently does not work for arrow projectiles.
(distance:float) reference.GetProjectileDistanceTraveled
GetProjectileLifetime - returns the number of seconds for which the calling projectile has existed.
(lifetime:float) reference.GetProjectileLifetime
SetProjectileSpeed - sets the speed of the projectile. Note that other factors affect the movement of a projectile so a speed of zero does not necessarily completely halt the projectile.
(nothing) reference.SetProjectileSpeed speed:float
GetProjectile - returns the projectile most recently fired by the calling actor. Optionally specify the type (1 for arrows, 2 for magic, 0 for either) and the arrow, spell, or staff enchantment to match.
(projectile:ref) reference.GetProjectile type:short arrowOrMagicItemID:ref
Reference
An instance of an object in the gameworld. In general, a reference has access to the functions associated with its base type as well.
Qualities: Lockable, Ownable
Functions:
GetParentCell - returns the objectID of the parent cell of the calling reference
(parentCell:ref) reference.GetParentCell
GetParentWorldspace* - returns the worldspace to which the calling reference's cell belongs, if any. In interior cells this generally returns 0.
(parentWorldspace:ref) reference.GetParentWorldspace
GetCurrentRegion* - returns the region in which the player is currently located, if any. In interior cells generally returns 0.
(region:ref) GetCurrentRegion
ParentCellHasWater - returns 1 if the reference's parent cell can contain water
(hasWater:bool) reference.ParentCellHasWater
(hasWater:bool) reference.HasWater
GetParentCellWaterHeight - returns the water height of the references parent cell
(waterHeight:float) reference.GetParentCellWaterHeight
(waterHeight:float) reference.GetWaterHeight
IsActivatable - returns 1 if the calling reference can be activated under normal circumstances.
(activatable:bool) reference.IsActivatable
IsUnderWater - returns 1 if the calling reference's Z position is less than 120 units under its parent cell's water height
(isUnderWater:bool) reference.IsUnderWater
GetNumChildRefs - returns the number of reference for which the calling reference behaves as an enable-state parent
(numChildren:short) reference.GetNumChildRefs
GetNthChildRef - returns the nth child reference associated with the calling reference. Child references are stored in no particular order.
(childRef:ref) reference.GetNthChildRef whichChild:short
GetNumFollowers - returns the number of actors currently following the calling actor. Summoned creatures are excluded.
(numFollowers:short) reference.GetNumFollowers
GetNthFollower - returns a reference to the nth actor currently following the calling actor. Does not include summoned creatures.
(follower:ref) reference.GetNthFollower whichFollower:short
GetFollowers - returns an array containing all actors currently following the calling actor, including summoned creatures.
(followers:array) reference.GetFollowers
IsPersistent - returns 1 if the calling reference is a persistent reference.
(isPersistent:bool) reference.IsPersistent
SetScaleEX - sets the scale of the calling reference. Unlike SetScale, the scale is not limited to a certain range. The reference should be disabled and then enabled after calling this function in order to update its scale and collision properties. The new scale is saved in the savegame.
(nothing) reference.SetScaleEX scale:float
HasBeenPickedUp - returns true if the calling reference is currently inactive due to having been picked up by an actor or otherwise transferred to an inventory.
(pickedUp:bool) reference.HasBeenPickedUp
(pickedUp:bool) reference.IsTaken
SetHasBeenPickedUp - toggles the flag that marks a reference as having been picked up by an actor. When called on a reference which was previously picked up, causes the reference to "respawn". The reference must be disabled and then enabled for the change to become visible.
(nothing) reference.SetHasBeenPickedUp pickedUp:bool
(nothing) reference.SetTaken pickedUp:bool
GetRefCount - returns the number of items in a stack of items in the world.
(refCount:short) reference.GetRefCount
SetRefCount - sets the number of items in a stack of items in the world. Note that while this function will change the count of any type of reference, it may have unpredictable results when used on references like NPCs which are not logically stackable.
(nothing) reference.SetRefCount newCount:short
SetBaseForm - changes the base object associated with a reference, with the limitation that the new base form must be of the same type as the old one (i.e. you can swap a weapon reference's base form only with another weapon). Does not work on actors or on items in containers. The reference must be disabled and then enabled in order for the change to be visible. This function is considered beta.
(nothing) reference.SetBaseForm newBaseForm:ref
Activate2* - like the existing Activate command, causes a reference to be activated. The only difference is that this command circumvents the limit on recursive scripted activations of an object, allowing unlimited repeated processing of the target's OnActivate script block. Use with care as performance may degrade if a large number of calls to this command occur within a single frame.
(nothing) reference.Activate2 activator:ref runOnActivate:bool
IsRefDeleted* - returns 1 if the passed object reference has been marked as deleted by a mod or the game. Deleted references should not be used in scripts. Note that the reference is passed as a parameter - this function should not be called on a potentially deleted reference directly.
(isDeleted:bool) IsRefDeleted reference:ref
DeleteReference* - attempts to delete the calling object from the game and returns true if successful. In order for a reference to be deleted, it must:
-be disabled
-not be an actor
-not be contained in an inventory
-be dynamic (i.e. generated via PlaceAtMe or dropped from an inventory, having a mod index of 0xFF)
The primary aim of this function is to combat the savegame bloat resulting from generation of large numbers of dynamic references. In most cases, it is better to avoid creating such bloat in the first place. (Note: IsRefDeleted is not related to this command in any way).
(wasRefDeleted:bool) reference.DeleteReference
Skill
Qualities:
Values:
Attribute - short the controlling character attribute
Specialization - short the corresponding specialization
UseValue - float One of two values used to increment the experience toward the next skill level based on an action
Experience - float the current player experience points for the skill
Functions:
GetPlayerSkillUse - returns the current experience towards the next level of the skill
(skillExperience:float) GetPlayerSkillUse skill:short
IncrementPlayerSkillUse - records some additional uses of one of the skill actions
(nuSkillExperience:float) IncrementPlayerSkillUse skill:short whichAction:short howManyTimes:float
GetSkillUseIncrement - gets the experience point increase for one use of a skill action
(useRate:float) GetSkillUseIncrement skill:short whichAction:short
SetSkillUseIncrement - sets the experience point increase for one use of a skill action
(nothing) SetSkillUseIncrement nuRate:float skill:short whichAction:short
IncrementPlayerSkillUseC* - records some additional uses of one of the skill actions
(nuSkillExperience:float) IncrementPlayerSkillUse skill:actorValueCode whichAction:short howManyTimes:float
GetSkillUseIncrementC* - gets the experience point increase for one use of a skill action
(useRate:float) GetSkillUseIncrement skill:actorValueCode whichAction:short
SetSkillUseIncrementC* - sets the experience point increase for one use of a skill action
(nothing) SetSkillUseIncrement nuRate:float skill:actorValueCode whichAction:short
Soul Gem
Qualities: Inventory, Named, Simple
Values:
Soul Level - the soul level currently captured in the soul gem
Capacity - the maximum soul level that can be captured in the soul gem
Functions:
GetSoulLevel - returns the soul level currently in the soul gem
(soulLevel:short) GetSoulLevel objectID:ref
GetSoulGemCapacity - returns the max soul level the soul gem can contain
(soulLevel:short) GetSoulGemCapacity objectID:ref
(nothing) SetSoulLevel soulLevel:short objectID:ref
(nothing) SetSoulGemCapacity soulLevel:short objectID:ref
GetCurrentSoulLevel - returns the current soul level of the calling reference
(soulLevel:short) GetCurrentSoulLevel
Spell
Qualities: Magic, Named
Value:
Spell Type - short the kind of spell. Spell Types.
Magicka Cost - long the cost in magicka for casting the spell
Mastery Level - short the skill mastery level needed to cast the spell. Spell Mastery Levels.
Functions:
GetSpellType - returns the spell type
(spellType:short) GetSpellType spell:ref
SetSpellType - sets the spell type
(nothing) SetSpellType nuType:short spell:ref
GetSpellMagickaCost - returns the magicka casting cost according to the Oblivion formula. If called on a reference it will use the reference's magic skill values to determine the actual magicka cost of the spell. Without a reference it will return the base cost of the spell as reported in the CS.
(magickaCost:long) reference.GetSpellMagickaCost spell:ref
SetSpellMagickaCost - sets the magicka casting cost
(nothing) SetSpellMagickaCost nuMagickaCost:long spell:ref
ModSpellMagickaCost - modifies the magicka casting cost up or down
(nothing) ModSpellMagickaCost modifyBy:float spell:ref
GetSpellMasteryLevel - returns the mastery level of the spell
(masteryLevel:short) GetSpellMasteryLevel spell:ref
SetSpellMasteryLevel - sets the mastery level of the spell
(nothing) SetSpellMasteryLevel masteryLevel:short objectID:ref
GetSpellSchool - returns the school of the spell, determined by the most expensive effect item
(magicSchool:short) GetSpellSchool spell:ref
GetSpellExplodesWithNoTarget - returns whether the touch spell explodes without a target
(spellExplodesWithNoTarget:bool) GetSpellExplodesWithNoTarget spell:ref
SetSpellExplodesWithNoTarget - sets whether the touch spell will explode without a target
(nothing) SetSpellExplodesWithNoTarget doesSpellExpode:bool spell:ref
IsSpellHostile - returns 1 if the spell is considered hostile
(isHostile:bool) IsSpellHostile spell:ref
SetSpellHostile - toggles whether or not a spell is considered hostile.
(nothing) SetSpellHostile spell:ref isHostile:bool
Weapon
Qualities: Attacking, Breakable, Enchantable, Equippable, Inventory, Named, Simple
Values:
Reach - float the distance from the wielder the weapon can reach
Weapon Type - short the type of weapon
Poison - ref the poison currently applied to the weapon
Functions:
GetWeaponReach - returns the reach of the weapon
(reach:float) reference.GetWeaponReach objectID:ref
SetWeaponReach - sets the reach of the weapon
(nothing) reference.SetWeaponReach nuReach:float objectID:ref
ModWeaponReach - modifies the reach of the weapon up or down
(nothing) reference.ModWeaponReach modifyBy:float objectID:ref
GetWeaponType - retuns the weapon type
(weaponType:short) reference.GetWeaponType objectID:ref
SetWeaponType - sets the weapon type
(nothing) reference.SetWeaponType weaponType:short objectID:ref
GetEquippedWeaponPoison - returns the poison applied to the equipped weapon. Called on the weapon holder.
(poison:ref) reference.GetEquippedWeaponPoison
SetEquippedWeaponPoison - sets the poison applied to the equipped weapon and returns the previous poison. Called on the weapon holder.
(oldPoison:ref) reference.SetEquippedWeaponPoison nuPoison:ref
RemoveEquippedWeaponPoison - removes and returns the poison applied to the equipped weapon. Called on the weapon holder.
(oldPoison:ref) reference.RemoveEquippedWeaponPoison
Weather
Qualities:
Values: CS Wiki Page Info
Note - short floats are stored internally as 0-255 but are exposed in the CS and through the API as a float
Wind Speed - short float
Cloud Speed - short float
Trans Delta - short float
Sun Glare - short float
Sun Damage - short float
Fog Distances (near/far for night/day) - float
HDR Values - float
Weather Colors - float the color of the weather for different weather times
Lightning Frequency - short a value which determines the rate of lightning flashes. Scaled from 1 (high) to 255 (low)
Functions:
GetCurrentWeatherID - returns the refID of the current weather
(currentWeather:ref) GetCurrentWeatherID
GetWeatherWindSpeed - returns the wind speed of the specified weather
(windSpeed:float) GetWeatherWindSpeed weather:ref
(windSpeed:float) GetWindSpeed weather:ref
SetWeatherWindSpeed - sets the wind speed of the specified weather
(nothing) SetWeatherWindSpeed speed:float weather:ref
(nothing) SetWindSpeed speed:float weather:ref
GetWeatherCloudSpeedLower - returns the speed of the lower cloud layer
(speed:float) GetWeatherCloudSpeedLower weather:ref
(speed:float) GetCloudSpeedLower weather:ref
SetWeatherCloudSpeedLower - sets the speed of the lower cloud layer
(nothing) SetWeatherCloudSpeedLower speed:float weather:ref
(nothing) SetCloudSpeedLower speed:float weather:ref
GetWeatherCloudSpeedUpper - returns the speed of the upper cloud layer
(speed:float) GetWeatherCloudSpeedUpper weather:ref
(speed:float) GetCloudSpeedUpper weather:ref
SetWeatherCloudSpeedUpper - sets the speed of the upper cloud layer
(nothing) SetWeatherCloudSpeedUpper speed:float weather:ref
(nothing) SetCloudSpeedUpper speed:float weather:ref
GetWeatherTransDelta - returns the transition delta of the weather
(transDelta:float) GetWeatherTransDelta weather:ref
(transDelta:float) GetTransDelta weather:ref
SetWeatherTransDelta - sets the transition delta of the weather
(nothing) SetWeatherTransDelta transDelta:float weather:ref
(nothing) SetTransDelta transDelta:float weather:ref
GetWeatherSunGlare - returns the sun glare
(sunGlare:float) GetWeatherSunGlare weather:ref
(sunGlare:float) GetSunGlare weather:ref
SetWeatherSunGlare - sets the sun glare
(nothing) SetWeatherSunGlare sunGlare:float weather:ref
(nothing) SetSunGlare sunGlare:float weather:ref
GetWeatherSunDamage - returns the sun damage
(sunDamage:float) GetWeatherSunDamage weather:ref
(sunDamage:float) GetSunDamage weather:ref
SetWeatherSunDamage - sets the sun damage
(nothing) SetWeatherSunDamage sunDamage:float weather:ref
(nothing) SetSunDamage sunDamage:float weather:ref
GetWeatherFogDayNear - returns the daytime near fog distance
(fogDistance:float) GetWeatherFogDayNear weather:ref
(fogDistance:float) GetFogDayNear weather:ref
SetWeatherFogDayNear - sets the daytime near fog distance
(nothing) SetWeatherFogDayNear fogDistance:float weather:ref
(nothing) SetFogDayNear fogDistance:float weather:ref
GetWeatherFogDayFar - returns the daytime far fog distance
(fogDistance:float) GetWeatherFogDayFar weather:ref
(fogDistance:float) GetFogDayFar weather:ref
SetWeatherFogDayFar - sets the daytime far fog distance
(nothing) SetWeatherFogDayFar fogDistance:float weather:ref
(nothing) SetFogDayFar fogDistance:float weather:ref
GetWeatherFogNightNear - returns the nighttime near fog distance
(fogDistance:float) GetWeatherFogNightNear weather:ref
(fogDistance:float) GetFogNightNear weather:ref
SetWeatherFogNightNear - sets the nighttime near fog distance
(nothing) SetWeatherFogNightNear fogDistance:float weather:ref
(nothing) SetFogNightNear fogDistance:float weather:ref
GetWeatherFogNightFar - returns the nighttime far fog distance
(fogDistance:float) GetWeatherFogNightFar weather:ref
(fogDistance:float) GetFogNightFar weather:ref
SetWeatherFogNightFar - sets te nighttime far fog distance
(nothing) SetWeatherFogNightFar fogDistance:float weather:ref
(nothing) SetFogNightFar fogDistance:float weather:ref
GetWeatherHDRValue - returns the specified HDR value for the weather
(hdrValue:float) GetWeatherHDRValue whichHDRValue:short weather:ref
(hdrValue:float) GetHDRValue whichHDRValue:short weather:ref
SetWeatherHDRValue - sets the specified HDR value for the weather
(oldHDRValue:float) SetWeatherHDRValue nuVal:float whichHDRValue:short weather:short
(oldHDRValue:float) SetHDRValue nuVal:float whichHDRValue:short weather:short
GetWeatherColor - returns the red, green or blue value of the specified weather color at the specified weather time
(color:short) GetWeatherColor rgb:short whichColor:short weather:ref whichTime:short
SetWeatherColor - sets the red, green and blue values for the specified weather color at the specified weather time
(nothing) SetWeatherColor red:short green:short blue:short whichColor:short weather:ref whichTime:short
GetWeatherLightningFrequency - returns the frequency of the lightning
(frequency:short) GetWeatherLightningFreuency weather:ref
(frequency:short) GetLightningFreuency weather:ref
SetWeatherLightningFrequency - sets the frequency of the lightning
(nothing) SetWeatherLightningFrequency frequency:short weather:ref
(nothing) SetLightningFrequency frequency:short weather:ref
General Functions
IsDoor - returns whether the calling reference or passed objectID is a door
(isDoor:bool) reference.IsDoor objectID:ref
IsFurniture - returns whether the calling reference or passed objectID is furniture
(isFurniture:bool) reference.IsFurniture objectID:ref
IsActivator - returns whether the calling reference or passed objectID is an activator
(isActivator:bool) reference.IsActivator objectID:ref
GetGameLoaded - returns 1 if the game was loaded since the last time this call was made
(gameLoaded:bool) GetGameLoaded
GetGameRestarted - returns 1 if Oblivion was exited and restarted since the last time this call was made from the calling script. Use this condition to reset or undo changes made by OBSE functions which are not stored in the savegame.
(gameRestarted:bool) GetGameRestarted
GetOBSEVersion - returns the version number of OBSE
(obseVersion:long) GetOBSEVersion
GetOBSERevision - returns the minor version number of OBSE. For instance, when running the second released version of v0014, this function returns 2.
(obseRevision:long) GetOBSERevision
SetNumericGameSetting - sets the specified game setting to the following variable or direct value
(nothing) SetNumericGameSetting gameSettingName:string value:float
GetStringGameSetting - returns the string value of a game setting.
(setting:string_var) GetStringGameSetting settingName:string
SetStringGameSettingEX - sets the string value of a game setting. The new string value is contained within the format string, following the setting name and separated by a pipe character, i.e. "nameOfGameSetting|newValueOfGameSetting". When calling from the console, use '@' instead of the pipe character.
(nothing) SetStringGameSettingEX settingNameAndNewValue:formatString
GetNumericINISetting - returns the specified ini setting
(setting:float) GetNumericINISetting iniSettingName:string
SetNumericINISetting - sets the specified ini setting to the following variable or direct value
(nothing) SetNumericINISetting iniSettingName:string value:float
GetStringINISetting - returns the value of a string ini setting.
(setting:string_var) GetStringINISetting settingName:formatString
SetStringINISetting - sets the ini setting to the specified string. Pass both arguments as a single string of the format "settingName|newValue". If called from the console, use the "@" character in place of the pipe character.
(nothing) SetStringINISetting settingNameAndValue:formatString
GetFPS - returns the frames per second of the game
(fps:float) GetFPS
IsThirdPerson - returns whether the point of view is 3rd person or not
(isThirdPerson:bool) IsThirdPerson
IsGlobalCollisionDisabled - returns whether collision is disabled
(isDisabled:bool) IsGlobalCollisionDisabled
SetDisableGlobalCollision - sets whether to disable the global collision or not
(nothing) SetDisableGlobalCollision toDisableOrNot:bool
RunBatchScript - runs a specified text file under the Oblivion directory as a script. Works the same as the console function bat. The optional second parameter causes the script to execute on the calling object, if any.
(nothing) reference.RunBatchScript bRunOnRef:bool
IsPluginInstalled - returns whether a given plugin is installed
(isInstalled:bool) IsPluginInstalled pluginName:string
GetPluginVersion - returns the version of the specified plugin
(version:long) GetPluginVersion pluginName:string
GetDebugSelection - returns the reference to the item last selected in the console
(selection:ref) GetDebugSelection
GetSoundPlaying - If no parameters are passed, then it dumps a list of the currently playing sounds and actors making sound to obse.log (this may change). If a string is passed, then it returns the number of times the specified sound is playing. The string may contain wildcards: matches several characters, and ? matches one character. If a reference is passed in, then the search is restricted to that reference, returning the number of times it is playing that sound. Some sounds are not associated with objects, so if you pass in a "fuzzy check radius" parameter, it returns the number of times the sound is playing within the specified radius around the reference.
(playingCount:long) reference.GetSoundPlaying soundName:string fuzzyCheckRadius:float
RunScriptLine - runs a line of script as if it were called from the console. If bRunOnRef is 1, the line of script will be executed on the calling object, if any.
(nothing) reference.RunScriptLine formatString:string var1 var2 ... var20 bRunOnRef:bool
GetFormFromMod - attempts to look up and return a form defined in another mod, prepending the two-digit mod index to the formID. The formID is passed in hexadecimal format, i.e. 0001A46B. The first two digits of the formID are ignored and can be omitted. The formID must be passed as a literal value as script variables don't have the precision necessary to store all possible formIDs.
(form:ref) GetFormFromMod modFileName:string formID:hexString
ToggleFirstPerson - toggles the player's POV to first or third person. Passing 1 enables first person view, 0 enables third person.
(nothing) ToggleFirstPerson toFirstPerson:bool
GetLastCreatedSpell - returns the spell most recently created by the player during the current game session.
(spell:ref) GetLastCreatedSpell
GetLastEnchantedItem - returns the enchanted item most recently created by the player during the current game session.
(item:ref) GetLastEnchantedItem
GetLastCreatedPotion - returns the potion most recently created by the player during the current game session.
(potion:ref) GetLastCreatedPotion
GetLastUniqueCreatedPotion - returns the last unique potion created by the player. The game remembers which potions the player has created in the past. The first time the player creates a potion of a given magnitude and effects, that potion will be returned by GetLastUniqueCreatedPotion. Subsequently, creating a potion of the same effects and magnitude will not create a unique potion and so the potion will not be returned by this command.
(potion:ref) GetLastUniqueCreatedPotion
IsConsoleOpen - returns 1 if the console is currently open.
(open:bool) IsConsoleOpen
LoadGameEx - attempts to load the saved game with the specified name.
(nothing) LoadGameEx formatString:string var1 var2 ... var20
ActorValueToString* - converts an actor value to its localized name
(actorValueName:string) ActorValueToString toConvert:actorValue
(actorValueName:string) AVString toConvert:actorValue
ActorValueToStringC* - converts an actor value code to its localized name.
(actorValueName:string) ActorValueToStringC toConvert:actorValueCode
GetEditorID* - attempts to retrieve the editorID for the specified object. EditorIDs for most forms are not loaded at run-time. Currently this function only returns editor IDs for cells and quests.
(editorID:string) GetEditorID object:ref
GetFormIDString* - returns the formID of the specified object as a hexadecimal string
(formID:string) reference.GetFormIDString object:ref
Cloning Functions
The cloning functions are special. They are declared as taking Inventory Objects so any inventory object can be passed as a raw name from the CS. However you can clone any form by first assigning it to a ref and then passing that ref to CloneForm.
CloneForm - creates and returns a new base object that is an exact copy of the passed objectID
(clonedForm:ref) CloneForm objectID:ref
Examples:
ref clonedInventoryItem
ref clonedSpell
ref originalSpell
set clonedInventoryItem to CloneForm WeapSteelShortsword
set originalSpell to StandardCalmTouch1Novice
set clonedSpell to CloneForm originalSpell
IsClonedForm - returns whether the passed objectID is a cloned form or not. A cloned form is saved as part of the save game. Instances of cloned forms are player created potions, spells and enchanted items
(isCloned:bool) IsClonedForm objectID:ref
Flow Control Functions
OBSE supports several types of commands for altering the flow of execution within a script. The simplest are Label and Goto, which allow unconditional jumps from one location in a script to a previous location. While loops cause execution to remain within the loop until the specified expression becomes false. ForEach loops iterate over the elements of an array or string.
ForEach and While loops both define structured blocks in the same way that if and endif or begin and end do. Every while or foreach in a script must be matched by exactly one Loop command. Examples of good and bad loops:
while (expr)
do stuff
loop ; good
while (expr)
if (something)
loop ; BAD, Loop must be on same level of indentation as While
endif
Break and Continue statements are only valid within a loop body. Goto should never be used within a loop body to jump to a label defined outside of the loop's body.
Label - save the location of the command following the SaveIP command
(nothing) SaveIP slot:long
(nothing) Label slot:long
Goto - jump to a previously saved location
(nothing) RestoreIP slot:long
(nothing) Goto slot:long
While - evaluates an OBSE expression. If the expression is true, the statements following it will be executed until the next Loop command, at which point control returns to the top of the loop and the expression is evaluated again.
(nothing) While expression
ForEach - ForEach is used to iterate over the elements of an array or the characters in a string. The syntax ForEach item <- collection is used to indicate the variable (item) which will hold the current element and the string or array (collection) from which elements will be drawn. On loop entry, item is set to the first element in collection. When the next Loop command is encountered, item is set to the next element in collection and execution returns to the top of the loop. The loop terminates when all elements have been returned. The type of item varies based on the type of collection.
For arrays, item is an array_var, specifically a StringMap. The loop will initialize item with two elements: "key", which holds the key of the current element, and "value", which holds the value associated with that key. Within a ForEach loop you can access both fields via item["key"] and item["value"].
(nothing) ForEach iterator:array_var <- sourceArray:array
For strings, item is a string_var. The loop initializes item to the first character in the string; on each successive iteration item contains the next character in the string.
(nothing) ForEach iterator:string_var <- sourceString:string
Loop - Returns execution to the most recent While or ForEach command. The loop condition is evaluated and if it passes, execution continues inside the body of the loop. Otherwise, execution returns to the instruction immediately following the Loop command.
(nothing) Loop
Break - Must be called inside of a ForEach or While loop. Break causes the loop to exit immediately, forcing execution to jump to the instruction immediately following the next Loop command.
(nothing) Break
Continue - Must be called inside of a ForEach or While loop. Continue skips the rest of the body of a loop, returning execution to the top of the loop and evaluating the loop condition. If the condition passes, execution enters the loop body, otherwise the loop terminates and continues from the instruction following the corresponding Loop command.
(nothing) Continue
Ref Walking Functions
GetFirstRef - returns the first reference in the current cell. A type can optionally be supplied to return only references matching that type. Additionally, you can pass 69 for actors and 70 for inventory items. This function should be used only within a Label/Goto loop and GetNextRef. An optional cell depth can be supplied to specify the number of adjacent cells to scan in exteriors; a cell depth of 1 scans the player's current cell plus 8 adjacent cells, a depth of 2 scans the player's cell plus 25 adjacent cells. By default, inactive references to items which were previously picked up by an actor are ignored; passing 1 for the third parameter will force those references to be included.
(reference:ref) GetFirstRef type: short cellDepth:short includeInactiveRefs:short
GetNextRef - returns the next reference in the curent cell. GetFirstRef must be called first; this function uses the cell depth and type passed to GetFirstRef and returns the next reference matching that type, or zero after the last reference has been returned. This function should only be used within a Label/Goto loop.
(reference:ref) GetNextRef
GetNumRefs - returns the number of references in the current cell which match the optionally supplied type code. Use 69 for actors and 70 for inventory items. An optional cell depth can be specified for exteriors. By default, inactive references to items which were previously picked up by an actor are ignored; passing 1 for the third parameter will force those references to be included.
(numRefs:short) GetNumRefs type: short cellDepth:short includeInactiveRefs:short
GetFirstRefInCell - Works the same as GetFirstRef but takes an additional parameter specifying the cell to scan. Note that if the specified is not loaded in memory, this function will only return persistent references. Use GetNextRef to iterate through the rest of the references in the cell.
(reference:ref) GetFirstRefInCell cell:ref type: short cellDepth:short includeInactiveRefs:short
GetNumRefsInCell - Works the same as GetNumRefs but takes an additional parameter specifying the cell to scan. Only counts persistent references if the cell is not loaded in memory.
(numRefs:short) GetNumRefsInCell cell:ref type: short cellDepth:short includeInactiveRefs:short
Example of ref looping (transfers all carriable items in the cell to the player's inventory):
ref nextItem
begin onActivate
set nextItem to GetFirstRef 70 ; get first carriable item
Label 10
if ( nextItem ) ; continue until all refs are processed
nextItem.activate player ; give the item to the player
set nextItem to getNextRef
Goto 10
endif
end
Console Functions
Some of the console commands have been exposed as scripting commands. In many cases, their functionality is not completely documented, and as they were not designed to be used via scripts, strange behavior may occur when using them. The primary thing to expect is changes not being saved in the player's savedata file.
con_CAL
con_GetINISetting
con_HairTint
con_LoadGame
con_ModWaterShader
con_QuitGame
con_RefreshINI
con_RunMemoryPass
con_Save
con_SavINI
con_SetCameraFOV
con_SetClipDist
con_SetFog
con_SetGameSetting
con_SetGamma
con_SetHDRParam
con_SetImageSpaceGlow
con_SetINISetting
con_SetSkyParam
con_SetTargetRefraction
con_SetTargetRefractionFire
con_SexChange
con_TCL
con_TFC
con_TGM
con_ToggleAI
con_ToggleCombatAI
con_ToggleDetection
con_ToggleMenus
con_WaterDeepColor
con_WaterReflectionColor
con_WaterShallowColor
con_PlayerSpellBook
con_ToggleMapMarkers
con_Show1stPerson
Input Functions
IsKeyPressed - returns whether the specified key is currently pressed. Uses standard windows key codes.
(isKeyPressed:bool) IsKeyPressed windowsKeyCode:long
IsKeyPressed2 - returns whether the specified key is currently pressed. Uses DX scancodes.
(isKeyPressed:bool) IsKeyPressed2 dxScanCode:long
GetKeyPress - returns the DX scan code of the key being pressed. If more than one key is pressed use whichIndex to choose which keycode to return.
(keyPressed:long) GetKeyPress whichIndex:long
GetNumKeysPressed - returns the number of keys currently pressed
(count:long) GetNumKeysPressed
DisableKey - disables the key with the specified dx scancode
(nothing) DisableKey dxScanCode:long
EnableKey - enables the key with the specified dx scancode. Turns off DisableKey.
(nothing) EnableKey dxScanCode:long
HoldKey - holds down the key with the specified dx scancode
(nothing) HoldKey dxScanCode:long
MenuHoldKey - holds down the key with the specified dx scancode when a menu is open
(nothing) MenuHoldKey dxScanCode:long
ReleaseKey - releases a held key with the specified dx scancode
(nothing) ReleaseKey dxScanCode:long
MenuReleaseKey - releases a held key with the specified dx scancode when a menu is open
(nothing) ReleaseKey dxScanCode:long
TapKey - presses the key with the specidied dx scancode once
(nothing) TapKey dxScanCode:long
MenuTapKey - presses the key with the specificed dx scancode once when a menu is open
(nothing) MenuTapKey dxScanCode:long
HammerKey - fakes keypresses every other frame of the key with the specified dx scancode
(nothing) HammerKey dxScanCode:long
AHammerKey - fakes keypresses every other frame on the alternate frames from HammerKey of the key with the specified dx scancode
(nothing) AHammerKey dxScanCode:long
UnHammerKey - stops hammering the key with the specified dx scancode
(nothing) UnHammerKey dxScanCode:long
GetControl - returns the dx scancode of the key used for the specified control
(dxScanCode:long) GetControl whichControl:short
GetAltControl2 - returns the dx scancode of the alternate key used for the specified control. Unlike GetAltControl, the return value of this function is a valid DX scan code which requires no further calculation for use with other input functions.
(dxScanCode:long) GetAltControl2 whichControl:short
GetMouseButtonPress - returns the dx scancode of the mouse button being pressed. If more than one mouse button is pressed, use whichIndex to choose which code to return
(dxScanCode:long) GetMouseButtonPress whichIndex:long
GetNumMouseButtonsPressed - returns the number of mouse buttons pressed.
(count:long) GetNumMouseButtonsPressed
DisableMouse - prevents the mouse from moving
(nothing) DisableMouse
EnableMouse - turns off DisableMouse
(nothing) EnableMouse
MoveMouseX - moves the mouse horizontally the specified number of pixels
(nothing) MoveMouseX pixels:long
MoveMouseY - moves the mouse veritcally the specified number of pixels
(nothing) MoveMouseY pixels:long
SetMouseSpeedX - moves the mouse in the horizontal axis at the specified number of pixels per second
(nothing) SetMouseSpeedX pixels:float
SetMouseSpeedY - Moves the mouse in the vertical axis at the specified number of pixels per second.
(nothing) SetMouseSpeedY pixels:float
IsKeyPressed3 - returns 1 if the key or mouse button specified is currently pressed. Just like IsKeyPressed2, but detects disabled keys.
(isPressed:bool) IsKeyPressed3 dxScanCode:long
IsControlPressed - returns 1 is either the key or mouse button assigned to the specified control code is currently pressed. Detects disabled keys.
(isPressed:bool) IsControlPressed whichControl:short
DisableControl - disables both the key and mouse buton assigned to the specified control
(nothing) DisableControl whichControl:short
EnableControl - enables the key and mouse button for a control disabled with DisableControl.
(nothing) EnableControl whichControl:short
OnKeyDown -Registers a script as a listener for input events. Returns 1 for one frame when the passed key or mouse button is pressed. If used by multiple scripts, each script will be informed of the key's state. Will not return true again until the key is released and then pressed again..
(keyPressed:bool) OnKeyDown dxScanCode:long
OnControlDown - Works like OnKeyDown, but takes a control code and returns 1 when the key or mouse button assigned to that control is pressed.
(controlPressed:bool) OnControlDown whichControl:short
TapControl - presses the key or mouse button associated with the specified control once.
(nothing) TapControl whichControl:short
RefreshControlMap - re-parses the Oblivion.ini file to update OBSE's internal map of the player's controls. Call this function after the player exits the Controls menu (menumode 1021) to detect any changes to the control layout. DEPRECATED: Input functions are now in sync with Oblivion control bindings.
(nothing) RefreshControlMap
SetControl - assigns a new key to the specified control. If the specified control already has a key assigned, the key mappings are swapped.
(nothing) SetControl whichControl:short dxScanCode:long
SetAltControl - assigns a new mouse button to the specified control. If the specified control already has a mouse button assigned, the button mappings are swapped.
(nothing) SetAltControl whichControl:short dxScanCode:long
GetCursorPos - returns the current X or Y coordinate of the mouse cursor in menu mode. Minumum coordinate is zero, maximum is determined by the user's screen resolution. Specify 'X' or 'Y' for the axis.
(cursorPos:short) GetCursorPos axis:char
SetIsControl - allows mods to register or unregister keys or mouse buttons as custom controls. Other mods can then use IsControl to detect conflicts between custom controls.
(nothing) SetIsControl keyCode:short isControl:bool
IsControl - returns 1 if the specified key or mouse button is assigned to a game control, 2 if it has been registered as a custom control by a mod via SetIsControl, or 0 otherwise.
(isControl:short) IsControl keyCode:short
IsKeyDisabled* - returns 1 if the key has been disabled using DisableKey.
(isDisabled:bool) IsKeyDisabled keycode:short
IsControlDisabled* - returns 1 if the control has been disabled by a call to DisableControl. Note that this only keeps track of calls to DisableControl and EnableControl; it does not check if the disabled state of the key or mouse button has been affected by DisableKey
(isDisabled:bool) IsControlDisabled whichControl:short
Math Functions
Abs - returns the absolute value of the argument
(absoluteValue:float) abs arg:float
Ceil - returns the nearest whole number above the argument
(ceil:float) ceil arg:float
Exp - returns e to the power of the argument
(exp:float) exp arg:float
Floor - returns the nearest whole number less than the argument
(floor:float) floor arg:float
Log - returns the natural logarithm of the number
(log:float) log arg:float
Log10 - returns the base 10 logarithm of the number
(log10:float) log10 arg:float
Pow - returns the base raised to the exponents power
(pow:float) pow base:float exponent:float
Rand - returns a random number between min and max
(rand:float) rand min:float max:float
SquareRoot - returns the square root of the argument
(sqrt:float) squareroot arg:float
(sqrt:float) sqrt arg:float
fmod - returns the floating point modulus of dividend in the given base. This differs from `dividend % base` in the scripting language as % is a strictly integer function. When base is positive, `0 <= result < base`. The optional offset shifts the range of the result to `offset <= result < base+offset`. The two most likely uses of this function are `modulus angle 360` to normalize a computed angle, i.e., ensure it is `>= 0`< 360.0 and , and `modulus angle 360 -180` which ensures the computed [change of] angle is `>= -180.0` and `< 180.0`.`modulus n base` is defined as `n - base Floor n / base`. If the base is negative the direction of the inequality changes. Thus: `0 >= result > base` and `offset >= result > base+offset`.
(fmod:float) fmod dividend:float base: float offset:float
Trigonometry Functions
ACos - returns the arccosine of the argument. ACos and DACos use degrees. RACose uses radians.
(acos:float) acos arg:float
(acos:float) dacos arg:float
(acos:float) racos arg:float
ASin - returns the arcsine of the argument. ASin and DASin use degrees. RASin uses radians.
(asin:float) asin arg:float
(asin:float) dasin arg:float
(asin:float) rasin arg:float
ATan - returns the arctangent of the argument. ATan and DATan use degrees. RATan uses radians.
(atan:float) atan arg:float
(atan:float) datan arg:float
(atan:float) ratan arg:float
ATan2 - returns the arctangent of the arguments. ATan2 and DATan2 use degrees. RATan2 uses radians.
(atan2:float) atan2 arg1:float arg2:float
(atan2:float) datan2 arg1:float arg2:float
Cos - returns the cosine of the angle. Cos and DCos use degrees. RCos uses radians.
(cos:float) cos arg:float
(cos:float) dcos arg:float
(cos:float) rcos arg:float
Cosh - returns the hyperbolic cosine of the angle. Cosh and DCosh use degrees. RCosh uses radians.
(cosh:float) cosh arg:float
(cosh:float) dcosh arg:float
(cosh:float) rcosh arg:float
Sin - returns the sine of the angle. Sin and DSin use degrees. RSinh uses radians.
(sin:float) sin arg:float
(sin:float) dsin arg:float
(sin:float) rsin arg:float
Sinh - returns the hyperbolic sine of the angle. Sinh and DSinh use degrees. RSinh uses radians.
(sinh:float) sin arg:float
(sinh:float) dsin arg:float
(sinh:float) rsin arg:float
Tan - returns the tangent of the angle. Tan and DTan use degrees. RTan uses radians.
(tan:float) tan arg:float
(tan:float) dtan arg:float
(tan:float) rtan arg:float
Tanh - returns the hyperbolic tangent of the angle. Tanh and DTanh use degrees. RTanh uses radians.
(tanh:float) tanh arg:float
(tanh:float) dtanh arg:float
(tanh:float) rtanh arg:float
Bitwise Manipulation Functions
LeftShift - Shifts the argument left by the specified number of bits. Returns zero if shiftAmount is >= 32.
(result:long) LeftShift value:long shiftAmount:long
RightShift - Shifts the argument right by the specified number of bits, inserting zeros on the left. Returns zero if shiftAmount is >= 32.
(result:long) RightShift value:long shiftAmount:long
LogicalAnd - Returns the bitwise AND of the two arguments.
(result:long) LogicalAnd arg1:long arg2:long
LogicalOr - Returns the bitwise OR of the two arguments.
(result:long) LogicalOr arg1:long arg2:long
LogicalXor - Returns the bitwise XOR of the two arguments.
(result:long) LogicalXor arg1:long arg2:long
LogicalNot - Returns the bitwise NOT of the argument.
(result:long) LogicalNot arg:long
Output Functions
Output functions are used to display messages. Some take a string containing format specifiers and an optional list of up to 20 variables which may include reference variables. Format specifiers include all of those used by the Message and MessageBox functions, as well as additional specifiers:
PrintToConsole - prints a formatted message to the console using the extended format specifiers.
(nothing) PrintToConsole formatString:string var1 var2 ... var20
Example script using MessageBoxEX:
ref refVar1
ref refVar2
short keyCode
short goldCost
set refVar1 to AdrianDecanusREF
set refVar2 to ShadySamREF
set keyCode to GetControl 15 ; menu key, assuming 'Tab' (15)
set goldCost to 500
MessageBoxEX "Press %k to summon a companion %rCost: %g gold|%n|%n|Cancel" keyCode goldCost refVar1 refVar2
The script displays a messageBox in the following format:
Press TAB to summon a companion
Cost: 500 gold
[Adrian Decanus]
[Shady Sam]
[Cancel]
SetMessageSound - sets the sound which is to be played by the next call to MessageEX. The sound must be defined in the Sounds branch of the Object Window. Once MessageEX has been called the sound is cleared.
(nothing) SetMessageSound soundID:string
SetMessageIcon - sets the icon which is to be displayed to the left of the text for the next call to MessageEX. The icon is a .dds file located in the folder "Data\Textures\Menus\" or a subfolder thereof. Once MessageEX has been called the icon will be cleared.
(nothing) SetMessageIcon iconPath:string
DebugPrint - prints a message to the console only if debug mode has been enabled for the mod from which the calling script originates. Use SetDebugMode to toggle debug messages on or off.
(nothing) DebugPrint formatString:string var1 var2 ... var20
SetDebugMode - toggles all debug messages on or off for the mod from which the calling script originates. Pass 1 as the argument to turn debug messages on, or 0 to turn them off. Optionally pass the modIndex of the mod for which you wish to toggle messages.
(nothing) SetDebugMode EnableDebugMessages:bool modIndex:short
Print - prints a string expression to the console. This is mainly a convenience function to eliminate the need for temporary string variables when printing complex strings using PrintToConsole, as it supports string concatenation, the ToString function, etc.
(nothing) Print string:expr
Spam-Blocking Functions
Some existing script functions generate UI messages in the top-left corner of the screen when called on the player. The following functions duplicate the behavior of those functions while suppressing those messages. Syntax is identical to the original functions.
AddItemNS
RemoveItemNS
EquipItemNS
UnequipItemNS
AddSpellNS
RemoveSpellNS
Mod Functions
These functions return information about currently loaded Oblivion plugins.
GetModIndex - returns the mod index of the specified plugin. This is equivalent to the first two digits of the object's formID.
(index:short) GetModIndex modName:string
GetSourceModIndex - returns the mod index of the plugin from which the specified object originates.
(index:short) reference.GetSourceModIndex object:ref
GetNumLoadedPlugins - returns the number of plugins currently loaded. Used in conjunction with GetModIndex, this can be used to verify load order at run-time.
(loadedPluginCount:short) GetNumLoadedPlugins
IsModLoaded - returns 1 if the specified .esp or .esm is currently loaded. String is case-insensitive but must include the file extension.
(isLoaded:bool) IsModLoaded modName:string
GetNthModName - returns the filename of the nth loaded mod.
(name:string_var) GetNthModName modIndex:short
Hotkey Functions
GetHotkeyItem - returns the item or spell bound to the specified hotkey (1-8)
(itemOrSpell:ref) GetHotkeyItem whichHotkey:short
SetHotkeyItem - sets a hotkey to the specified spell or item
(nothing) SetHotkeyItem whichHotkey:short spellOrItem:ref
ClearHotkey - removes any spell or item bound to the specified hotkey
(nothing) ClearHotkey whichHotkey:short
File Functions
FileExists - returns 1 if the specified file exists in the user's installation folder or within one of the BSA archives. Path is relative to the user's install folder, which is "Bethesda Softworks\Oblivion" by default.
(fileExists:bool) FileExists filePath:string
UI Functions
Return information about the user interface. When the term "active menu" is used, it refers to the menu over which the mouse cursor is positioned when the command is called. Some functions accept an optional parameter specifying the specific menu you are interested in, assuming that menu is currently open.
GetActiveMenuMode - returns the menu code of the active menu. These are the same codes used by the MenuMode function.
(menuCode:short) GetActiveMenuMode
GetActiveMenuSelection - returns the item in the active menu over which the mouse is currently positioned.
(activeItem:ref) GetActiveMenuSelection
The return type varies depending on the active menu:
Magic: Highlighted spell
Container: Highlighted item
Inventory: Highlighted item
SpellPurchase: Highlighted spell
GetActiveMenuFilter - returns the code which indicates the current filter options for the active menu.
(filterCode:short) GetActiveMenuFilter menuType:short
GetActiveMenuRef - returns the reference from which the active menu is derived.
(menuRef:ref) GetActiveMenuRef menuType:short
The return type varies depending on the active menu:
SpellPurchase: Spell merchant
Container: Container, corpse, or merchant
Dialog: Speaking NPC
Book: Book reference in the gameworld
GetActiveMenuObject - returns the base object from which the active menu is derived.
(menuObject:ref) GetActiveMenuObject menuType:short
The return type varies based on the active menu type:
Book: Book base object
Alchemy: Potion being brewed
Message: The formID of the reference whose attached script generated the message, or the quest script which generated it. Returns 0 for game-generated messages such as confirmation boxes.
GetEnchMenuSoulgem - returns the soulgem selected for enchantment in the enchantment menu. Only works if the enchantment menu is the active menu.
(soulgem:ref) GetEnchMenuSoulgem
GetEnchMenuEnchItem - returns the enchantment which is to be applied to the item to be enchanted. Only works if the enchantment menu is the active menu.
(enchantment:ref) GetEnchMenuEnchItem
IsBarterMenuActive - returns 1 if the player is bartering with a merchant, providing a way to distinguish between an ordinary container menu and a barter menu, which both return the same MenuMode code.
(isBarterMode:bool) IsBarterMenuActive
GetAlchMenuIngredient - returns one of the four ingredients, from 0 to 3, selected for inclusion in the potion currently being brewed.
(ingredient:ref) GetAlchMenuIngredient whichIngred:short
GetAlchMenuIngredientCount - returns the number of the specified ingredient selected for inclusion in the potion being brewed. Pass 0 for the first ingredient, 3 for the last.
(count:short) GetAlchMenuIngredientCount whichIngred:short
GetAlchMenuApparatus - returns the apparatus object being used in the brewing process
(apparatus:ref) GetAlchMenuApparatus apparatusType:short
CloseAllMenus - closes all currently open menus. Note: if the console is open at the time this function is called, it will be closed but the displayed console text will remain visible until the console is opened and closed again.
(nothing) CloseAllMenus
GetContainerMenuView - when the container/barter menu is open, returns 1 if the player is viewing his own inventory, or 0 if viewing the container or merchant's inventory.
(menuView:short) GetContainerMenuView
SetButtonPressed - When any Message menu is displayed (game prompts such as the inventory quantity prompt as well as those created by the MessageBox function), forces the menu to behave as if the specified button was pressed. Button IDs range from 0 to 9.
(nothing) SetButtonPressed buttonID:short
IsGameMessageBox* - returns 1 if a messagebox is currently displayed which was generated by game code (e.g., confirm item purchase) rather than a script.
(isGameMessage:bool) IsGameMessageBox
GetMessageBoxType* - returns a code indicating the origin of the currently-displayed messagebox
Return values:
0: No messagebox displayed or unknown origin
1: Generated from script
2: Confirm Buy Item
3: Confirm Sell Item
4: Confirm Give Item
5: Confirm Buy Spell
6: Confirm Poison Weapon
7: Confirm Overwrite Savegame
8: Confirm Load Savegame
9: Confirm Load Savegame with Missing Content
(type:short) GetMessageBoxType
OBSE v0016 adds the ability to retrieve or modify the value of any trait defined in a menu's XML file. In order to use these commands you must specify the location of the desired trait within the XML hierarchy. For instance, given the following excerpt from MessageMenu.xml:
<menu name="MessageMenu">
<rect name="background">
<image name="button_1">
<visible> &true </visible>
To access the "visible" attribute of the first button, you would use "background\button_1\visible". Traits can have values of three types: float, boolean, or string. Boolean values are treated as floats, with 1 representing "false" and 2 representing "true." You must also specify the menu code of the menu you are interested in.
Examples:
float floatVar
string_var strVar
set floatVar to GetMenuFloatValue "background\button_3\visible" 1001 ; MessageMenu - is button 3 visible?
set strVar to GetMenuStringValue "background\message_text\string" 1001 ; MessageMenu - retrieve message text
SetMenuFloatValue "cont_background\page_layout\cont_contents\cont_button_take_all\visible" 1008 1
; hides the "Take All" button in the Container menu
SetMenuStringValue "background\button_1\button_1_text\string|%z" strVar 1001
; sets the text of button 1 to the contents of strVar
ClickMenuButton "hudmain_background\hudmain_magic_cover" 1009
; clicks the icon for the player's active spell, switching from item view to spell view if inventory is open
GetMenuFloatValue - returns the value of a float or boolean trait of the specified menu
(value:float) GetMenuFloatValue trait:formatString menuType:short
GetMenuStringValue - returns the value of a string trait of the specified menu
(value:string_var) GetMenuStringValue trait:formatString menuType:short
SetMenuFloatValue - sets the value of a float or boolean trait of the specified menu
(nothing) SetMenuFloatValue trait:formatString menuType:short newValue:float
SetMenuStringValue - sets the value of a string trait of the specified menu. The new value follows the trait name, separated from it by a pipe character. i.e. "elementName\traitName|newValue". (If calling from the console, replace the pipe character with the '@' character).
(nothing) GetMenuFloatValue traitAndNewValue:formatString menuType:short
GetActiveUIComponentID - returns the integer ID of the menu elemented currently highlighted by the mouse cursor as defined by that element's <id> trait in the menu XML file.
(id:short) GetActiveMenuComponentID
GetActiveUIComponentName - returns the name of the menu element currently highlighted by the mouse cursor as defined in the menu XML file.
(name:string_var) GetActiveUIComponentName
GetActiveUIComponentFullName - like GetActiveUIComponentName, returns the name of the menu element currently highlighted by the mouse cursor, if any. However the returned name is fully qualified with the names of the element's parents in a form suitable to pass to commands like GetMenuFloatValue. i.e., if button_1 is highlighted in the MessageMenu, this command returns "background\button_1".
(name:string_var) GetActiveUIComponentFullName
ClickMenuButton - simulates the user clicking on the specified UI component. Pass the fully qualified component name as described above, or pass the <id> trait of the desired component as specified in the XML, preceded by a '#' i.e. "#32" to click the button with ID 32. Note that specifying the name results in much better performance than specifying an ID.
(nothing) ClickMenuButton componentName:formatString menuType:short
GetMenuHasTrait - returns 1 if the menu has the trait specified. The trait name may be qualified with component names to access traits of subcomponents.
(hasTrait:bool) GetMenuHasTrait traitName:formatString menuType:short
GetTileChildren* - given a UI component (referred to by the game as a "Tile"), returns an Array containing the names of all of the direct subcomponents of that component. Using this command is more efficient than accessing children individually if you need to inspect more than one subcomponent.
(children:Array) GetTileChildren parentTile:string menuType:short
GetTileTraits* - given a UI component, returns a StringMap representing all of that component's traits and their values. The keys of the returned StringMap's elements are the names of the traits; their values are the string or numeric values of the traits. This command is more efficient for accessing multiple traits of the same component than the commands which access traits individually.
(traits:StringMap) GetTileTraits componentName:string menuType:short
PrintTileInfo* - a debugging command which outputs all of the children of a UI component as well as the names and values of all of its traits. Output is sent to the console and to obse.log. Avoid using this function in released mods; it is intended for testing and debugging only.
(nothing) PrintTileInfo componentName:string menuType:short
Text Input Functions
Allow the user to enter and edit text, with limited support for HTML formatting.
Controls while entering text:
- Left/Right arrows: move cursor left or right. Pressing in conjunction with the CTRL key moves the cursor to the beginning of the closest word.
- Home/End: move cursor to the beginning or end of the text.
- Backspace/Delete: delete text. Use with CTRL to delete an entire word.
- TAB: Inserts 4 spaces.
- Up/Down: When editing books or scrolls, move cursor to the end of the previous line or the beginning of the next line.
Additional formatting can be inserted when editing books and scrolls by pressing CTRL in combination with one of the following:
-L, R, or C: align the current line left, right, or center respectively. Alignment affects the current line and any subsequent lines until the next alignment tag.
-1, 2, 3, 4, 5: change the font of the text.
<IMG> tags are not directly supported, but can be added using InsertInInputText. The <, >, and ~ characters are not considered valid input characters.
Note that it is possible for the user to close the menu by clicking one of the buttons in a messagebox or the "Exit" button in a book. Calls to UpdateTextInput will re-display a messagebox with the user's text intact, but will not re-open a book once closed. Further, it is still necessary to call CloseTextInput to release the text input menu for use by other scripts.
OpenTextInput - opens a text input menu if one is not currently in use. MenuType is 0 for a messagebox, 1 for a book, or 2 for a scroll. The MaxLength parameter specifies how many characters to allow the user to enter. For messageboxes, the prompt string will be displayed before the cursor and cannot be erased. It may also contain buttons, with the button text separated from the prompt text with pipe '|' characters as in MessageBoxEX. For books and scrolls, the prompt string serves as the default text visible as soon as the menu is opened and may be edited by the user.
(nothing) OpenTextInput promptString:string var1 var2 ... var20 menuType:short maxLength:short
IsTextInputInUse - returns 1 if a script is currently using a text input menu, regardless of whether or not the menu is visible. Only one script may request text input at a time.
(isInUse:bool) IsTextInputInUse
GetInputText - returns the text entered by the user. You may call this function at any point before calling CloseTextInput. Note that the returned string includes any html formatting inserted by the user. It also includes an html prefix along the lines of <FONT face="#"><div align="align">.
(inputText:string_var) GetInputText
UpdateTextInput - tells the text input menu to check for user input and refresh the displayed text if necessary. In general, unless you want to temporarily disallow input, this command should be called every frame while the text input menu is open.
(nothing) UpdateTextInput
CloseTextInput - closes the text input menu, releasing it for use by other scripts. Be sure to call this command when you are done getting input.
(nothing) CloseTextInput
InsertInInputText - inserts formatted text at the current cursor position in the text input menu, as long as doing so would not increase the length of the text beyond its maximum length.
(nothing) InsertInInputText formatString:string var1 var2 ... var20
GetTextInputControlPressed - allows scripters to define custom controls for text input. Returns the scan code of the last key pressed in conjunction with the CTRL key, excluding those keys reserved for use by the text input menu. Once the code has been retrieved, subsequent calls to this command will return -1; it will also return -1 if no control has been pressed (similar to GetButtonPressed).
(scanCode:short) GetTextInputControlPressed
DeleteFromInputText - deletes a number of characters or words from the input text in the direction specified, beginning from the current cursor position. Note that an html tag is treated as both a word and a character (it is not possible to delete only part of a tag). Both optional parameters are false by default.
(nothing) DeleteFromInputText numToDelete:short bBackwards:bool bDeleteWholeWords:bool
GetTextInputCursorPos - returns the current position of the cursor as an index into the input string.
(cursorPos:short) GetTextInputCursorPos
MoveTextInputCursor - moves the cursor a specified number of characters in the specified direction from its current position. Note that each html tag is treated as a single character.
(nothing) MoveTextInputCursor numChars:short moveBackwards:bool
Example script:
scriptName GetUserInputSCR
int button
int state
string_var userText
begin OnActivate
if (IsTextInputInUse == 0)
OpenTextInput "Type stuff (max 20 chars) | Finished" 0 20
set state to 1
endif
end
begin gameMode
if (state)
set button to GetButtonPressed
if (button == 0) ; user has finished
set userText to GetInputText
CloseTextInput
set state to 0
else
UpdateTextInput
endif
endif
end
String Variables
OBSE v0016 introduces the string_var datatype for representing strings of characters. String variables can be declared and used like normal variables and can hold the return values from OBSE commands defined as returning a string_var. Their contents are preserved with the savegame. String-related commands include commands to modify a string variable and commands to retrieve a game string and store it in a string variable. Additionally, many existing commands like SetName now have EX counterparts (i.e. SetNameEX) which can accept a format string and a variable number of arguments, including string variables.
A string variable should not be used until it has been initialized with a value, by using it on the lefthand side of a call to sv_Construct or a command that returns a string. An uninitialized string variable has a value of zero, which can be tested for in scripts. The value of an initialized string, on the other hand, is undefined and should never be modified directly by statements such as set someStringVar to 6 or using arithmetic operators. Similarly, string variables should only be used to store strings, and the result of a string-returning variable should only (and always) be assigned to a string variable. Note that direct assignment of one string variable to another causes both variables to refer to the same string. For instance, in the following code:
string_var string1
string_var string2
set string1 to sv_Construct "First string"
set string2 to string1
set string1 to sv_Construct "Second string" ; modifies both string1 and string2
...both string1 and string2 end up containing "Second string." If this is not desired behavior, use sv_Construct to copy the contents of one string to another, i.e.:
set string2 to sv_Construct "%z" string1 ; copies string1's contents to string2
set string2 to player.GetName ; modifies only string2
String variables persist in the savegame until they are explicitly destroyed or until the mod from which they originate is removed from the user's mod list. In general, string variables should be destroyed after use unless it is necessary to save their values permanently. In the following example, the string variable is used each time the scripted object is activated:
string_var refName
ref activatingRef
begin onActivate
set activatingRef to GetActionRef
set refName to activatingRef.GetName
if (sv_Count "e" refName > 0)
Message "Your name contains the letter e"
endif
set refName to sv_Destruct
end
Because the value of the string variable is only needed temporarily, sv_Destruct is used to prevent it from being saved.
As of OBSE v0017, string variables can be passed to any command expecting a string literal as an argument by prefacing the name of the variable with a dollar sign. This deprecates many of the Set...EX commands. Example:
string_var msg
let msg := "Greetings from Stonekeep, " + player.GetName + "!!!"
MessageBox $msg
Additionally in v0017, support for string operations has been integrated into the language via OBSE expressions, which leaves functions such as sv_Construct, sv_Substring, etc. mostly deprecated.
String Functions:
(nothing) sv_Construct formatString:string var1 var2 ... var20 variableToSet:string_var
sv_Destruct - destroys a string variable, setting its value to zero and preventing its contents from being saved in the savegame. Two different syntaxes are supported: the first should be used in an assignment with no parameters, using the Set keyword: set stringVar to sv_Destruct. The second is used without assignment and accepts up to ten string variables as arguments, destroying them all: sv_Destruct var1 var2 ... var10.
(string_var) sv_Destruct
(nothing) sv_Destruct var1:string_var var2:string_var ... var10:string_var
sv_Length - returns the number of characters in a string variable.
(length:short) sv_Length variable:string_var
sv_Compare - compares a string to a formatted string. Performs a case-insensitive comparison by default. Returns 0 if the strings are equal, 1 if the string variable occurs alphabetically before the formatted string, -1 if the string variable occurs alphabetically after the formatted string, or -2 if the comparison fails.
(comparison:short) sv_Compare formatString:string var1 var2 ... var20 variable:string_var caseSensitive:bool
sv_Erase - erases the specified number of characters from a string starting at the specified position. If omitted, startPos = 0. Omitting numToErase erases all characters from startPos to the end of the string.
(nothing) sv_Erase variable:string_var startPos:short numToErase:short
sv_ToNumeric - attempts to convert the contents of a string variable to a number. Valid characters include digits, a leading sign, and an e to indicate scientific notation. Conversion halts at the first invalid character.
(float) sv_ToNumeric sourceString:string_var
sv_Find - returns the index of the first occurrence of a substring within a string variable, starting at the specified position and only including occurrences contained completely within the range [startPos, startPos + searchLen]. Omit the arguments to search the entire string without regard to case
(index:short) sv_Find subString:formatString formatVars source:string_var startPos:short searchLen:short caseSensitive:bool
sv_Count - returns the number of occurrences of a substring within a string variable, using the same arguments as sv_Find.
(count:short) sv_Count subString:formatString formatVars source:string_var startPos:short searchLen:short
sv_Replace - replaces occurrences of a string1 with string2 within a string variable. Both the text to replace and that with which to replace it are passed in a single format string separated by a pipe character as in "toReplace|replaceWith" (when calling from the console, use '@' in place of the pipe character). You can specify a range to search and case-sensitivity as in sv_Find, plus an additional final argument specify how many occurrences to replace. By default, the command replaces all occurrences.
(numReplaced:short) sv_Replace subString:formatString formatVars source:string_var startPos:short searchLen:short caseSensitive:bool numToReplace:short
sv_Insert - inserts a substring into a string at the specified position, provided the position is less than the length of the string, or prepends it if no position is specified.
(nothing) sv_Insert subString:formatString formatVars targetString:string_var insertPos:short
GetKeyName* - returns the name of a key given its DirectInput scan code
(keyName:string) GetKeyName keycode:short
AsciiToChar* - returns the character associated with an ASCII code as a string
(character:string) AsciiToChar asciiCode:short
NumToHex* - returns a string representation of an integer in hexadecimal format. An optional width parameter ranging from 0 to 8 specifies the minimum number of digits to include; unused digits are padded with zeroes. By default, 8 digits are included.
(hex:string) NumToHex num:short width:short
Character Functions: a single character is represented by an integer with a value from 0 to 127 corresponding to its ASCII code. sv_GetChar returns characters.
IsDigit - returns 1 if the character is a digit.
(isDigit:bool) IsDigit character:short
IsPunctuation - returns 1 if the character is punctuation.
(isPunctuation:bool) IsPunctuation character:short
IsUppercase - returns 1 if the character is an uppercase letter.
(isUpper:bool) IsUppercase character:short
IsPrintable - returns 1 if the character is printable (not a non-printable control character)
(isPrint:bool) IsPrintable character:short
IsLetter - returns 1 if the character is alphabetic.
(isLetter:bool) IsLetter character:short
CharToASCII - returns the ASCII code of a character passed as a string. Additional characters in the string are ignored.
(character:short) CharToASCII character:string
ToUpper - returns the ASCII code of a character converted to uppercase.
(upperCharacter:short) ToUpper character:short
ToLower - returns the ASCII code of a character converted to lowercase.
(lowerCharacter:short) ToUpper character:short
Examples:
Copying a string:
set string2 to sv_construct "%z" string1
Concatenating two strings::
set string2 to sv_construct "%z%z" string1 string2
Format Specifiers
Some OBSE commands take a format string as a parameter. Format strings are actually a collection of arguments consisting of a string followed by zero to twenty variables and/or numbers. The string specifies how the command should use the rest of the arguments to construct a new string. Within the format string, percent signs are used to indicate special characters.
The format specifiers recognized by OBSE commands include all of those recognized by vanilla Oblivion script commands like MessageBox as well as several extended specifiers:
%a - replaced by the character matching the ASCII code passed as an integer.
%c - replaced with the name of a component within another object. Takes two arguments - an object (ref) and the index of the component you want to access (short). Supported object types:
Magic Item - prints the name of the nth effect item.
Faction - prints the male rank title of the nth rank.
%e - replaced by nothing. Useful for passing an empty string as an argument, as the script compiler will not accept an empty string. Can be used outside of format strings.
%i - is replaced by the formID of a reference or object passed in a ref variable
%k - replaced by a string representing the key associated with a DirectInput scan code
%n - replaced with the name of a reference or object passed in a ref variable
%p - replaced with a pronoun based on the gender of the object parameter passed in a ref variable:
%po - objective (he, she, it)
%pp - possessive (his, her, its)
%ps - subjective (him, her, it)
%q - replaced with a double quote character (takes no arguments). Can be used outside of format strings.
%r - replaced by a new-line character (takes no arguments). Can be used outside of format strings.
%v - replaced by the name of an actor value passed as an integer actor value code.
%x - replaced with an integer in hexadecimal format. An optional digit from 0-9 immediately following this specifier indicates the minimum width of the displayed value. For example, MessageEx "%x4" 255 will display "00FF".
%z - replaced by the contents of a string variable.
%{ .. %} - Conditionally omits a portion of the format string based on a boolean value. The left bracket accepts a variable; if the value of the variable is zero, all text up to the right bracket will be ignored, and any parameters supplied to format specifiers within the omitted substring will be skipped.
Note that the %e, %q, and %r specifiers can be used within any string literal and will be replaced by an empty string, a double quote, or a carriage return respectively.
Array Variables*
OBSE v0017 introduces the array_var datatype for storing a collection of values within a single variable. An array_var is a set of data elements each identified by a unique key. A key can be a number or a string, and the value associated with the key can be a string, number, game object, or another array. An element's value can be accessed using bracket notation, e.g. array[key]. In this documentation, "key" refers to the element's key, and "value" refers to the data associated with that key.
All elements within an array must have the same type of key - all strings or all numeric. However, an array can contain any mix of types for its values. Elements are sorted by key, in ascending order either alphabetically or numerically depending on the key type.
OBSE's array_var type actually represents three different kinds of associative containers:
-Array: An Array behaves like arrays in most programming languages: the key is an unsigned integer starting at zero, and there are no gaps between elements. (In other words, if an element exists at indexes 1 and 3 then an element necessarily exists at 0 and 2). Attempting to access an element using a key which is greater than the highest key in the array results in an error. The only exception to this rule is during assignment: it is okay to assign a value to the key which is one greater than the highest key in the array.
-Map: A Map associates numeric keys with values. Unlike an Array, a Map allows negative and floating point numbers to be used as keys and allows gaps to exist between elements.
-StringMap: Like a Map, except the keys are strings. Keys are case-insensitive, so array[INDEX] and array[index] both refer to the same value. There is no practical limit on the length of the strings used as keys. StringMaps can be used to simulate C-style structs by associating named properties with data values.
An array_var must be initialized before it can be used in expressions, either by explicitly initializing it using ar_Construct, assigning the value of another array_var to it, or assigning it the return value of a command returning an array such as GetItems. Most array operations should be performed within OBSE expressions such as Let or Eval statements. Array elements cannot be passed directly to most commands as arguments. Assigning one array to another as in Let array_1 := array_2 causes both array_1 and array_2 to refer to the same array, as illustrated below:
array_var a
array_var b
let a := ar_Construct Array
let a[0] := "First elem"
let b := a ; b now refers to the same array as a
let b[1] := "Second elem" ; array now contains two elements
OBSE keeps track of the number of references to each array and destroys the array when no references to it remain. This makes it unnecessary for scripts to worry about destroying arrays explicitly. For example, continuing from the code above:
; our array currently has 2 references: the variables a and b
let a := ar_Construct StringMap ; now a refers to a new array, and only b refers to ours
let b := ar_Null ; b now refers to no array. No references to our array remain
; OBSE will delete the unreferenced array
Array Operations
OBSE supports a variety of operations on arrays within the context of Let, Eval, and similar statements. Examples:
array_var arr_1
array_var arr_2
let arr_1 := ar_Construct Array
let arr_1[0] := "a string"
let arr_1[1] := 1.234
let arr_1[2] := Player.GetEquippedObject 16
; let arr_1[10] := 0 <- this is an error, index out of bounds
let arr_1[3] := Player.GetEquippedItems ; <- arr_1[3] is another array
let arr_1[4] := arr_1[3][0] ; <- access first item returned by GetEquippedItems
let arr_2 := arr_1[1:3] ; <- arr_2 contains elements 1, 2, and 3 from arr_1
let arr_2 := arr_1[1:-2] ; <- arr_2 contains elements 1 through (size of arr_1 minus 2) of arr_1
Array Functions
Note: Unless otherwise indicated, an array_var parameter may be either a variable declared as array_var or an array element containing an array. Commands accepting this type of parameter must be called within the context of an OBSE expression such as Let or Eval.
ar_Construct* - creates a new array_var and assigns it to an array variable. Must be called within the context of an OBSE expression such as Let. The parameter specifies the type of array to create: StringMap, Map, or Array. See the above section for more information on the different types of array variables.
(array_var) ar_Construct arrayType:string
ar_Size* - returns the number of elements in an array, or -1 if the array is not initialized. For Array-type variables the highest key in the array is equal to one less than the array's size. Must be called within the context of an OBSE expression. The array can be an array variable or an array element which contains an array.
(size:short) ar_Size array:array_var
ar_Dump* - for debugging purposes, prints the key and value of every element in an array to the console. Must be called within an OBSE expression.
(nothing) ar_Dump array:array_var
ar_DumpID* - does the same as ar_Dump but accepts an array ID instead of an array_var. Provided as a convenience for debugging in the console.
(nothing) ar_DumpID arrayID:short
ar_Erase* - erases elements from an array. You may provide a single element, in which case only that element will be erased and only if it is present. Or, you may provide a range in slice notation. Any elements greater than or equal to the lower bound and less than or equal to the upper bound of the range will be erased. If the array is of type Array, elements above the erased elements will be shifted down. Returns the number of elements removed.
(numRemoved:short) ar_Erase target:array index:arrayIndex
(numRemoved:short) ar_Erase target:array range:slice
Examples:
array_var arr
let arr := ar_Construct StringMap
let arr["another array"] := ar_Construct Array
ar_Erase arr["another array"] 0 ; erase element 0 if it exists, higher elements will be shifted down by 1
ar_Erase arr "begin":"end" ; erase any elements having keys >= "begin" and <= "end"
ar_Find* - locates the first occurrence of the specified value within an array and returns the key associated with it. A range may optionally be specified using range notation, i.e. let key := ar_Find "tofind" arrayVar lowerBound:upperBound. If the value is not found, the function returns an empty string (for string-indexed arrays) or the value -99999.0 (for numeric-index arrays).
(key:stringOrNumber) ar_Find value:stringOrNumberOrForm arrayToSearch:array inRange:range
ar_Sort* - attempts to sort the elements of an array in ascending or descending order and returns a new Array containing the elements in sorted order (keys associated with the elements are lost). In order to be sorted all elements of an array must be of the same type (strings, numbers, or objects). If this condition is not met an empty Array is returned. Strings are sorted alphabetically and case-insensitively, numbers are sorted numerically, and objects are sorted by formID. By default the elements are sorted in ascending order
(sortedArray:Array) ar_Sort toSort:array sortDescending:bool
ar_SortAlpha* - sorts the elements of an array alphabetically in ascending or descending order and returns a new Array containing the elements in sorted order. Ordering is case-insensitive. Unlike ar_Sort, does not require elements to be of the same type - numeric elements are converted to a string representation, and forms are sorted by their names (if named) or the string representation of their formIDs. Omitting the optional parameter causes elements to be sorted in ascending order.
(sortedArray:Array) ar_SortAlpha toSort:array sortDescending:bool
ar_Copy* - creates a copy of the keys and elements of the specified array. The resulting array is identical to the source array. If the source array contains other arrays, the copy will contain references to those same arrays.
(copy:array) ar_Copy src:array
ar_DeepCopy* - performs the same function as ar_Copy, except any arrays contained within the source array are also copied (and any arrays within those arrays are copied as well, and so on).
(copy:array) ar_DeepCopy src:array
ar_First* - returns the key of the first element in an array
(key:arrayKey) ar_First src:array
ar_Last* - returns the key of the last element in an array
(key:arrayKey) ar_Last src:array
ar_Next* - returns the key of the element immediately following the passed key, or BadIndex if no key follows it
(key:arrayKey) ar_Next src:array precedingKey:arrayKey
ar_Prev* - returns the key of the element immediately preceding the passed key, or BadIndex if no key precedes it
(key:arrayKey) ar_Prev src:array prevKey:arrayKey
ar_BadNumericIndex* - returns a constant representing an invalid numeric array index. Compare to the return value of commands returning an array key to determine if a valid key was returned.
(badKey:short) ar_BadNumericIndex
ar_BadStringIndex* - as above, but for string array keys
(badKey:string) ar_BadStringIndex
ar_Keys* - returns an Array containing all of the keys of the source array
(keys:Array) ar_Keys src:array
ar_HasKey* - returns true if the array has an element with the specified key
(hasKey:bool) ar_HasKey src:array key:arrayKey
ar_Null* - returns an invalid array. This is useful if you wish to specify that a variable which previously referred to an array should no longer refer to any array.
(nullArray:array) ar_Null
OBSE Expressions*
OBSE v0017 introduces support for evaluation of complex expressions involving a larger set of operators than that provided by Oblivions set and if statements, type-checking and type inference, and operations on strings and arrays. These expressions are supported within the context of new commands such as let (for assignment, analogous to set) and eval (to be used within if statements to test the value of a boolean expression).
Operators

Symbol | Precedence | Function | Number of Operands | Description
:= | 0 | Assignment | 2 | Assigns the value of an expression on the right to the variable or array element on the left. Right-associative. The value of the assignment is the right-most operand. Supports multiple assignment i.e. a := b := c := 0 sets all 3 variables to zero. Assignment to an array variable creates a copy of the right-hand operand.
|| | 1 | Logical Or | 2 | True if either expression is true
&& | 2 | Logical And | 2 | True if both expressions are true
: | 3 | Slice/Range | 2 | Specifies a range of elements in a string or array. For strings, creates a substring. For arrays, creates a copy of the elements within the range. Range includes the upper element. For strings, negative indices start at the last element and count backwards.
== | 4 | Equality | 2 | True if the operands are equal. Operands must be comparable to each other.
!= | 4 | Inequality | 2 | True if the operands are not equal.
> | 5 | Greater Than | 2 | Operands must be comparable and ordered. For strings, comparison is case-insensitive.
< | 5 | Less Than | 2 | For strings, case-insensitive.
>= | 5 | Greater or Equal | 2 | For strings, case-insensitive.
<= | 5 | Less than or Equal | 2 | For strings, case-insensitive.
| | 6 | Bitwise Or | 2 | Performs a bitwise or, demoting the operands to integers
& | 7 | Bitwise And | 2 | Performs a bitwise and, demoting the operands to integers.
<< | 8 | Binary Left Shift | 2 | Shifts left operand left by specified number of bits, demoting both operands to integers.
>> | 8 | Binary Right Shift | 2 | Shifts left operand right by specified number of bits, demoing both operands to integers.
+ | 9 | Addition/Concatentation | 2 | Adds two numbers or joins two strings.
- | 9 | Subtraction | 2 | Self-explanatory.
* | 10 | Multiplication | 2 | Self-explanatory.
/ | 10 | Division | 2 | Self-explanatory.
% | 10 | Modulo | 2 | Returns the remainder of integer division.
^ | 11 | Exponentiation | 2 | Raises left operand to the power of the right operand.
- | 12 | Negation | 1 | Returns the opposite of an expression.
$ | 12 | Stringize | 1 | Returns a string representation of an expression. (Shorthand for ToString).
! | 13 | Logical Not | 1 | Returns the opposite of a boolean expression. i.e. !(true) evaluates to false.
( ) | 14 | Parentheses | 0 | Enclose expressions within parentheses to override default precedence rules.
[ ] | 15 | Subscript | 2 | For arrays, accesses the element having the specified key. For strings, returns a string containing the single character at the specified position. The expression within the brackets is treated as if it were parenthesized (overrides precedence rules).

Considerations
- Unlike most programming languages, Oblivion's scripting language doesn't require function arguments to be delineated (e.g., enclosed in parentheses). In most cases this is not a problem, but when an expression contains a call to a function which itself accepts an expression as an argument, followed by another argument or expression, OBSE cannot determine where the inner expression ends. In these cases the entire function call, including the function name, can be enclosed in parentheses to clarify the statement. Example:
let a := ar_size array1 + ar_size array2
The above expression will not compile because OBSE tries to interpret the entire expression following the first call to ar_size as an array. Instead the expression must be written as:
let a := (ar_size array1) + ar_size array2
For the majority of commands, including all vanilla commands, OBSE commands prior to v0017, and most v0017 commands, the parentheses are not required.
Run-time Error Reporting
Because it performs type-checking and type-inference, OBSE can detect and report most syntax errors when compiling a script in the Construction Set. However in some cases errors may be impossible to detect until the script is executed. In ambiguous cases, OBSE gives the scripter the benefit of the doubt by assuming the expression is valid. Run-time errors are logged to the console and obse.log, along with the formID of the script which caused the error. Errors may be tested for (and the output of error messages suppressed) using the testexpr command.
Common causes of run-time errors include:
- Expressions involving array elements: Because an array element can hold a value of several types, its type is ambiguous at compile-time. For instance, an expression multiplying two array elements will compile, but will cause an error at run-time if the elements contain non-numeric values. It is the scripter's responsibility to either know that the elements are of the correct type or check their types at run-time.
- Uninitialized arrays: It is an error to use bracket notation to attempt to retrieve an element from an uninitialized array. Arrays are initialized by assignment, for instance by calling ar_Construct or by assigning the return value of a command like GetItems to an array variable. An uninitialized array stores an arrayID of 0 so testing if an array is initialized is as simple as if (array).
- Non-existent or out-of-bounds array index: Attempting to retrieve a value from an array using a key which does not exist in that array is an error. Assigning to an element with a key which doesn't exist is fine - doing so creates an element with that key - unless the array is of the Array type, in which case using a key which is greater than the number of elements in the array will cause an error.
- Function calls: OBSE knows the return type of commands which return strings or array. However, all vanilla commands and the majority of OBSE commands do not return strings or arrays; they return either numbers or objects. At compile-time OBSE can't know which will be returned, so attempting to use the result of a command like GetInventoryObject in an arithmetic expression will result in an error at run-time.
Expression Statements
Let* - The Let statement is OBSE's version of Oblivion's Set statement. It takes the form let expr1 := expr2 (or let expr1 => expr2 for assignment by reference) where expr1 evaluates to something which can hold a value, such as a variable or array element, and expr2 is an expression of a type which can be stored in expr1. Values within expressions can include arithmetic expressions, function calls, etcetra. The assignment operator checks the types of its operands, so it will allow assigning a number to a short variable but not to a string_var.
(nothing) Let expr := expr
There is no practical limit to the complexity of the expressions on either side of the assignment as long as their types match. Examples:
string_var str
array_var arr
short num
let str := "a string"
let str := str[0:num] + player.GetName + " some more text"
let arr := ar_Construct Map
let arr[(num + player.GetPos Z) / player.GetPos X] := player.GetDistance someRef ^ 2
Eval* - Eval is used within if statements to test the value of an expression. This allows OBSE expressions to be used as conditions. The expression must evaluate to a boolean value.
(bool) Eval expr
Example:
if eval (array[0] > 1)
; code executes if array[0] > 1
endif
TestExpr* - attempts to evaluate an expression, returning false if an error occurs during evaluation and true otherwise. This can be useful when checking if an array index is out of bounds or if an element exists with a given key, among other things. TestExpr suppresses the output of error messages to the console and log file.
(bool) TestExpr expr
Example:
array_var array
let array := ar_Construct Array
if testexpr (array[5] := 2)
PrintC "5 is a valid index, assignment succeeded."
else
PrintC "Index 5 is out of bounds, no assignment."
endif
let array := ar_Construct StringMap
if testexpr (array["INDEX"])
PrintC "An element exists in array with key 'INDEX'"
else
PrintC "No element with the specified key exists."
endif
ToString* - attempts to convert an expression to a string. For numeric expressions, the result is a string representation of the numeric value. For objects, it is the name of the object if available; otherwise it is the formID expressed in hexadecimal notation. For string expressions no conversion is necessary.
(string) ToString expr
Note that the $ operator can be used in place of ToString. The following two lines are equivalent:
let aStringVar := ToString (aNumber + 1)
let aStringVar := $(aNumber + 1)
TypeOf* - returns a string representing the type of an expression. This is mainly useful for determining the type of an array element at run-time. Possible return values: "String", "Number", "Form", "Array", "StringMap", "Map".
(type:string) TypeOf expr
Type Codes
Form Type IDs
0: None
1: TES4
2: Group
3: GMST
4: Global
5: Class
6: Faction
7: Hair
8: Eyes
9: Race
10: Sound
11: Skill
12: Effect
13: Script
14: LandTexture
15: Enchantment
16: Spell
17: BirthSign
18: Activator
19: Apparatus
20: Armor
21: Book
22: Clothing
23: Container
24: Door
25: Ingredient
26: Light
27: Misc
28: Stat
29: Grass
30: Tree
31: Flora
32: Furniture
33: Weapon
34: Ammo
35: NPC
36: Creature
37: LeveledCreature
38: SoulGem
39: Key
40: AlchemyItem
41: SubSpace
42: SigilStone
43: LeveledItem
44: SNDG
45: Weather
46: Climate
47: Region
48: Cell
49: REFR
50: ACHR
51: ACRE
52: PathGrid
53: WorldSpace
54: Land
55: TLOD
56: Road
57: Dialog
58: DialogInfo
59: Quest
60: Idle
61: Package
62: CombatStyle
63: LoadScreen
64: LeveledSpell
65: ANIO
66: WaterForm
67: EffectShader
68: TOFT
69: Actors
70: Inventory items
Equipment Slot IDs
0: head
1: hair
2: upper body
3: lower body
4: hand
5: foot
6: right ring
7: left ring
8: amulet
9: weapon
10: back weapon
11: side weapon
12: quiver
13: shield
14: torch
15: tail
16: weapon
17: ammo
18: lower and upper body
19: lower and upper and foot
20: lower, upper, hand and foot
Return values only
Equipment slot bit assignments:
0x00000001 1 Head
0x00000002 2 Hair
0x00000004 4 UpperBody
0x00000008 8 LowerBody
0x00000010 16 Hand
0x00000020 32 Foot
0x00000040 64 RightRing
0x00000080 128 LeftRing
0x00000100 256 Amulet
0x00000200 512 Weapon
0x00000400 1024 BackWeapon
0x00000800 2048 SideWeapon
0x00001000 4096 Quiver
0x00002000 8192 Shield
0x00004000 16384 Torch
0x00008000 32768 Tail
0x00010000 65536 Weapon
0x00020000 131072 Ammo
0x00040000 262144 Ranged Weapon
Weapon Type
0: Blade1H
1: Blade2H
2: Blunt1H
3: Blunt2H
4: Staff
5: Bow
Apparatus Type
0: Mortar & Pestle
1: Alembic
2: Calcinator
3: Retort
Apparatus Quality Levels
.10: Novice
.25: Apprentice
.50: Journeyman
.75: Expert
1.0: Master
Armor Type
0: Light Armor
1: Heavy Armor
Soul Level
0: None
1: Petty
2: Lesser
3: Common
4: Greater
5: Grand
Magic Item Type
0: Not a Magic Item
1: Spell
2: Enchantment
3: Alchemy Item
4: Ingredient
Magic Effect Range
0: Self
1: Touch
2: Target
Spell Type
0: Spell
1: Disease
2: Power
3: Lesser Power
4: Ability
Spell Mastery Level
0: Novice
1: Apprentice
2: Journeymand
3: Expert
4: Master
Enchantment Type
0: Scroll
1: Staff
2: Weapon
3: Apparel
Magic Schools
0: Alteration
1: Conjuration
2: Destruction
3: Illusion
4: Mysticism
5: Restoration
Actor Value Codes
0: Strength
1: Intelligence
2: Willpower
3: Agility
4: Speed
5: Endurance
6: Personality
7: Luck
8: Health
9: Magicka
10: Fatigue
11: Encumbrance
12: Armorer
13: Athletics
14: Blade
15: Block
16: Blunt
17: HandToHand
18: HeavyArmor
19: Alchemy
20: Alteration
21: Conjuration
22: Destruction
23: Illusion
24: Mysticism
25: Restoration
26: Acrobatics
27: LightArmor
28: Marksman
29: Mercantile
30: Security
31: Sneak
32: Speechcraft
33: Aggression
34: Confidence
35: Energy
36: Responsibility
37: Bounty
38: Fame
39: Infamy
40: MagickaMultiplier
41: NightEyeBonus
42: AttackBonus
43: DefendBonus
44: CastingPenalty
45: Blindness
46: Chameleon
47: Invisibility
48: Paralysis
49: Silence
50: Confusion
51: DetectItemRange
52: SpellAbsorbChance
53: SpellReflectChance
54: SwimSpeedMultiplier
55: WaterBreathing
56: WaterWalking
57: StuntedMagicka
58: DetectLifeRange
59: ReflectDamage
60: Telekinesis
61: ResistFire
62: ResistFrost
63: ResistDisease
64: ResistMagic
65: ResistNormalWeapons
68: ResistParalysis
67: ResistPoison
68: ResistShock
69: Vampirism
70: Darkness
71: ResistWaterDamage
256: No Actor Value
Class Specialization Codes
0: Combat
1: Magic
2: Stealth
Input Control IDs
0: Forward
1: Back
2: Slide Left
3: Slide Right
4: Use
5: Activate
6: Block
7: Cast
8: Ready Item
9: Crouch/Sneak
10: Run
11: Always Run
12: Auto Move
13: Jump
14: Toggle POV
15: Menu Mode
16: Rest
17: Quick Menu
18: Quick1
19: Quick2
20: Quick3
21: Quick4
22: Quick5
23: Quick6
24: Quick7
25: Quick8
26: QuickSave
27: QuickLoad
28: Grab
Creature Type
0: Creature
1: Daedra
2: Undead
3: Humanoid
4: Horse
5: Giant
HDR Value
0: Eye Adapt
1: Blur Radius
2: Blur Passes
3: Emissive Mult
4: Target LUM
5: Upper LUM Clamp
6: Bright Scale
7: Bright Clamp
8: LUM Ramp No Tex
9: LUM Ramp Min
10: LUM Ramp Max
11: Sunlight Dimmer
12: Grass Dimmer
13: Tree Dimmer
Weather Color
0: Sky Upper
1: Fog
2: Clouds Lower
3: Ambient
4: Sunlight
5: Sun
6: Stars
7: Sky Lower
8: Horizon
9: Clouds Upper
10: Lightning
Weather Time
0: Sunrise
1: Day
2: Sunset
3: Night
RGB Value
0: Red
1: Green
2: Blue
Music Type
0: Default
1: Public
2: Dungeon
Projectile Type
0: Arrow
1: Magic Ball
2: Magic Fog
3: Magic Bolt
Actor Sound
0: LeftFoot
1: RightFoot
2: LeftBack
3: RightBack
4: Idle
5: Aware
6: Attack
7: Hit
8: Death
9: Weapon
Detection State
0: Lost
1: Unseen
2: Noticed
3: Seen
Animation Group
Note: Functions expecting an Animation Group parameter will accept the string associated with that group.
0: Idle
1: DynamicIdle,
2: SpecialIdle,
3: Forward,
4: Backward,
5: Left,
6: Right,
7: FastForward,
8: FastBackward,
9: FastLeft,
10: FastRight,
11: DodgeForward,
12: DodgeBack,
13: DodgeLeft,
14: DodgeRight,
15: TurnLeft,
16: TurnRight,
17: Equip,
18: Unequip,
19: AttackBow,
20: AttackLeft,
21: AttackRight,
22: AttackPower,
23: AttackForwardPower,
24: AttackBackPower,
25: AttackLeftPower,
26: AttackRightPower,
27: BlockIdle,
28: BlockHit,
29: BlockAttack,
30: Recoil,
31: Stagger,
32: Death,
33: TorchIdle,
34: CastSelf,
35: CastTouch,
36: CastTarget,
37: CastSelfAlt,
38: CastTouchAlt,
39: CastTargetAlt,
40: JumpStart,
41: JumpLoop,
42: JumpLand,
Service Flags
Note: Add two or more flags together to specify a group of services offered by an NPC.
1: Weapons
2: Armor
4: Clothing
8: Books
16: Ingredients
128: Lights
256: Apparatus
1024: Misc
2048: Spells
4096: MagicItems
8192: Potions
16384: Training
65536: Recharge
131072: Repair
Biped Path Codes
Specifies icon/model paths associated with biped objects, i.e. clothing and armor
0: Male Biped Path
1: Female Biped Path
2: Male Ground Path
3: Female Ground Path
Process Level
For actors, the level at which the game processes their AI
0: High
1: Middle-high
2: Middle-low
3: Low
Menu Code

        1001:    Message
        1002:    Inventory
        1003:    Stats
        1004:    HUDMain
        1005:    HUDInfo
        1006:    HUDReticle
        1007:    Loading
        1008:    Container, Barter
        1009:    Dialog
        1010:    HUDSubtitle
        1011:    Generic
        1012:    SleepWait
        1013:    Pause
        1014:    LockPick
        1015:    Options
        1016:    Quantity
        1017:    Audio
        1018:    Video
        1019:    VideoDisplay
        1020:    Gameplay
        1021:    Controls
        1022:    Magic
        1023:    Map
        1024:    MagicPopup
        1025:    Negotiate
        1026:    Book
        1027:    LevelUp
        1028:    Training
        1029:    BirthSign
        1030:    Class
        1031:    Attributes
        1032:    Skills
        1033:    Specilization
        1034:    Persuasion
        1035:    Repair
        1036:    RaceSex
        1037:    SpellPurchase
        1038:    Load
        1039:    Save
        1040:    Alchemy
        1041:    SpellMaking
        1042:    Enchantment
        1043:    EffectSetting
        1044:    Main
        1045:    Breath
        1046:    QuickKeys
        1047:    Credits
        1048:    SigilStone
        1049:    Recharge
        1051:    TextEdit

Menu Filter Code
Magic Menu:
1: Target
2: Touch
3: Self
7: All
8: Active Effects
Container/Barter/Inventory Menu:
1: Weapons
2: Armor/Clothing
3: Alchemy
4: Miscellaneous
31: All
Alchemy Apparatus
0: Mortar and Pestle
1: Retort
2: Alembic
3: Calcinator
Map Marker Types
1: Camp
2: Cave
3: City
4: Elven Ruin
5: Fort Ruin
6: Mine
7: Landmark
8: Tavern
9: Settlement
10: Daedric Shrine
11: Oblivion Gate
Function Index
- functions follwed by a number in subscript were introduced in that release (10: v0010, 11: v0011)
Abs
ACos
AddEffectItem10
AddEffectItemC10
AddFullEffectItem11
AddFullEffectItemC11
AddItemNS15
AddSpellNS15
AddToLeveledList13
AHammerKey
AnimPathIncludes15
AppendToName11
ASin
ATan
ATan2
CalcLeveledItem13
CalcLeveledItemNR15
CanCorpseCheck14
CanTravelToMapMarker16
Ceil
CharToAscii16
ClearHotKey15
ClearLeveledList15
ClickMenuButton16
CloneForm
CloseAllMenus15
CloseTextInput16
CompareFemaleBipedPath10
CompareFemaleGroundPath10
CompareFemaleIconPath10
CompareIconPath10
CompareMaleBipedPath10
CompareMaleGroundPath10
CompareMaleIconPath10
CompareModelPath10
CompareName10
CompareNames13
CompareScripts15
con_CAL10
con_GetINISetting
con_HairTint
con_LoadGame13
con_ModWaterShader
con_PlayerSpellBook14
con_QuitGame11
con_RefreshINI
con_RunMemoryPass
con_Save10
con_SaveINI11
con_SetCameraFOV
con_SetClipDist
con_SetFog
con_SetGameSetting
con_SetGamma
con_SetHDRParam
con_SetImageSpaceGlow
con_SetINISetting
con_SetSkyParam
con_SetTargetRefraction
con_SetTargetRefractionFire
con_SexChange
con_Show1stPerson16
con_TCL10
con_TFC12
con_TGM11
con_ToggleAI10
con_ToggleCombatAI10
con_ToggleDetection
con_ToggleMapMarkers14
con_ToggleMenus10
con_WaterDeepColor
con_WaterReflectionColor
con_WaterShallowColor
CopyEyes13
CopyFemaleBipedPath10
CopyFemaleGroundPath10
CopyFemaleIconPath10
CopyHair13
CopyIconPath10
CopyMaleBipedPath10
CopyMaleGroundPath10
CopyMaleIconPath10
CopyModelPath10
CopyName10
CopyNthEffectItem10
CopyAllEffectItems10
Cos
Cosh
CreatureHasNoHead14
CreatureHasNoLeftArm14
CreatureHasNoMovement14
CreatureHasNoRightArm14
CreatureNoCombatInWater14
CreatureUsesWeaponAndShield14
DebugPrint16
DeleteFromInputText 16
DisableControl13
DisableKey
DisableMouse
EnableControl13
EnableKey
EnableMouse
EquipItemNS15
Exp
FactionHasSpecialCombat14
FileExists15
Floor
Fmod10
GetActiveEffectCount13
GetActiveMenuFilter15
GetActiveMenuMode15
GetActiveMenuRef15
GetActiveMenuObject15
GetActiveMenuSelection15
GetActiveUIComponentID16
GetActiveUIComponentFullName16
GetActiveUIComponentName16
GetActorLightAmount
GetActorMaxLevel14
GetActorMinLevel14
GetActorSoulLevel14
GetActorValueC14
GetAlchMenuIngredient15
GetAlchMenuIngredientCount15
GetAlchMenuApparatus15
GetAltControl215
GetApparatusType10
GetArmorAR
GetArmorType
GetArrowProjectileEnchantment15
GetArrowProjectileBowEnchantment15
GetArrowProjectilePoison15
GetAttackDamage
GetBaseObject
GetBipedIconPath16
GetBipedModelPath16
GetBipedSlotMask16
GetBookCantBeTaken10
GetBookIsScroll10
GetBookSkillTaught10
GetBookText16
GetCalcAllLevels15
GetCalcEachInCount15
GetChanceNone15
GetCellMusicType14
GetClass
GetClassAttribute
GetClassSkill
GetClassSpecialization
GetClimateSunriseBegin12
GetClimateSunriseEnd12
GetClimateSunsetBegin12
GetClimateSunsetEnd12
GetClimateVolatility13
GetCloseSound15
GetContainerMenuView15
GetContainerRespawns13
GetControl
GetCreatureBaseScale13
GetCreatureCombatSkill10
GetCreatureFlies14
GetCreatureMagicSkill10
GetCreatureReach13
GetCreatureSoulLevel13
GetCreatureSound15
GetCreatureSoundBase14
GetCreatureStealthSkill10
GetCreatureSwims14
GetCreatureType10
GetCreatureWalks14
GetCurrentCharge10
GetCurrentClimateID12
GetCursorPos16
GetCrosshairRef14
GetCurrentHealth10
GetCurrentSoulLevel10
GetCurrentWeatherID12
GetDebugSelection13
GetEnchantment
GetEnchMenuEnchItem15
GetEnchMenuSoulgem15
GetEnchantmentCharge
GetEnchantmentCost
GetEnchantmentType
GetEquipmentSlot
GetEquipmentSlotMask10
GetEquippedCurrentCharge
GetEquippedCurrentHealth
GetEquippedObject
GetEquippedWeaponPoison
GetEyes15
GetFallTimer15
GetFirstRef13
GetFirstRefInCell16
GetFormFromMod16
GetFPS10
GetFullGoldValue15
GetGameLoaded
GetGameRestarted13
GetGodMode15
GetGoldValue
GetHair15
GetHairColor15
GetHidesAmulet16
GetHidesRings16
GetHotKeyItem15
GetHorse14
GetIconPath16
GetIgnoresResistance
GetIngredient16
GetIngredientChance16
GetInputText16
GetInventoryObject
GetKeyPress
GetLastCreatedPotion16
GetLastCreatedSpell16
GetLastEnchantedItem16
GetLastUniqueCreatedPotion16
GetLevItemByLevel15
GetLevItemIndexByForm16
GetLevItemIndexByLevel16
GetLightRadius14
GetLinkedDoor13
GetLoopSound15
GetMagicEffectBarterFactor
GetMagicEffectBaseCost
GetMagicEffectCode
GetMagicEffectEnchantFactor
GetMagicEffectOtherActorValue10
GetMagicEffectOtherActorValueC10
GetMagicEffectProjectileSpeed
GetMagicEffectSchool
GetMagicEffectUsedObject10
GetMagicEffectUsedObjectC10
GetMagicItemEffectCount
GetMagicItemType
GetMagicProjectileSpell15
GetMapMarkerType16
GetMenuFloatValue16
GetMenuHasTrait16
GetMenuStringValue16
GetMerchantContainer12
GetModelPath16
GetModIndex15
GetMouseButtonPress
GetName16
GetNextRef13
GetNthActiveEffectCaster13
GetNthActiveEffectCode13
GetNthActiveEffectData13
GetNthActiveEffectDuration13
GetNthActiveEffectMagicItem13
GetNthActiveEffectMagicItemIndex13
GetNthActiveEffectMagnitude13
GetNthActiveEffectTimeElapsed13
GetNthChildRef14
GetNthDetectedActor15
GetNthEffectItemActorValue
GetNthEffectItemArea
GetNthEffectItemCode
GetNthEffectItemDuration
GetNthEffectItemMagnitude
GetNthEffectItemRange
GetNthEffectItemScript10
GetNthEffectItemScriptName16
GetNthEffectItemScriptSchool10
GetNthEffectItemScriptVisualEffect10
GetNthExplicitRef16
GetNthFaction14
GetNthFactionRankName16
GetNthFollower14
GetNthLevItem
GetNthLevItemCount15
GetNthLevItemLevel15
GetNthModName16
GetNthPackage15
GetNthPlayerSpell10
GetNthRaceBonusSkill12
GetNthRaceSpell14
GetNumLoadedMods15
GetNumRanks14
GetNumChildRefs14
GetNumDetectedActors15
GetNumericINISetting
GetNumExplicitRefs16
GetNumFactions14
GetNumFollowers14
GetNumItems
GetNumKeysPressed
GetNumLevItems15
GetNumMouseButtonsPressed
GetNumPackages15
GetNumRefs13
GetNumRefsInCell16
GetObjectCharge
GetObjectHealth
GetOBSERevision15
GetOBSEVersion
GetOpenKey13
GetOpenSound15
GetOwner13
GetOwningFactionRank13
GetParentCell
GetParentCellOwner13
GetParentCellOwningFactionRank13
GetParentCellWaterHeight13
GetPCAttributeBonus15
GetPCMajorSkillUps15
GetPCSpellEffectivenessModifier16
GetPCTrainingSessionsUsed16
GetPlayerSkillUse11
GetPlayerSpell
GetPlayerSpellCount10
GetPlayersLastActivatedLoadDoor14
GetPlayersLastRiddenHorse14
GetPluginVersion13
GetProcessLevel15
GetProjectile16
GetProjectileDistanceTraveled16
GetProjectileLifetime16
GetProjectileSource15
GetProjectileSpeed16
GetProjectileType15
GetQuality10
GerRace14
GetRefCount15
GetRefVariable15
GetRaceAttribute12
GetRaceAttributeC12
GetRaceSkillBonus12
GetRaceSkillBonusC12
GetRaceSpellCount14
GetRider14
GetScript12
GetScriptActiveEffectIndex13
GetServicesMask15
GetSkillUseIncrement11
GetSoulGemCapacity
GetSoulLevel
GetSoundPlaying15
GetSourceModIndex15
GetSpellEffectiveness16
GetSpellExplodesWithNoTarget12
GetSpellMagickaCost
GetSpellMasteryLevel
GetSpellSchool10
GetSpellType
GetStringGameSetting16
GetStringIniSetting16
GetTeleportCell13
GetTextInputControlPressed16
GetTextInputCursorPos16
GetTotalActiveEffectMagnitude13
GetTotalAEAbilityMagnitude13
GetTotalAEAlchemyMagnitude13
GetTotalAEAllSpellsMagnitude13
GetTotalAEDiseaseMagnitude13
GetTotalAEEnchantmentMagnitude13
GetTotalAELesserPowerMagnitude13
GetTotalAENonAbilityMagnitude13
GetTotalAEPowerMagnitude13
GetTotalAESpellMagnitude13
GetTotalPCAttributeBonus15
GetTrainerLevel15
GetTrainerSkill15
GetTravelHorse13
GetObjectType
GetVariable15
GetWeaponReach
GetWeaponSpeed
GetWeaponType
GetWeatherCloudSpeedLower13
GetWeatherCloudSpeedUpper13
GetWeatherColor13
GetWeatherFogDayFar13
GetWeatherFogDayNear13
GetWeatherFogNightFar13
GetWeatherFogNightNear13
GetWeatherHDRValue13
GetWeatherLightningFrequency13
GetWeatherSunDamage13
GetWeatherSunGlare13
GetWeatherTransDelta13
GetWeatherWindSpeed13
GetWeight
Goto
HammerKey
HasBeenPickedUp14
HasLowLevelProcessing14
HasModel14
HasName14
HasNoPersuasion14
HasSpell
HasVariable15
HoldKey
IncrementPlayerSkillUse11
InsertInInputText16
IsActivatable14
IsActivator
IsActorRespawning14
IsAlchemyItem
IsAmmo
IsAnimGroupPlaying15
IsApparatus
IsArmor
IsAttacking15
IsBarterMenuActive15
IsBipedModelPathValid15
IsBipedIconPathValid15
IsBlocking15
IsBook
IsCasting15
IsClassAttribute11
IsClassSkill
IsClonedForm
IsClothing
IsConsoleOpen16
IsContainer
IsControl16
IsControlPressed13
IsCreature
IsCreatureBiped14
IsDigit16
IsDodging15
IsDoor
IsFactionEvil14
IsFactionHidden14
IsFlora16
IsFlying15
IsFood
IsFormValid15
IsFurniture
IsGlobalCollisionDisabled11
IsHarvested14
IsIconPathValid15
IsInAir15
IsIngredient
IsJumping15
IsKey
IsKeyPressed
IsKeyPressed2
IsKeyPressed313
IsLetter16
IsLight
IsLoadDoor13
IsLightCarriable14
IsMagicEffectCanRecover10
IsMagicEffectCanRecoverC10
IsMagicEffectDetrimental10
IsMagicEffectDetrimentalC10
IsMagicEffectForEnchanting10
IsMagicEffectForEnchantingC10
IsMagicEffectMagnitudePercent10
IsMagicEffectMagnitudePercentC10
IsMagicEffectOnSelfAllowed10
IsMagicEffectOnSelfAllowedC10
IsMagicEffectForSpellmaking10
IsMagicEffectForSpellmakingC10
IsMagicEffectHostile
IsMagicEffectOnTargetAllowed10
IsMagicEffectOnTargetAllowedC10
IsMagicEffectOnTouchAllowed10
IsMagicEffectOnTouchAllowedC10
IsMagicItemAutoCalc10
IsMapMarkerVisible16
IsModelPathValid15
IsModLoaded14
IsMovingBackward15
IsMovingForward15
IsMovingLeft15
IsMovingRight15
IsNthEffectItemScripted10
IsNthEffectItemScriptHostile10
IsOffLimits14
IsOnGround15
IsPCLevelOffset14
IsPersistent14
IsPlayable12
IsPlayable215
IsPluginInstalled13
IsPoison
IsPowerAttacking15
IsPrintable16
IsPunctuatio16n
IsQuestItem
IsRaceBonusSkill12
IsRaceBonusSkillC12
IsRecoiling15
IsReference15
IsRefEssential
IsScripted10
IsSigilStone
IsSoulGem
IsSpellHostile15
IsStaggered15
IsSummonable14
IsTextInputInUse16
IsThirdPerson10
IsTurningLeft15
IsTurningRight15
IsUnderWater13
IsUpper16
IsWeapon
Label
LeftShift10
LoadGameEx16
Log
Log10
LogicalAnd10
LogicalNot10
LogicalOr10
LogicalXor10
MagicEffectFXPersists10
MagicEffectFXPersistsC10
MagicItemHasEffect
MagicItemHasEffectCode
MagicItemHasEffectCount12
MagicItemHasEffectCountCode12
MagicEffectHasNoArea10
MagicEffectHasNoAreaC10
MagicEffectHasNoDuration10
MagicEffectHasNoDurationC10
MagicEffectHasNoHitEffect10
MagicEffectHasNoHitEffectC10
MagicEffectHasNoIngredient10
MagicEffectHasNoIngredientC10
MagicEffectHasNoMagnitude10
MagicEffectHasNoMagnitudeC10
MagicEffectUsesAttribute10
MagicEffectUsesAttributeC10
MagicEffectUsesArmor10
MagicEffectUsesArmorC10
MagicEffectUsesCreature10
MagicEffectUsesCreatureC10
MagicEffectUsesOtherActorValue10
MagicEffectUsesOtherActorValueC10
MagicEffectUsesSkill10
MagicEffectUsesSkillC10
MagicEffectUsesWeapon10
MagicEffectUsesWeaponC10
MagicItemHasEffectItemScript14
MenuHoldKey10
MenuReleaseKey10
MenuTapKey10
MessageBoxEx14
MessageEx14
ModActorValueC14
ModActorValue2
ModArmorAR
ModAttackDamage
ModEnchantmentCharge
ModEnchantmentCost
ModEquippedCurrentCharge
ModEquippedCurrentHealth
ModFemaleBipedPath10
ModFemaleGroundPath10
ModFemaleIconPath10
ModGoldValue
ModIconPath10
ModMaleBipedPath10
ModMaleGroundPath10
ModMaleIconPath10
ModModelPath10
ModName11
ModNthActiveEffectMagnitude13
ModNthEffectItemArea
ModNthEffectItemDuration
ModNthEffectItemMagnitude
ModNthEffectItemScriptName14
ModObjectCharge
ModObjectHealth
ModPCSpellEffectiveness16
ModQuality10
ModSpellMagickaCost
ModWeaponReach
ModWeaponSpeed
ModWeight
MoveMouseX
MoveMouseY
MoveTextInputCursor16
OffersWeapons15
OffersArmor15
OffersClothing15
OffersBooks15
OffersLights15
OffersIngredients15
OffersApparatus15
OffersMiscItems15
OffersMagicItems15
OffersSpells15
OffersPotions15
OffersTraining15
OffersRecharging15
OffersRepair15
OffersServicesC15
OnControlDown13
OnKeyDown13
OpenTextInput16
ParentCellHasWater13
Pow
PrintToConsole
Rand
RefreshControlMap13
RefreshCurrentClimate13
ReleaseKey
RemoveAllEffectItems12
RemoveEnchantment
RemoveEquippedWeaponPoison
RemoveFromLeveledList13
RemoveItemNS15
RemoveLevItemByLevel15
RemoveNthEffectItem
RemoveNthLevItem16
RemoveScript12
RemoveSpellNS15
ResetAllVariables16
RestoreIP
RightShift10
RunBatchScript11
RunScriptLine16
SaveIP
SetActorRespawns14
SetActorValueC14
SetAltControl15
SetApparatusType10
SetArmorAR
SetArmorType
SetArrowProjectileBowEnchantment16
SetArrowProjectileEnchantment16
SetArrowProjectilePoison16
SetAttackDamage
SetButtonPressed16
SetBaseForm16
SetBipedIconPathEX16
SetBipedModelPathEX16
SetBipedSlotMask16
SetBookCantBeTaken10
SetBookIsScroll10
SetBookSkillTaught10
SetCanCorpseCheck14
SetCanTravelToMapMarker16
SetChanceNone16
SetClimateHasMasser13
SetClimateHasSecunda13
SetClimateMoonPhaseLength13
SetClimateSunsetBegin13
SetClimateSunsetEnd13
SetClimateVolatility13
SetCloseSound15
SetContainerRespawns13
SetControl15
SetCurrentSoulLevel14
SetDebugMode16
SetDetectionState15
SetDisableGlobalCollision11
SetEnchantment
SetEnchantmentCharge
SetEnchantmentCost
SetEnchantmentType
SetEquipmentSlot
SetEquippedCurrentCharge
SetEquippedCurrentHealth
SetEquippedWeaponPoison
SetEyes13
SetFactionEvil14
SetFactionHidden14
SetFactionSpecialCombat14
SetFemaleBipedPath
SetFemaleGroundPath
SetFemaleIconPath
SetGoldValue
SetHair13
SetHarvested14
SetHasBeenPickedUp15
SetHidesAmulet16
SetHidesRings16
SetHotKeyItem15
SetIconPath
SetIconPathEX16
SetIgnoresResistance
SetIngredient16
SetIngredientChance16
SetIsControl16
SetIsFood
SetIsPlayable12
SetLightRadius14
SetLoopSound15
SetLowLevelProcessing14
SetMagicItemAutoCalc10
SetMagicProjectileSpell15
SetMaleBipedPath
SetMaleGroundPath
SetMaleIconPath
SetMapMarkerType16
SetMapMarkerVisible16
SetMenuFloatValue16
SetMenuStringValue16
SetMerchantContainer12
SetMessageSound15
SetMessageIcon15
SetModelPath
SetModelPathEX16
SetMouseSpeedX
SetMouseSpeedY
SetName
SetNameEx15
SetNoPersuasion14
SetNthActiveEffectMagnitude13
SetNthEffectItemActorValue
SetNthEffectItemArea
SetNthEffectItemDuration
SetNthEffectItemMagnitude
SetNthEffectItemRange
SetNthEffectItemScript12
SetNthEffectItemScriptHostile11
SetNthEffectItemScriptName12
SetNthEffectItemScriptNameEX16
SetNthEffectItemScriptSchool10
SetNthEffectItemScriptVisualEffect10
SetNthEffectItemScriptVisualEffectC10
SetNthFactionRankNameEX16
SetNumericGameSetting
SetNumericINISetting
SetObjectCharge
SetObjectHealth
SetOffersWeapons15
SetOffersArmor15
SetOffersClothing15
SetOffersBooks15
SetOffersIngredients15
SetOffersSpells15
SetOffersLights15
SetOffersMiscItems15
SetOffersMagicItems15
SetOffersApparatus15
SetOffersPotions15
SetOffersTraining15
SetOffersRecharging15
SetOffersRepair15
SetOffersServicesC15
SetOpenKey13
SetOpenSound15
SetPCAMurderer13
SetPCAttributeBonus16
SetPCLevelOffset14
SetPCMajorSkillUps16
SetPCTrainingSessionsUsed16
SetPlayerProjectile15
SetProjectileSource16
SetProjectileSpeed16
SetQuality10
SetQuestItem
SetRaceAlias16
SetRacePlayable16
SetRaceVoice16
SetRefCount15
SetRefEssential
SetScaleEX14
SetScript12
SetSkillUseIncrement11
SetSoulGemCapacity10
SetSoulLevel10
SetSpellExplodesWithNoTarget12
SetSpellHostile15
SetSpellMagickaCost
SetSpellMasteryLevel
SetSpellType
SetStringGameSettingEX16
SetStringIniSetting16
SetSummonable14
SetTrainerLevel15
SetTrainerSkill15
SetTravelHorse13
SetWeaponReach
SetWeaponSpeed
SetWeaponType
SetWeatherCloudSpeedLower13
SetWeatherCloudSpeedUpper13
SetWeatherColor13
SetWeatherFogDayFar13
SetWeatherFogDayNear13
SetWeatherFogNightFar13
SetWeatherFogNightNear13
SetWeatherHDRValue13
SetWeatherLightningFrequency13
SetWeatherSunDamage13
SetWeatherSunGlare13
SetWeatherTransDelta13
SetWeatherWindSpeed13
SetWeight
Sin
Sinh
SquareRoot
sv_Compare16
sv_Construct16
sv_Count16
sv_Destruct16
sv_Erase16
sv_Find16
sv_GetChar16
sv_Insert16
sv_Length16
sv_Replace16
sv_Set16
sv_Substring16
sv_ToNumeric16
Tan
Tanh
TapControl13
TapKey
ToggleCreatureModel15
ToggleFirstPerson16
ToLower16
ToUpper16
UnequipItemNS15
UnHammerKey
UpdateTextInput16
Deprecated Functions
GetEquippedCurrentValue - replaced by GetEquippedCurrentHealth, GetEquippedCurrentCharge and GetEquippedWeaponPoison
GetEquippedObjectValue - replaced by GetEquippedObject and the appropriate individual value functions
GetInventoryItemType - renamed GetBaseObject
GetMagicEffectCodeValue - replaced by the individual GetMagicEffectXXXXC functions.
GetMagicEffectValue - replaced by the individual GetMagicEffect functions
GetMagicItemValue - replaced by the individual MagicItem functions
GetObjectValue - replaced by the individual value functions
SetActiveSpell - duplicate of standard SetPlayerSpell function
RefreshControlMap - input functions are now in sync with Oblivion control bindings
GetAltControl - use GetAltControl2 instead
sv_Construct - use assignment operator
sv_Substring - use slice notation i.e. let substr := str[a:b]
sv_Set - use assignment operator
sv_GetChar - use bracket notation i.e. let char := str[pos]
SetIconPathEX - pass a string_var to SetIconPath
SetModelPathEX - pass a string_var to SetModelPath
MessageBoxEx - pass a string_var to MessageBox
MessageEx - pass a string_var to Message