Netruk44/uesp-wiki-content huggingface dataset:
Tes3Mod:AIWander

AIWander
 

Sets the given NPC to wander randomly in the current area using any AI grid points and performing various random idle movements. This function is commonly used to stop NPCs from following or performing a previously assigned action.

The Range appears to be relative to the point where the NPC last entered the AIWander state. If the NPC is set to AIWander, 100, 0, 0 and then moved more than 100 units away with the Position function, he/she will return to the region where the original call was made. Just issuing a new AIWander command after the Position will not stop this behavior: the AIWander package must complete or a separate package be run in order to reset the center of the range.

There are two known bugs with this function. The Idle2 parameter is not output in the compiled script (verified with Tribunal). The Reset parameter also maybe output incorrectly and should not be used.

See Also: GetAIPackageDone, GetCurrentAIPackage

Notes
As mentioned above the compiled output of the AIWander is strange in that it omits the first idle parameter and the reset parameter is output differently than the other AI functions. Sample SCDT output from the CS is shown in the below table:



The value of the reset parameter varies between 00, 01, and 05 and depends on the previous calls to AIWander in the current script. It seems like the first occurrence of reset in a script has the value of 05. Subsequent uses of reset in the same script adds an extra short value of 0000 to the parameter list along with a reset value of 1. It is currently unsure whether this is the function's intended behavior. I don't believe the reset parameter is used at all with AIWander in any official script.

In a script where reset is not used, all reset output values are 01.
Tes3Mod:AITravel

AITravel
 

Starts the NPC to travel to the given exterior position.  The distance to the new coordinates cannot be too great (about 3000-4000 units), or the actor will not react,
although this maybe related to trying to move the NPC to another cell (which often has problems).  Use GetAIPackageDone function to determine when the actor reaches destination. 
Note that sleeping, teleporting, or fast travel will cause the actor to warp to the end-coordinates, but the GetAIPackageDone function will not fire - this can be a problem.
The Z coordinates need only be approximate and all values must be literal, no variables accepted. AIpath grid helps, but is not mandatory.

As with other AI functions, issue this command only once or the results may not be as expected.

See Also: AIEscort, AIFollow, GetAIPackageDone, GetCurrentAIPackage
Tes3Mod:BetaComment

BetaComment (BC)
 

Console function that presumably records a comment for use in beta testing.
Tes3Mod:Begin

Begin
End
 

The begin command must be the first command in the script. It should be first line at the top of your script that states the script's ID. The script ID can be any combination of letters, numbers, underscore or spaces. It is recommended not to use spaces for simplicity (as with any other object ID). The end command is placed at the end of a script.
Tes3Mod:OnDeath

OnDeath
 

Returns 1 for one frame when the actor is killed (0 otherwise).  Calling this function clears the OnDeath flag for the calling actor.  You cannot successfully call OnDeath twice in a single script (why would you need to?).  This can also cause problems when you have multiple scripts running on the same target, that all check for OnDeath.  The first to call the function will clear the flag, and the remaining scripts will not detect the death.  One possible solution is to test for health being less than zero.

See Also: OnKnockout, OnMurder
Tes3Mod:OnKnockout

OnKnockout
 

Returns 1 for one frame when the actor is knocked out (0 otherwise).

See Also: OnDeath, OnMurder
Tes3Mod:OnMurder

OnMurder
 

Returns 1 for one frame when the actor is murdered (0 otherwise).  Both this and OnDeath will return 1 at the same time, so you can do something like this:
 

See Also: OnDeath, OnKnockout
Tes3Mod:Operators

-&gt;
 
		-&gt;

	Type:	System

     Returns:	none

     Example:	if ( player-&gt;GetHealth  

This is a reserved script operator used to access functions for a particular object reference. Use this when you wish to manipulate or access a specific object explicitly. Note that if multiple objects exist in the world you have no guarantee which one you'll access (the first one the game finds). Also note that if you wish to access an object from anywhere in the world you will need to ensure that the object's References Persist button is checked.

If the object ID on the left of the -&gt; has any spaces in it you will need to enclose the ID with double-quotes. Leading underscores (_) on Object IDs also seem to have erratic results in the script editor. In some places they work fine, in other places the script editor chokes on them. It is recommended not to name objects with a leading underscore.
Tes3Mod:If

if 
elseif 
else 
endif 
 
		if ( LeftValue CompareOp RightValue )
			 
		elseif ( LeftValue CompareOp RightValue )
			 
		else
			 
		endif

       Where:   LeftValue  = Local/global variable or function call
		CompareOp  = ==,  , >=, !=
		RightValue = Local/global variable or numeric literal value
		Statements = Zero or more statements to execute

	Type:	System

     Returns:	none

     Example:	if ( GlobalVar >= 10 )
			; do stuff
		elseif ( LocalVar  

The IF statement block is used to test and execute conditional statements. The elseif/else blocks are both optional. It should be noted that if statements can be used in dialogue results. You should not include any operations (add, subtract, multiply, divide) in either the LeftValue or RightValue fields. Use a temporary variable and a set statement before the if block if you need to use operations.

Update: It is actually possible to use operators and functions on both sides of the comparison operator and references on the left side. In order for this to work correctly you must enclose both sides in brackets as well as have a space on either side of the comparison operator. If you omit either the comparison may not work as expected or even result the script crashing (the compiled output is messed up). Some example of correct and incorrect statements:

      Wrong:     if (  Var1 * Var2 + 10  >=  Var2/109  )     ;Missing brackets
      Correct:   if ( (Var1 * Var2 + 10) >= (Var2/109) )
   
      Wrong:     if ( (Var1 * Var2 + 10)>=(Var2/109)  )     ;Missing spaces around comparison
      Correct:   if ( (Var1 * Var2 + 10) >= (Var2/109) )
   
      Wrong:     if ( (player->GetStrength)>=(player->GetIntelligence)  )     ;Cannot have reference call on right side
      Correct:   if ( (player->GetStrength) >= (TempInt) )

If in doubt it is always safer to assign the expression to a temporary variable and then use that variable in the if() statement. The Construction Set will not warn you with the two wrong examples above (it does give a strange error on the last one).

It is important to remember to use spaces surrounding the '(', compare operator, and ')'. There are known cases where omitting the spaces will cause compiler or runtime errors in the script. 

Note: On the official forums Dave Humphrey notes, "An if block is limited to 255 compiled commands which are difficult to convert in the number of lines as each line may end up as one or several commands when compiled. The 255 line limit is just for each block, i.e. if you had an if block with 200 commands followed an elseif with 100 commands and an else with 50 commands, you'd be fine." See Another script character limitation? thread on  .
Tes3Mod:Journal

Journal
 

Adds a journal entry to the player's journal using the given value to determine which entry to add.  Generally a single ID will refer to a single quest, with multiple index values to indicate various parts of the quest.  The index starts low and ends high.  For instance, 10 for the starting journal entry, 20 and 30 for two middle quest journal entries, and 50 for the last, end of quest, journal entry.

This is one of the few functions that can accept a variable for the index parameter.

This function also has some rather unique features:

You can call   as often as you want, the journal entry 10 of my_quest is added only once.
The function will write any entry into the journal, if it is new, but the index is only set, if it is higher than before. If you call the function like this:
:: 
:: 
:: 
:: 
: The Journal entries will appear in the order 10, 50, 40, 30; but after that the function   and the dialog condition Journal my_quest will return 50.
It is possible to set a journal index that has no text. This can be used to mark progress in the quest without notifying the player of every little step.
The function does not work with non existing IDs. You must create a journal topic my_quest in the dialog window to make these examples work.
Tes3Mod:Long

Long
 

This is one of the three types of the scripting language. Long variables are signed and can range from -2,147,483,648 to 2,147,483,647. While these are the correct logical ranges, the editor appears to only accept values up to 2,147,483,520.

Although local variables can start with an underscore character (_), this seems to cause strange problems in some functions. Therefore it is recommended that you do not name variables starting with the underscore.

See Also: Float,  Short
Tes3Mod:PlayGroup

PlayGroup
 

Plays the animation group defined by GroupName. Optional flags can be used to start the group in different ways. The various group names can be found by viewing the animation menu options in the Character menu in the Construction Set or Animation Groups on this site.

See Also: LoopGroup, Animation Groups
Tes3Mod:LoopGroup

LoopGroup
 

Plays the animation group defined by GroupName the number of times specified. Optional flags can be used to start the group in different ways. The various group names for NPCs can be found by viewing the animation menu options in the Character menu in the Construction Set or Animation Groups on this site.

See Also: PlayGroup, Animation Groups
Tes3Mod:LowerRank

LowerRank
 

Lowers the object's rank in its current faction.

See Also: RaiseRank, PCLowerRank
Tes3Mod:Short

Short
 

This is one of the three types of the scripting language. Short variables are signed and can range from -32,768 to 32,767. 

Although local variables can start with an underscore character (_), this seems to cause strange problems in some functions. Therefore it is recommended that you do not name variables starting with the underscore.

See Also: Float, Long
Tes3Mod:Float

Float
 

This is the largest and one of the three types of the scripting language. Float variables can range from 3.4e+38 to 3.4e-38 and has 7 digits of precision. 

Although local variables can start with an underscore character (_), this seems to cause strange problems in some functions. Therefore it is recommended that you do not name variables starting with the underscore.

See Also: Long, Short
Tes3Mod:PCLowerRank

PCLowerRank
 

Lowers the player's rank in the given faction.

See Also: LowerRank, PCJoinFaction, PCRaiseRank
Tes3Mod:RaiseRank

RaiseRank
 

Raises the object's rank in its current faction.

See Also: LowerRank, PCRaiseRank
Tes3Mod:PCRaiseRank

PCRaiseRank
 

Raises the player's rank in the given faction.  If the player is not a member of the faction, the player is joined and their rank set to 1.

See Also: PCJoinFaction, PCLowerRank, RaiseRank
Tes3Mod:PCJoinFaction

PCJoinFaction
 

Joins the player to the given (or the caller's) faction.

See Also: PCLowerRank, PCRaiseRank
Tes3Mod:MenuMode

MenuMode
 

Returns 1 if the player is currently in menu mode (i.e., has any inventory/magic menus open thus pausing the game). It is a good idea to separate your script logic into processing of commands in and out of menumode. Certain actions like using items are done when in menu mode.
Tes3Mod:MenuTest

MenuTest
 

When called, MenuTest closes certain types of inventory menus, including Player, NPC and containers. It doesn't work for dialogue, enchanting, alchemy, spell or armorer menus. It works from the console as well as from a script.  It also takes parameters:
   menutest or menutest 0: for closing menu 
   menutest 3: open stats menu or focus on it 
   menutest 4: open inventory menu or focus on it 
   menutest 5: open spell menu or focus on it 
   menutest 6: open map menu or focus on it 
   menutest 9: logs the unique identifier and text labels of every piece of the user interface 
for menutest 3,4,5,6, it's like clicking on the upper right button of the menu.
Tes3Mod:MessageBox

MessageBox
 

The MessageBox function has two main abilities, to display simple text messages to the player at the bottom of the screen and to display a list of choices to the player.  To display a message use the function like the following:
 
Use the optional variables to display numbers/strings in the message text.  When displaying float values you must specify the number of decimals places to use.  You can also use the %.0f format to display short/long variables. Although the help file only shows 1 or 2 optional variables, there can be more than 2.

To display a list of choices to the user, use the format:
 
There are also a number of special strings which can be used within the MessageBox string. They all begin with the ^ and not the % character as written in the help file:
 

To return the user's choice, use the GetButtonPressed function, for example:
 
Use a similar setup for asking the user other choices.

If you pop up a message box with an 'ok' button when a saved game is loaded immediately after running Morrowind, you won't have a mouse pointer to click on the 'ok' button to get rid of the message box. The game also keeps running while the message box is displayed; it doesn't pause as it normally does. You can right-click to get into Menu mode, and then you'll have a mouse pointer to clear the box with. This only happens the first time you load a save after running Morrowind; if you load a save from within the game, you do get a mouse pointer to click the 'ok' button with. So apparently it's some sort of initialization problem.

See Also: GetButtonPressed
Tes3Mod:GetButtonPressed

GetButtonPressed
 

Returns the user's choice from the previous MessageBox function.  If the user hasn't made a choice yet the function returns -1. The first button will return a value of 0, the second 1, and so on.

See Also: MessageBox
Tes3Mod:ModFactionReaction

ModFactionReaction
 

Modifies the reaction of one faction towards members of another faction. Positive value indicate more like, while negative values indicate dislike.  For example, 
 
will cause all thieves guild members to increase their dislike of all temple members (it is not reversible so you would have to also set the Temple faction reaction to the Thieves guild).

See Also: GetFactionReaction, SetFactionReaction
Tes3Mod:ModRegion

ModRegion
 

Changes the weather chances for the RegionID. Used to get rid of, or add weathers to an area permanently. The values must add up to 100 or you will get odd results. Note that the last two weather types are undocumented and currently unknown but presumably are the two new snow/blizzard weather types added with Bloodmoon.

See Also: ChangeWeather
Tes3Mod:ModPCFacRep

ModPCFacRep
 

Modifies the reputation modifier for members of the specified faction towards the PC.

See Also: GetPCFacRep, SetPCFacRep
Tes3Mod:MoveOneToOne

MoveOneToOne (MOTO)
 

Unknown console function that appears to have something to do with animation.
Tes3Mod:Move

Move 
MoveWorld
 

These functions cause the referenced object to move at the given speed. The Move function uses the object's axes while the MoveWorld always uses the world axes (positive Z is upwards). Note that the exact speed is affected slightly by the speed of the system the game is being played. Thus, where an exact final position is required it is recommended to test for distance rather than time.
Tes3Mod:StreamMusic

StreamMusic
 

Plays the given music file. (Doesn't need to be mp3, wav or mid will work as well.)
Tes3Mod:StopScript

StopScript
 

This stops a currently running global script started previously with StartScript. Using StopScript resets any local variables used by that script. A StopScript will not immediately terminate the script when it is called. Instead, the script continues executing to the End statement, and then terminates. Use the Return command to immediately stop a script for the current frame if desired.

If a Tribunal Start Script is terminated with StopScript, it will start up again the next time the game is loaded. 

See Also: ScriptRunning, StartScript
Tes3Mod:StopCombat

StopCombat
 

The calling actor will stop attacking (whether or not they actually are currently attacking anything).  Note that using this function can
result in NPCs not to defend themselves or attack at all.

See Also: StartCombat
Tes3Mod:StartScript

StartScript
 

This function starts a script running as a global script. It is not attached to any object, so functions like moving, rotating, checking distances and such have no bearing in a global script (which means you must specify object IDs explicitly). Note this isn't exactly true as if you start a global script it will use the calling script object by default (i.e., if you started a global script from within the NPC Bob's script, the global script would use Bob as the default object). Global scripts are good for running complex quests, checking variables, or setting timers.  Each global script is run every frame so take care not to run too many at one or the game's speed will be reduced.

You can target a global script using either ObjectID-&gt;StartScript, or calling StartScript from the dialogue results box. While both are true, they don't quite work as expected when used together. From the results box, ObjectID-&gt;StartScript seems to attach the script to the NPC calling the dialogue and not the referenced object. When you use a targeted global script any function call in the script will use the target object (you don't need to explicitly specify the object unless you need/want to).

See Also: ScriptRunning, StopScript
Tes3Mod:ScriptRunning

ScriptRunning
 

Returns 1 if the given script is running as a global script, or 0 otherwise.

See Also: StartScript, StopScript
Tes3Mod:Return

Return
 

Use this to stop processing a script before the end. This is particularly useful for long scripts that may take some time to fully process. For example:
Tes3Mod:StopSound

StopSound
 

Stops the given sound if it is playing and previously starting with PlayLoopSound.

See Also: PlayLoopSound
Tes3Mod:StartCombat

StartCombat
 

The calling NPC will start combat with the given ActorID.  Should only be called once (not continuously) or you may experience unintended results (such as the NPC not attacking at all).  Once combat is started, the NPC is subject to the usual AI rules (such as fleeing).

See Also: StopCombat
Tes3Mod:PlaySound

PlayLoopSound3D 
PlayLoopSound3DVP 
PlaySound 
PlaySoundVP 
PlaySound3D 
PlaySound3DVP
 

These functions play sound with a variety of options.  The PlaySound function will play the sound at full volume, sounding like it comes from directly at the player's location.  The 3D functions will cause the sound to be played from the calling object's location in the game (so it will be dimmer the farther the player is away from it).  The VP functions allow you to adjust the volume and pitch of the sound, although whenever the functions are used only 1 for both volume and pitch are used.  The PlayLoop functions will play the sound continuously until a StopSound function is called.

See Also: StopSound
Tes3Mod:StayOutside

StayOutside
 

When used in script, it causes whoever it's assigned to to automatically remain (and wait) outside of any interior the player may enter (automatically rejoins upon return).
Tes3Mod:SkipAnim

SkipAnim
 

Causes the current animation to not be played for this frame. One of the useful things to do with this is to create armor dummies for displaying armor and clothing. Simply create a new NPC, set its health to 0, and attach to it a script like the following:
 
When you insert the NPC into the game it will die (since it has no hitpoints) but it will not 'fall over' since all its animations are disabled. You can then access its inventory (since it's dead) and any armor that you place in the dead body will be automatically equipped.  Unfortunately, it appears that weapons are not automatically equipped in the same manner.

See Also: LoopGroup, PlayGroup
Tes3Mod:ShowRestMenu

ShowRestMenu
 

Displays the standard rest/sleep menu allowing the player to choose the amount of time they wish to rest.
Tes3Mod:ShowSceneGraph

ShowSceneGraph (SSG)
 

When you use this command the game will freeze for a short time (30 seconds or so). When the command is finished it will actually create a new Window on the desktop with all the game renderer's information (use Alt-Tab or Alt-Esc to temporarily exit the game and view the other window). The information is displayed via a tree control and those familiar with hacking NIF files may recognize some of the information. The world objects can be found under the World Scene Graph--WorldRoot--WorldObjectRoot and then under the currently loaded cells. You can view the various rendering information under each object. This probably won't be much use to most people but only those performing low-level hacking/editing of Morrowind or it's data files (such as NIF files).
Tes3Mod:ShowTargets

ShowTargets (ST)
 

Console command that shows the selected actor's target group members.
Tes3Mod:ShowVars

ShowVars (SV)
 

Console command that lists all the global and/or local variables. If no object is currently selected in the console (shown by the console title) SV will list all global variables and values. If an object is selected SV will list all the object's script variables and values (if it has any). This console command is invaluable for debugging purposes.
Tes3Mod:ShowMap

ShowMap
 

Shows the given cell name on the world map.  Will match complete or partial cells, so ShowMap, "Vivec" will show cells Vivec and ''Vivec, Fred's House'' as well.
Tes3Mod:ShowGroup

ShowGroup (SG)
 

Unknown console command.
Tes3Mod:Show

Show
 

Unknown console command (similar to ShowVars?). If you use this in a script it will prevent the script from being compiled (you'll get no errors in the editor but the compiled script data is not saved to the plugin).

This function is used to return the value of the specific variable.
Tes3Mod:ShowAnim

ShowAnim (SA)
 

Unknown console command.
Tes3Mod:SetPos

SetPos
 

Sets the position of the object in game units (70 units per meter) using the given world axis.  In Tribunal the function also accepts local float variables in addition to literal values (does not accept globals). This function does modify the player's position. Unfortunately there are problems when you use SetPos to change the current cell.  The cell's contents are not always loaded correctly.  In this case you may need to use the COE (CenterOnExterior) function to change the current cell and then the SetPos to modify the player's position. An easier method is to use a FixMe function call after the player's position has changed.

A related problem is in exteriors the function will only work in the currently loaded area (the current cell plus 2-3 cells around the current cell). It can't be used to move something to an arbitrary exterior cell. 

It's also worth noting that an object's new x,y,z co-ordinates are not stored in save game files. Any scripts that need to permanently alter an object's position in the game world need to store the new co-ordinates in local variables and update the object's position accordingly.

See Also: GetPos
Tes3Mod:SetPCFacRep

SetPCFacRep
 

Defines the reaction modifier for members of the specified faction towards the PC.

See Also: GetPCFacRep, ModPCFacRep