morrowind script extender v2 documentation · morrowind script extender v2 documentation, release...

131
Morrowind Script Extender v2 Documentation Release 2.0 MWSE Team Feb 09, 2018

Upload: others

Post on 22-Mar-2020

76 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2Documentation

Release 2.0

MWSE Team

Feb 09, 2018

Page 2: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in
Page 3: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Contents

1 Installation 3

2 Changelog 5

3 Contributing 9

4 Authors 11

5 License 13

6 References 15

7 GMST List 25

8 Function List 57

i

Page 4: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

ii

Page 5: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

The Morrowind Script Extender makes additional functions available for use in Morrowind scripts, beyond thoseprovided by the game’s construction set.

These extra functions allow modders to add features and behavior to scripts that would otherwise be impractical orimpossible.

Important: This version of Morrowind Script Extender is in beta for testing. If you are interested in testing, downloadthe latest build and join the Morrowind Modding Community Discord

Contents 1

Page 6: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

2 Contents

Page 7: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

CHAPTER 1

Installation

1.1 Requirements

The Visual Studio 2017 Redistributable is required for MWSE v2.0.

Additionally, MWSE has two soft requirements that all typical users should have installed.

• The Morrowind Graphic Extender XE (MGE XE) allows MWSE to be loaded without any separate launcher.

• The Morrowind Code Patch is not required, but its scripting fixes are highly recommended. Various MWSEmods also require special features from this extension.

1.2 Installation

• Head to the releases page, and download the latest release.

• After installing MGE XE, copy the MWSE.dll file from the above download to your Morrowind directory. Thiswill overwrite the DLL that came with MGE XE.

Note: Previous versions of MWSE came with a launcher, which is not needed if you use MGE XE. It is highlyrecommended that you load MWSE through MGE XE. If this is for some reason impossible, the old launcher can stillbe obtained from a an older version.

3

Page 8: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

4 Chapter 1. Installation

Page 9: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

CHAPTER 2

Changelog

This page documents the various changes to the Morrowind Script Extender from version 2.0 onwards. Older versionsare documented on GitHub.

More details about each function can be found under the New Functions page.

2.1 v2.0.0

This release marks a complete under the hood rewrite of how MWSE functions. Version 2.0 is designed to be 100%compatible with previous version of MWSE.

2.1.1 Added

• xContentListFiltered: Behaves like xContentList, with an additional filter parameter passed. Thefilter allows filtering by record type and/or enchantment, and only records matching that filter will be returned.

• xEquipmentList: Behaves similar to xContentList/xContentListFiltered, returning inventoryinformation. This function allows looping over equipped items instead of all items, and also returns some sub-type information. Usage is setx id count type subtype value weight name enchantIdnextNode to xEquipmentList node typeFilter subTypeFilter. The typeFilter pa-rameter matches the type returned, and will restrict results to that item type (e.g. only clothing). ThesubTypeFilter allows specifying a weapon type or armor/clothing slot. The subtype index is one higher forboth return values and parameters are one higher than in their normal records (e.g. pants are index 1 instead of0). If typeFilter or subTypeFilter are 0, no filtering is performed on those values.

• xGetAlchemyInfo: Allows the fetching the effect count (and flags) for an alchemy record.

• xGetIngredientEffect: Returns the effect id and skill or attribute id associated with theeffect. E.g. setx effectId skillOrAttributeId to xGetIngredientEffect"ingred_alit_hide_01" 1 gets the first effect the ingredient has.

• xGetItemCount: This function behaves like the vanilla GetItemCount, but accepts a variable string input.

5

Page 10: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

• xGetKeyBind: Obtains the key codes used for input (e.g. what the current activation key is). Also suppliesinformation such as if an input is bound to a keyboard, joystick, or mouse.

• xGetMCPFeatureState: The Morrowind Code Patch has become more important with its fixes to the scriptparser, and other scripting extensions. If the user has the MCP installed and hasn’t deleted the mcpatch folder,this function will let the script know if a MCP feature is enabled or disabled. The ID passed to this function canbe found in the describe.json file in the mcpatch folder.

• xGetModel: This function gets the model of either a reference or a record. It will work on anything but NPCor creature references, which return 0.

• xGetStackSize: This function returns the size of a stack. If it can’t find the stack information, it returns 0.

• xSetIngredientEffect: Sets an ingredient’s effect at a given index. E.g. xSetIngredientEffect"ingred_alit_hide_01" 1 83 4 sets the first effect of alit hide to be fortify speed.

• xStartScript, xStopScript and xScriptRunning: These functions are wrappers around their non-MWSE counterparts, and accept a variable input. Additionally, calling xStopScript 0 will effectively callxStopScript on the current script.

• xStringCapture: Performs a regex match using a given pattern on a given string. Usage issetx match1 match2 match3 to xStringCapture string pattern numResults. ThenumResults value must match the number of return values desired. If there aren’t enough matches to filleach return value, or if there isn’t a capture, the return (extra) return values will be 0.

2.1.2 Changed

• Performance improvements across the board. The underlying mechanism used to extend Morrowind’s scriptingsystem has been entirely rewritten to improve performance. Performance gains as high as 90 FPS on heavyMWSE-scripted modlists have been recorded. Mods such as MWSE Containers and MWSE Alchemy Filtersshould no longer cause long hiccups and mods like The Bare Necessities should not cause such severe per-formance hits. This opens new scripting opportunities that previously were not viable due to the old version’sperformance issues.

• String storage has changed under the hood. It’s just as reliable as before, but is more recognizable. Stringsare stored by ID rather than as string pointers, starting at an index of 40,000. An invalid/empty response isstill treated as zero. Scripters do not need to change how they handle strings in any way. This has the addedside-benefit that string IDs can more reliably be stored in globals.

• Version information has adapted to something more traditional. MWSE is mature software that has been out formany years. It isn’t in alpha or beta anymore. As such, it is treating pre-2.0 MWSE as version 1, and makingthe leap to version 2 with this entire rewrite.

• xStringParse: This function can now be used to determine MWSE’s version number at runtime. This canbe useful for ensuring that a feature is available. Correct usage is setx version versionCheck toxStringParse "MWSE_VERSION" versionNumberDesired.

– The first returned value is a long with a value starting at 2000000 for version 2.0.0. This continues toa pattern, where the hypothetical version 5.59.3 would return 5059003. On versions of MWSE prior to2.0, xStringParse will return 0.

– The second parameter can be used as a version check, and the second returned value will be 1 ifthe current version meets that requirement. For example, setx version versionCheck toxStringParse "MWSE_VERSION" 2001000 will set versionCheck to 1 if the current MWSEversion is at least 2.1.0. Otherwise versionCheck will be 0.

• xGetValue and xSetValue now work on gold without hardcoding values.

• xAddEffect, xDeleteEffect, xGetEffectInfo, and xSetEffectInfo now support ALCH (po-tion) records.

6 Chapter 2. Changelog

Page 11: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

• xGetRef now returns a reference to its caller when given the argument 0.

2.1.3 Fixed

• xAITravel, xStartCombat, xDistance, xGetCombat, xInventory, xRefID, and xRefType nolonger cause a crash when called by an invalid reference.

• xGetRace no longer leaks memory. Arrays returned by this function are reused and refreshed with the newestinformation on each call.

• xPlace’s returned reference can now be reliably used in the same frame that it was created.

• xSetBaseEffectInfo correctly functions. Previously it had a bug that prevented it from actually settingany values.

• xSetName is now safe to use, and no longer rewrites random portions of memory. This function used to causevarious issues if the new name was longer than the old name on most object types. This could cause randomvalue changes, and make the game prone to crashing.

• xSetQuality now works correctly on apparatus.

• xSetWeight now works correctly on lights.

• xStringLength now correctly returns 0 when called on an empty string.

2.1.4 Known Issues

• xEquipmentList: The count returned is always 1, though more than one ammo item could be equipped.

• xGetEncumbrance: This function is unreliable and should not be used yet.

2.1. v2.0.0 7

Page 12: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8 Chapter 2. Changelog

Page 13: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

CHAPTER 3

Contributing

The Morrowind Script Extender is open source software that welcomes contributions in the forms of ideas, bug fixes,and new features.

Contributing to MWSE requires a copy of Visual Studio 2017, with the following features enabled:

• Workloads:

– Desktop development with C++

• Individual components:

– VC++ 2017 v141 toolset (x86,x64)

– Windows 10 SDK for Desktop C++ [x86 and x64] (any version will do)

9

Page 14: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

10 Chapter 3. Contributing

Page 15: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

CHAPTER 4

Authors

The following individuals have contributed to the Morrowind Script Extender.

• Anthony Garcia

• Charles Cooley (cdcooley)

• Cody Erekson (Fliggerty)

• FreshFish

• Grant McDorman

• Greatness7

• Merzasphor

• Michael Wallar (NullCascade)

• Tim Peters

• Timeslip

11

Page 16: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

12 Chapter 4. Authors

Page 17: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

CHAPTER 5

License

The Morrowind Script Extender is free software, licensed according to the GNU General Public License v2, and comeswith ABSOLUTELY NO WARRANTY.

13

Page 18: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

14 Chapter 5. License

Page 19: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

CHAPTER 6

References

MWSE functions sometimes need magic numbers to help denote specific types. This page helps to explain what thesevalues mean, and what they are.

6.1 Armor Types

ID Armor Type0 Helmet1 Cuirass2 Left Pauldron3 Right Pauldron4 Greaves5 Boots6 Left Gauntlet7 Right Gauntlet8 Shield9 Left Bracer10 Right Bracer

Note: xEquipmentList’s returns this value as the subtype for armor records. Note that the values are increased byone by that function.

15

Page 20: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

6.2 Attributes

ID Attribute0 Strength1 Intelligence2 Willpower3 Agility4 Speed5 Endurance6 Personality7 Luck

6.3 Clothing Types

ID Type0 Pants1 Shoes2 Shirt3 Belt4 Robe5 Right Glove6 Left Glove7 Skirt8 Ring9 Amulet

Note: xEquipmentList’s returns this value as the subtype for clothing records. Note that the values are increased byone by that function.

6.4 Control Types

ID Type0 Forward1 Back2 Slide Left3 Slide Right4 Use5 Activate6 Ready Item7 Ready Magic8 Crouch/Sneak9 Run10 Always Run

Continued on next page

16 Chapter 6. References

Page 21: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 6.1 – continued from previous pageID Type11 Auto Run12 Jump13 Next Weapon14 Prev Weapon15 Next Spell16 Prev Spell17 Toggle POV18 Menu Mode19 Journal20 Rest21 Quick Menu22 Quick 123 Quick 224 Quick 325 Quick 426 Quick 527 Quick 628 Quick 729 Quick 830 Quick 931 Quick 1032 Quick Save33 Quick Load

6.5 Magic Effects

ID Effect0 Water Breathing1 Swift Swim2 Water Walking3 Shield4 Fire Shield5 Lightning Shield6 Frost Shield7 Burden8 Feather9 Jump10 Levitate11 Slow Fall12 Lock13 Open14 Fire Damage15 Shock Damage16 Frost Damage17 Drain Attribute18 Drain Health19 Drain Magicka20 Drain Fatigue

Continued on next page

6.5. Magic Effects 17

Page 22: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 6.2 – continued from previous pageID Effect21 Drain Skill22 Damage Attribute23 Damage Health24 Damage Magicka25 Damage Fatigue26 Damage Skill27 Poison28 Weakness to Fire29 Weakness to Frost30 Weakness to Shock31 Weakness to Magicka32 Weakness to Common Disease33 Weakness to Blight Disease34 Weakness to Corprus Disease35 Weakness to Poison36 Weakness to Normal Weapons37 Disintegrate Weapon38 Disintegrate Armor39 Invisibility40 Chameleon41 Light42 Sanctuary43 NightEye44 Charm45 Paralyze46 Silence47 Blind48 Sound49 Calm Humanoid50 Calm Creature51 Frenzy Humanoid52 Frenzy Creature53 Demoralize Humanoid54 Demoralize Creature55 Rally Humanoid56 Rally Creature57 Dispel58 Soultrap59 Telekinesis60 Mark61 Recall62 Divine Intervention63 Almsivi Intervention64 Detect Animal65 Detect Enchantment66 Detect Key67 Spell Absorption68 Reflect69 Cure Common Disease

Continued on next page

18 Chapter 6. References

Page 23: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 6.2 – continued from previous pageID Effect70 Cure Blight Disease71 Cure Corprus Disease72 Cure Poison73 Cure Paralyzation74 Restore Attribute75 Restore Health76 Restore Magicka77 Restore Fatigue78 Restore Skill79 Fortify Attribute80 Fortify Health81 Fortify Magicka82 Fortify Fatigue83 Fortify Skill84 Fortify MaximumMagicka85 Absorb Attribute86 Absorb Health87 Absorb Magicka88 Absorb Fatigue89 Absorb Skill90 Resist Fire91 Resist Frost92 Resist Shock93 Resist Magicka94 Resist Common Disease95 Resist Blight Disease96 Resist Corprus Disease97 Resist Poison98 Resist Normal Weapons99 Resist Paralysis100 Remove Curse101 Turn Undead102 Summon Scamp103 Summon Clannfear104 Summon Daedroth105 Summon Dremora106 Summon AncestralGhost107 Summon SkeletalMinion108 Summon Bonewalker109 Summon GreaterBonewalker110 Summon Bonelord111 Summon WingedTwilight112 Summon Hunger113 Summon GoldenSaint114 Summon FlameAtronach115 Summon FrostAtronach116 Summon StormAtronach117 Fortify Attack118 Command Creature

Continued on next page

6.5. Magic Effects 19

Page 24: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 6.2 – continued from previous pageID Effect119 Command Humanoid120 Bound Dagger121 Bound Longsword122 Bound Mace123 Bound BattleAxe124 Bound Spear125 Bound Longbow126 EXTRASPELL127 Bound Cuirass128 Bound Helm129 Bound Boots130 Bound Shield131 Bound Gloves132 Corprus133 Vampirism134 Summon Centurion Sphere135 Sun Damage136 Stunted Magicka137 Summon Fabricant138 Call Wolf139 Call Bear140 Summon Bonewolf141 sEffectSummonCreature04142 sEffectSummonCreature05

Note: The attribute- and skill-affecting effects are often paired with a specific attribute or skill in function calls. Seethe associated tables below for their values.

20 Chapter 6. References

Page 25: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

6.6 Magic Effects Flags

Value Meaning1 Targets skill.2 Targets attribute.4 No duration.8 No magnitude.16 Harmful.32 Continuous VFX.64 Cast self.128 Cast touch.256 Cast target.512 Valid for spellmaking.1024 Valid for enchanting.2048 Negative lighting.4096 Applied once.8192 Stealth.16384 Non-recastable.32768 Illegal daedra.65536 Unreflectable.131072 Caster linked.

Note: Negative lighting does not appear to have any effect.

6.6. Magic Effects Flags 21

Page 26: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

6.7 Record Types

Value Code Meaning1230259009 ACTI Activator1212369985 ACTI Alchemy1330466113 AMMO Ammunition1095782465 ACTI Apparatus1330467393 ARMO Armor1263488834 BOOK Book1414483011 CLOT Clothing1414418243 CONT Container1095062083 CREA Creature1380929348 DOOR Door1380404809 INGR Ingredient1129727308 LEVC Levelled Creature1230390604 LEVI Levelled Item1212631372 LIGH Light1262702412 LOCK Lockpick1129531725 MISC Misc Item1598246990 NPC_ NPC1112494672 PROB Probe1095779666 REPA Repair Item1414546259 SCPT Script1195658835 SNDG Sound Generator1413567571 STAT Static1346454871 WEAP Weapon

Note: The AMMO record type is for arrows and bolts only, even though these usually show up in the weapons tab ofthe Construction Set. Thrown weapons do not have this type.

6.8 Skill Types

ID Type0 Major1 Minor2 Miscellaneous

22 Chapter 6. References

Page 27: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

6.9 Skills

ID Skill0 Block1 Armorer2 Medium Armor3 Heavy Armor4 Blunt Weapon5 Long Blade6 Axe7 Spear8 Athletics9 Enchant10 Destruction11 Alteration12 Illusion13 Conjuration14 Mysticism15 Restoration16 Alchemy17 Unarmored18 Security19 Sneak20 Acrobatics21 Light Armor22 Short Blade23 Marksman24 Mercantile25 Speechcraft26 Hand to Hand

6.10 Schools

ID School0 Alteration1 Conjuration2 Destruction3 Illusion4 Mysticism5 Restoration

6.9. Skills 23

Page 28: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

6.11 Specialization Types

ID Specialization0 Combat1 Magic2 Stealth

6.12 Weapon Types

ID Weapon Type0 Short Blade One Hand1 Long Blade One Hand2 Long Blade Two Close3 Blunt One Hand4 Blunt Two Close5 Blunt Two Wide6 Spear Two Wide7 Axe One Hand8 Axe Two Hand9 Marksman Bow10 Marksman Crossbow11 Marksman Thrown12 Arrow13 Bolt

Note: xEquipmentList’s returns this value as the subtype for weapon records. Note that the values are increased byone by that function.

24 Chapter 6. References

Page 29: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

CHAPTER 7

GMST List

Index Type Identifier Default Value0 String sMonthMorningstar “Morning Star”1 String sMonthSunsdawn “Sun’s Dawn”2 String sMonthFirstseed “First Seed”3 String sMonthRainshand “Rain’s Hand”4 String sMonthSecondseed “Second Seed”5 String sMonthMidyear “Mid Year”6 String sMonthSunsheight “Sun’s Height”7 String sMonthLastseed “Last Seed”8 String sMonthHeartfire “Heartfire”9 String sMonthFrostfall “Frost Fall”10 String sMonthSunsdusk “Sun’s Dusk”11 String sMonthEveningstar “Evening Star”12 String sSpecialization “Specialization”13 String sSpecializationCombat “Combat”14 String sSpecializationMagic “Magic”15 String sSpecializationStealth “Stealth”16 String sSkillClassMajor “Major Skills”17 String sSkillClassMinor “Minor Skills”18 String sSkillClassMisc “Misc Skills”19 String sRacialTraits “Racial Traits”20 String sHealthPerHourOfRest “Health per hour of rest”21 String sHealthPerLevel “Health per level”22 String sGoverningAttribute “Governing Attribute”23 String sClass “Class”24 String sTraits “Traits”25 String sJournal “Journal”26 String sOK “OK”27 String sClose “Close”

Continued on next page

25

Page 30: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value28 String sPrev “Prev”29 String sNext “Next”30 String sTake “Take”31 String sWeaponTab “Weapon”32 String sApparelTab “Apparel”33 String sMagicTab “Magic”34 String sMiscTab “Misc”35 String sWornTab “Worn”36 String sAllTab “All”37 String sAttack “Attack”38 String sUses “Uses”39 String sQuality “Quality”40 String sCharges “Charge:”41 String sArmorRating “Armor Rating”42 String sSlash “Slash”43 String sThrust “Thrust”44 String sChop “Chop”45 String sEncumbrance “Encumbrance”46 String sCondition “Condition”47 String sWeight “Weight”48 String sValue “Value”49 String sLight “Light”50 String sMedium “Medium”51 String sHeavy “Heavy”52 String sCancel “Cancel”53 String sTakeAll “Take All”54 String sUntilHealed “Until Healed”55 String sRest “Rest”56 String sWait “Wait”57 String sRestIllegal “Resting here is illegal. You’ll need to find a bed.”58 String sGold “Gold”59 String sMove “Move”60 String sTo “to”61 String sActorInCombat “This character is in combat.”62 String sArmor “Armor”63 String sTopics “Topics”64 String sService “Service”65 String sPersuasion “Persuasion”66 String sBye “Bye”67 String sGoodbye “Goodbye”68 String sYes “Yes”69 String sNo “No”70 String sOn “On”71 String sOff “Off”72 String sFull “Full”73 String sWorld “World”74 String sExpelled “EXPELLED”75 String sExpelledMessage “You have been expelled from”76 String sFavoriteSkills “Favorite Skills”

Continued on next page

26 Chapter 7. GMST List

Page 31: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value77 String sGame “Game”78 String sVideo “Video”79 String sAudio “Audio”80 String sControls “Controls”81 String sPrefs “Prefs”82 String sPreferences “Preferences”83 String sNewGame “New Game”84 String sExitGame “Exit Game”85 String sOptions “Options Menu”86 String sSaveGame “Save Game”87 String sLoadGame “Load Game”88 String sDeleteGame “Delete Game”89 String sSaveGameDenied “You cannot save your game right now.”90 String sSaveGameFailed “An error was encountered while saving the game.”91 String sSaveGameTooBig “There is not enough space to save this game. Free up at least %i blocks and try again.”92 String sSaveGameNoMemory “Unable to create Save Game. Free up 100 blocks and try again.”93 String sMaximumSaveGameMessage “You have reached the limit of Morrowind saved games. Please delete a Morrowind saved game and try again.”94 String sRender_Distance “View Distance”95 String sNear “Near”96 String sFar “Far”97 String sGamma_Correction “Gamma Correction”98 String sLight_Gamma “Light”99 String sDark_Gamma “Dark”100 String sSeldom “Seldom”101 String sAlways “Always”102 String sWaterTerrainReflect “Reflect Terrain”103 String sWaterReflectUpdate “Reflection Updating”104 Float fWaterReflectUpdateAlways 0.0105 Float fWaterReflectUpdateSeldom 10.0106 String sMaster “Master”107 String sVoice “Voice”108 String sEffects “Effects”109 String sFootsteps “Footsteps”110 String sMusic “Music”111 String sTransparency_Menu “Menu Transparency”112 String sMenu_Help_Delay “Menu Help Delay”113 String sAIDistance “AI Distance”114 String sHigh “High”115 String sLow “Low”116 String sDetail_Level “Detail Level”117 String sMenus “Menus”118 String sStrip “Strip”119 String sReturnToGame “Return To Game”120 String sForward “Forward”121 String sBack “Back”122 String sLeft “Left”123 String sRight “Right”124 String sUse “Use”125 String sActivate “Activate”

Continued on next page

27

Page 32: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value126 String sReady_Weapon “Ready Weapon”127 String sReady_Magic “Ready Magic”128 String sCrouch_Sneak “Sneak”129 String sRun “Run”130 String sAlways_Run “Always Run”131 String sAuto_Run “Auto Run”132 String sJump “Jump”133 String sNextWeapon “Next Weapon”134 String sPrevWeapon “Previous Weapon”135 String sNextSpell “Next Spell”136 String sPrevSpell “Previous Spell”137 String sTogglePOVCmd “Toggle POV”138 String sMenu_Mode “Menu Mode”139 String sJournalCmd “Journal”140 String sRestKey “Rest”141 String sQuickMenu “Quick Menu”142 String sQuick1Cmd “Quick 1”143 String sQuick2Cmd “Quick 2”144 String sQuick3Cmd “Quick 3”145 String sQuick4Cmd “Quick 4”146 String sQuick5Cmd “Quick 5”147 String sQuick6Cmd “Quick 6”148 String sQuick7Cmd “Quick 7”149 String sQuick8Cmd “Quick 8”150 String sQuick9Cmd “Quick 9”151 String sQuick10Cmd “Quick 10”152 String sQuickSaveCmd “Quick Save”153 String sQuickLoadCmd “Quick Load”154 String sKeyName_00155 String sKeyName_01 “ESC”156 String sKeyName_02 “1”157 String sKeyName_03 “2”158 String sKeyName_04 “3”159 String sKeyName_05 “4”160 String sKeyName_06 “5”161 String sKeyName_07 “6”162 String sKeyName_08 “7”163 String sKeyName_09 “8”164 String sKeyName_0A “9”165 String sKeyName_0B “0”166 String sKeyName_0C “-“167 String sKeyName_0D ” “168 String sKeyName_0E “Back Space”169 String sKeyName_0F “Tab”170 String sKeyName_10 “Q”171 String sKeyName_11 “W”172 String sKeyName_12 “E”173 String sKeyName_13 “R”174 String sKeyName_14 “T”

Continued on next page

28 Chapter 7. GMST List

Page 33: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value175 String sKeyName_15 “Y”176 String sKeyName_16 “U”177 String sKeyName_17 “I”178 String sKeyName_18 “O”179 String sKeyName_19 “P”180 String sKeyName_1A “[“181 String sKeyName_1B “]”182 String sKeyName_1C “Return”183 String sKeyName_1D “Left Ctrl”184 String sKeyName_1E “A”185 String sKeyName_1F “S”186 String sKeyName_20 “D”187 String sKeyName_21 “F”188 String sKeyName_22 “G”189 String sKeyName_23 “H”190 String sKeyName_24 “J”191 String sKeyName_25 “K”192 String sKeyName_26 “L”193 String sKeyName_27 “;”194 String sKeyName_28 “’”195 String sKeyName_29 “Grave”196 String sKeyName_2A “Left Shift”197 String sKeyName_2B “"198 String sKeyName_2C “Z”199 String sKeyName_2D “X”200 String sKeyName_2E “C”201 String sKeyName_2F “V”202 String sKeyName_30 “B”203 String sKeyName_31 “N”204 String sKeyName_32 “M”205 String sKeyName_33 “,”206 String sKeyName_34 “.”207 String sKeyName_35 “/”208 String sKeyName_36 “Right Shift”209 String sKeyName_37 “Numpad *”210 String sKeyName_38 “Left Alt”211 String sKeyName_39 “SPACEBAR”212 String sKeyName_3A “Caps Lock”213 String sKeyName_3B “F1”214 String sKeyName_3C “F2”215 String sKeyName_3D “F3”216 String sKeyName_3E “F4”217 String sKeyName_3F “F5”218 String sKeyName_40 “F6”219 String sKeyName_41 “F7”220 String sKeyName_42 “F8”221 String sKeyName_43 “F9”222 String sKeyName_44 “F10”223 String sKeyName_45 “Num Lock”

Continued on next page

29

Page 34: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value224 String sKeyName_46 “Scroll Lock”225 String sKeyName_47 “Numpad 7”226 String sKeyName_48 “Numpad 8”227 String sKeyName_49 “Numpad 9”228 String sKeyName_4A “Numpad -“229 String sKeyName_4B “Numpad 4”230 String sKeyName_4C “Numpad 5”231 String sKeyName_4D “Numpad 6”232 String sKeyName_4E “Numpad +”233 String sKeyName_4F “Numpad 1”234 String sKeyName_50 “Numpad 2”235 String sKeyName_51 “Numpad 3”236 String sKeyName_52 “Numpad 0”237 String sKeyName_53 “Decimal”238 String sKeyName_54239 String sKeyName_55240 String sKeyName_56 “OEM 102”241 String sKeyName_57 “F11”242 String sKeyName_58 “F12”243 String sKeyName_59244 String sKeyName_5A245 String sKeyName_5B246 String sKeyName_5C247 String sKeyName_5D248 String sKeyName_5E249 String sKeyName_5F250 String sKeyName_60251 String sKeyName_61252 String sKeyName_62253 String sKeyName_63254 String sKeyName_64 “F13”255 String sKeyName_65 “F14”256 String sKeyName_66 “F15”257 String sKeyName_67258 String sKeyName_68259 String sKeyName_69260 String sKeyName_6A261 String sKeyName_6B262 String sKeyName_6C263 String sKeyName_6D264 String sKeyName_6E265 String sKeyName_6F266 String sKeyName_70 “Kana”267 String sKeyName_71268 String sKeyName_72269 String sKeyName_73 “Abnt C1”270 String sKeyName_74271 String sKeyName_75272 String sKeyName_76

Continued on next page

30 Chapter 7. GMST List

Page 35: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value273 String sKeyName_77274 String sKeyName_78275 String sKeyName_79 “Cnvrt”276 String sKeyName_7A277 String sKeyName_7B “No Cnvrt”278 String sKeyName_7C279 String sKeyName_7D “Yen”280 String sKeyName_7E “Abnt C2”281 String sKeyName_7F282 String sKeyName_80283 String sKeyName_81284 String sKeyName_82285 String sKeyName_83286 String sKeyName_84287 String sKeyName_85288 String sKeyName_86289 String sKeyName_87290 String sKeyName_88291 String sKeyName_89292 String sKeyName_8A293 String sKeyName_8B294 String sKeyName_8C295 String sKeyName_8D “Np Equals”296 String sKeyName_8E297 String sKeyName_8F298 String sKeyName_90 “PrvTrk”299 String sKeyName_91 “AT”300 String sKeyName_92 “:”301 String sKeyName_93 “_”302 String sKeyName_94 “Kanji”303 String sKeyName_95 “Stop”304 String sKeyName_96 “Ax”305 String sKeyName_97 “Unlabeled”306 String sKeyName_98307 String sKeyName_99 “NxtTrk”308 String sKeyName_9A309 String sKeyName_9B310 String sKeyName_9C “Right Enter”311 String sKeyName_9D “Right Ctrl”312 String sKeyName_9E313 String sKeyName_9F314 String sKeyName_A0 “Mute”315 String sKeyName_A1 “Calc”316 String sKeyName_A2 “Play Pause”317 String sKeyName_A3318 String sKeyName_A4 “Media Stop”319 String sKeyName_A5320 String sKeyName_A6321 String sKeyName_A7

Continued on next page

31

Page 36: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value322 String sKeyName_A8323 String sKeyName_A9324 String sKeyName_AA325 String sKeyName_AB326 String sKeyName_AC327 String sKeyName_AD328 String sKeyName_AE “Volume Down”329 String sKeyName_AF330 String sKeyName_B0 “Volume Up”331 String sKeyName_B1332 String sKeyName_B2 “Web Home”333 String sKeyName_B3 “Numpad ,”334 String sKeyName_B4335 String sKeyName_B5 “Numpad /”336 String sKeyName_B6337 String sKeyName_B7 “SysRq”338 String sKeyName_B8 “Right Alt”339 String sKeyName_B9340 String sKeyName_BA341 String sKeyName_BB342 String sKeyName_BC343 String sKeyName_BD344 String sKeyName_BE345 String sKeyName_BF346 String sKeyName_C0347 String sKeyName_C1348 String sKeyName_C2349 String sKeyName_C3350 String sKeyName_C4351 String sKeyName_C5 “Pause”352 String sKeyName_C6353 String sKeyName_C7 “Home”354 String sKeyName_C8 “Up”355 String sKeyName_C9 “Page Up”356 String sKeyName_CA357 String sKeyName_CB “Left”358 String sKeyName_CC359 String sKeyName_CD “Right”360 String sKeyName_CE361 String sKeyName_CF “End”362 String sKeyName_D0 “Down”363 String sKeyName_D1 “Page Down”364 String sKeyName_D2 “Insert”365 String sKeyName_D3 “Delete”366 String sKeyName_D4367 String sKeyName_D5368 String sKeyName_D6369 String sKeyName_D7370 String sKeyName_D8

Continued on next page

32 Chapter 7. GMST List

Page 37: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value371 String sKeyName_D9372 String sKeyName_DA373 String sKeyName_DB “Left Win”374 String sKeyName_DC “Right Win”375 String sKeyName_DD “Apps”376 String sKeyName_DE “Power”377 String sKeyName_DF “Sleep”378 String sKeyName_E0379 String sKeyName_E1380 String sKeyName_E2381 String sKeyName_E3 “Wake”382 String sKeyName_E4383 String sKeyName_E5 “Web Search”384 String sKeyName_E6 “Web Favs”385 String sKeyName_E7 “Web Ref”386 String sKeyName_E8 “Web Stop”387 String sKeyName_E9 “Web Fwd”388 String sKeyName_EA “Web Back”389 String sKeyName_EB “My Comp”390 String sKeyName_EC391 String sKeyName_ED392 String sKeyName_EE393 String sKeyName_EF394 String sKeyName_F0395 String sKeyName_F1396 String sKeyName_F2397 String sKeyName_F3398 String sKeyName_F4399 String sKeyName_F5400 String sKeyName_F6401 String sKeyName_F7402 String sKeyName_F8403 String sKeyName_F9404 String sKeyName_FA405 String sKeyName_FB406 String sKeyName_FC407 String sKeyName_FD408 String sKeyName_FE409 String sKeyName_FF410 String sForwardXbox “Move Forward”411 String sBackXbox “Move Backward”412 String sSlideLeftXbox “Slide Left”413 String sSlideRightXbox “Slide Right”414 String sMenuModeXbox “Menu Mode”415 String sActivateXbox “Activate”416 String sUseXbox “Use”417 String sReadyItemXbox “Ready Item”418 String sReadyMagicXbox “Ready Magic”419 String sCrouchXbox “Sneak”

Continued on next page

33

Page 38: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value420 String sRunXbox “Run”421 String sToggleRunXbox “Toggle Run”422 String sJumpXbox “Jump”423 String sTogglePOVXbox “Toggle View”424 String sMenuNextXbox “Next Menu”425 String sMenuPrevXbox “Previous Menu”426 String sJournalXbox “Journal”427 String sQuick4Xbox “sQuick4Xbox”428 String sQuick5Xbox “sQuick5Xbox”429 String sQuick6Xbox “sQuick6Xbox”430 String sQuick7Xbox “sQuick7Xbox”431 String sQuick8Xbox “sQuick8Xbox”432 String sQuick9Xbox “sQuick9Xbox”433 String sQuick0Xbox “sQuick0Xbox”434 String sOptionsMenuXbox “Options Menu”435 String sSystemMenuXbox “System Menu”436 String sRestMenuXbox “Rest/Wait”437 String sQuickSaveXbox “Quick Save”438 String sQuickLoadXbox “Quick Load”439 String sMoveUpXbox “Move Up”440 String sMoveDownXbox “Move Down”441 String sLookUpXbox “Look Up”442 String sLookDownXbox “Look Down”443 String sTurnLeftXbox “Turn Left”444 String sTurnRightXbox “Turn Right”445 String sNextWeaponXbox “Next Weapon”446 String sPrevWeaponXbox “Previous Weapon”447 String sNextSpellXbox “Next Spell”448 String sPrevSpellXbox “Previous Spell”449 String sDialogText1Xbox “PUSH”450 String sDialogText2Xbox “TO GO BACK”451 String sDialogText3Xbox “TO READ MORE”452 String sQuick_Save “Auto-Save when Rest”453 String sShadowText “Real-time Shadows”454 String sLockSuccess “Lock pick success!”455 String sLockFail “Lock pick failed.”456 String sLockImpossible “Lock too complex.”457 String sTrapSuccess “Trap disarmed!”458 String sTrapFail “Disarm trap failed.”459 String sTrapImpossible “Trap too complex, your chance to disarm it is zero”460 String sTrapped “Trapped”461 String sLockLevel “Lock Level”462 String sKeyUsed “used to open lock”463 String sUnlocked “Unlocked”464 Float fRepairMult 1.0465 Float fRepairAmountMult 3.0466 Float fSpellValueMult 10.0467 Float fSpellMakingValueMult 7.0468 Float fEnchantmentValueMult 1000.0

Continued on next page

34 Chapter 7. GMST List

Page 39: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value469 Float fTravelMult 4000.0470 Float fTravelTimeMult 16000.0471 Float fMagesGuildTravel 10.0472 String sBarter “Barter”473 String sRepair “Repair”474 String sSpells “Spells”475 String sTraining “Training”476 String sTravel “Travel”477 String sSpellmaking “Spellmaking”478 String sEnchanting “Enchanting”479 String sJoystickNotFound “Joystick not found.”480 String sJournalEntry “Your journal has been updated.”481 String sDay “Day”482 String sCreate “Create”483 String sIngredients “Ingredients”484 String sApparatus “Apparatus”485 String sCreatedEffects “Created Effects”486 String sOnetypeEffectMessage “This effect has already been added.”487 String sName “Name”488 String sNameTitle “Name”489 String sSelect “Select”490 String sBuy “Buy”491 String sInfo “Info”492 String sMagicEffects “Magic Effects”493 String sOnce “Once”494 String sCostCharge “Cost/Charge”495 String sCostChance “Cost/Chance”496 String sAttributesMenu1 “Choose an Attribute”497 String sBirthsignmenu1 “Abilities:”498 String sBirthsignmenu2 “Spells:”499 String sChooseClassMenu1 “Specialization:”500 String sChooseClassMenu2 “Favorite Attributes:”501 String sChooseClassMenu3 “Major Skills:”502 String sChooseClassMenu4 “Minor Skills:”503 String sCreateClassMenuWarning “Reselect your class?”504 String sClassChoiceMenu1 “Answer his questions (Generates Class)”505 String sClassChoiceMenu2 “Give him the info (Pick from Class List)”506 String sClassChoiceMenu3 “Fill out forms yourself (Create Custom Class)”507 String sNotifyMessage1 “You can only rest on solid ground.”508 String sNotifyMessage2 “You can’t rest here enemies are nearby.”509 String sNotifyMessage3 “You cannot sleep when dreaming.”510 String sNotifyMessage4 “Saving. . . ”511 String sNotifyMessage4XBOX “Saving. Please don’t turn off your Xbox console.”512 String sNotifyMessage5 “You must place the object you are holding into a container before exiting menus.”513 String sNotifyMessage6 “Only one of each ingredient can be used to make a potion.”514 String sNotifyMessage6a “At least two ingredients are needed to make a potion.”515 String sNotifyMessage7 “Only four ingredients can be used in a potion.”516 String sNotifyMessage8 “Your potion failed.”517 String sNotifyMessage9 “Your offer is refused.”

Continued on next page

35

Page 40: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value518 String sNotifyMessage10 “You have to name the spell before buying it.”519 String sNotifyMessage11 “You have to have an item to enchant.”520 String sNotifyMessage12 “You don’t have enough gold to buy this spell.”521 String sNotifyMessage13 “Beast races cannot wear full helmets.”522 String sNotifyMessage14 “Beast races cannot wear boots.”523 String sNotifyMessage15 “Beast races cannot wear shoes.”524 String sNotifyMessage16 “You can only wear one clothing item at a time.”525 String sNotifyMessage16_a “You can only equip one item of that type at a time.”526 String sNotifyMessage17 “You cannot train a skill above its governing attribute.”527 String sNotifyMessage18 “You don’t have enough gold to buy this spell.”528 String sNotifyMessage19 “Only one apparatus can be placed in each slot of the alchemy menu.”529 String sNotifyMessage20 “Please remove the object already in the mortar and pestle slot.”530 String sNotifyMessage21 “Please remove the object already in the alembic slot.”531 String sNotifyMessage22 “Please remove the object already in the calcinator slot.”532 String sNotifyMessage23 “Please remove the object already in the retort slot.”533 String sNotifyMessage24 “You need to assign all the major and minor skill slots.”534 String sNotifyMessage25 “You need to pick two favorite attributes.”535 String sNotifyMessage26 “You need to pick a specialization.”536 String sNotifyMessage27 “You need to assign all the major and minor skill slots.”537 String sNotifyMessage28 “You can only add eight effects to a spell.”538 String sNotifyMessage29 “You cannot add more enchantment to an object then it can hold.”539 String sNotifyMessage30 “You have to add at least one effect to a spell.”540 String sNotifyMessage31 “Items already enchanted cannot have another enchantment added.”541 String sNotifyMessage32 “Only soul gems with a soul can be put in the soul gem slot.”542 String sNotifyMessage33 “Only soul gems put in the soul gem slot.”543 String sNotifyMessage34 “The enchantment failed and your gem is destroyed.”544 String sNotifyMessage35 “Only one apparatus item can be equipped at a time.”545 String sNotifyMessage36 “You have to distribute all you points before exiting.”546 String sNotifyMessage37 “You need to type in your name.”547 String sNotifyMessage38 “Skill Increase:”548 String sNotifyMessage39 “Your %s skill increased to %d.”549 String sNotifyMessage40 “Skill Maximum Reached.”550 String sNotifyMessage41 “Your %s skill has reached the limit of your %s.”551 String sNotifyMessage42 “You have been released after %d day.[CRLF]A skill has been affected by your time in prison.”552 String sNotifyMessage43 “You have been released after %d days.[CRLF]Your skills have been affected by your time in prison.”553 String sNotifyMessage44 “Your %s skill decreased to %d.”554 String sNotifyMessage45 “You need a Mortar and Pestle to use”555 String sNotifyMessage46 “You need a Alembic to use”556 String sNotifyMessage47 “You need a Calcinator to use”557 String sNotifyMessage48 “You need a Retort to use”558 String sNotifyMessage49 “That %s is mine.”559 String sNotifyMessage50 “%s has no effect on you.”560 String sNotifyMessage51 “The %s has been used up.”561 String sNotifyMessage52 “You must have a soul gem with a soul to make an Enchanted Item”562 String sNotifyMessage53 “Your menu sizes and positions have been saved for exploring mode.”563 String sNotifyMessage54 “Do you want to start a new game and lose your current game?”564 String sNotifyMessage55 “Please reconnect the controller and press START to continue.”565 String sNotifyMessage56 “There’s a problem with the disc you’re using. It may be dirty or damaged. [CRLF]Press A to continue.”566 String sNotifyMessage57 “Please press START to begin.”

Continued on next page

36 Chapter 7. GMST List

Page 41: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value567 String sNotifyMessage58 “Your Xbox Hard Disk doesn’t have enough free blocks to save games. [CRLF]Press A to continue without saving [CRLF]or B to free more blocks.”568 String sNotifyMessage59 “You are over-encumbered.”569 String sNotifyMessage60 “%s has been added to your inventory.”570 String sNotifyMessage61 “%d %s has been added to your inventory.”571 String sNotifyMessage62 “%s has been removed from your inventory.”572 String sNotifyMessage63 “%d %s has been removed from your inventory.”573 String sNotifyMessage64 “You can’t sleep in someone else’s bed!”574 String sNotifyMessage65 “You can’t save a game with no name!”575 String sNotifyMessage66 “This will reset all controls to the default settings. Do you wish to continue?”576 String sNotifyMessage67 “This will immediately change your resolution. Do you want to continue?”577 String sTeleportDisabled “Teleportation magic does not work here.”578 String sLevitateDisabled “Levitation magic does not work here.”579 String sInPrisonTitle “Serving time. . . ”580 String sInfoRefusal “Info Refusal”581 String sAdmireSuccess “Admire Success”582 String sAdmireFail “Admire Fail”583 String sIntimidateSuccess “Intimidate Success”584 String sIntimidateFail “Intimidate Fail”585 String sTauntSuccess “Taunt Success”586 String sTauntFail “Taunt Fail”587 String sServiceRefusal “Service Refusal”588 String sBribeSuccess “Bribe Success”589 String sBribeFail “Bribe Fail”590 String sWerewolfRefusal “You cannot do this as a werewolf.”591 String sWerewolfPopup “Werewolf”592 String sWerewolfRestMessage “You cannot rest in werewolf form.”593 String sWerewolfAlarmMessage “You have been detected changing from a werewolf state.”594 String sBookSkillMessage “You have gained knowledge from this book.”595 String sLoadingMessage1 “Loading Master/Plugin Files”596 String sLoadingMessage2 “Loading Interior”597 String sLoadingMessage3 “Loading Exterior”598 String sLoadingMessage4 “Initializing Data. . . ”599 String sLoadingMessage5 “Parsing Quests. . . ”600 String sLoadingMessage9 “Clearing Data. . . ”601 String sLoadingMessage14 “Loading Save Game”602 String sLoadingMessage15 “Loading (%s)”603 String sInvalidSaveGameMsg “This file is an invalid Save Game.”604 String sInvalidSaveGameMsgXBOX “Unable to load saved game. Press A to continue.”605 String sLoadingErrorsMsg “Errors were encountered loading from file ‘%s’.”606 String sMissingMastersMsg “The currently selected master files and plugins do not match the ones used by this save game. Errors may occur during load or game play.[CRLF]Do you wish to continue?”607 String sChangedMastersMsg “The selected master files and plugins may have changed since this save game was created. Errors may occur during load or game play.[CRLF]Do you wish to continue?”608 String sMastPlugMismatchMsg “One of the files that %s is dependent on has changed since the last save.[CRLF]This may result in errors. Saving again will clear this message[CRLF]but not necessarily fix any errors.[CRLF]”609 String sGeneralMastPlugMismatchMsg “One or more plugins could not find the correct versions of the master files they depend on. Errors may occur during load or game play. Check the Warnings.txt file for more information.”610 String sLoadLastSaveMsg “The most recent Save Game is ‘%s’. [CRLF]Would you like to load it?”611 String sMessage1 “Do you want to Load a save game and lose your current game?”612 String sMessage2 “Quit Morrowind?”613 String sMessage3 “Are you sure you want to delete this Save Game?”614 String sMessage4 “Are you sure you want to overwrite this Save Game?”615 String sMessage5 “Do you wish to quit your current game? [CRLF]All unsaved progress will be lost.”

Continued on next page

37

Page 42: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value616 String sMessageQuestionAnswer1 “Your personality and past reflect a:”617 String sMessageQuestionAnswer2 “Accept this Class”618 String sMessageQuestionAnswer3 “Choose Another Class”619 String sBarterDialog1 “You cannot afford this transaction.”620 String sBarterDialog2 “I cannot afford this transaction.”621 String sBarterDialog3 “This is to heavy for you to carry.”622 String sBarterDialog4 “I don’t buy that item.”623 String sBarterDialog5 “Thank you, Please Come Again.”624 String sBarterDialog6 “You need to place the bartered item before existing Barter Menu!”625 String sBarterDialog7 “Price”626 String sBarterDialog8 “Offer”627 String sBarterDialog9 “You cannot sell summoned items!”628 String sBarterDialog10 “You cannot buy summoned items!”629 String sBarterDialog11 “You need to trade items before making an offer.”630 String sBarterDialog12 “You cannot drop summoned items!”631 String sInventoryMessage1 “This object is broken and cannot be equipped until fixed.”632 String sInventoryMessage2 “You cannot repair items during battle.”633 String sInventoryMessage3 “You cannot make potions during battle.”634 String sInventoryMessage4 “You cannot read during battle.”635 String sInventoryMessage5 “You cannot use soul gems during battle.”636 String sContentsMessage1 “You cannot remove summoned items from their container.”637 String sContentsMessage2 “You cannot place items in this container.”638 String sContentsMessage3 “The item will not fit.”639 String sAttributeListTitle “Attribute List”640 String sConsoleTitle “Console”641 String sCreateClassMenu1 “Class Description”642 String sCreateClassMenu2 “Close the Description menu before leaving Class Creation”643 String sCreateClassMenu3 “The class needs a description.”644 String sCreateClassMenuHelp1 “You’ll get +5 to all skills of your specialization. They’ll also be easier to increase.”645 String sCreateClassMenuHelp2 “You’ll get +10 to each of your favored attributes.”646 String sControlsMenu1 “Reset Controls”647 String sControlsMenu2 “Mouse Sensitivity”648 String sControlsMenu3 “Press a key or push a button to set this command.”649 String sControlsMenu4 “Vertical Sensitivity”650 String sControlsMenu5 “Horizontal Sensitivity”651 String sControlsMenu6 “Push a button to set this command.”652 String sGameWithoutLauncherXbox “The game was started without the launcher. Press START to continue.”653 String sDialogMenu1 “Final Disposition:”654 String sEnchantmentMenu1 “Enchantment Menu”655 String sEnchantmentMenu2 “Enchantment Name”656 String sEnchantmentMenu3 “Enchantment”657 String sEnchantmentMenu4 “Point Cost”658 String sEnchantmentMenu5 “Buy”659 String sEnchantmentMenu6 “Chance”660 String sEnchantmentMenu7 “Please remove the current soul gem before placing a different soul gem.”661 String sEnchantmentMenu8 “You cannot buy a spell that has a zero point cost.”662 String sEnchantmentMenu9 “You cannot enchant more then one item of that type at a time.”663 String sEnchantmentMenu10 “The cast cost cannot exceed the charge amount put into the time”664 String sEnchantmentMenu11 “You must add at least one effect to an enchantment”

Continued on next page

38 Chapter 7. GMST List

Page 43: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value665 String sEnchantmentMenu12 “You have successfully created an enchanted item”666 String sEnchantmentHelp1 “Slot for item to enchant. Only weapons, armor, scrolls and clothing that are not already enchanted can be enchanted.”667 String sEnchantmentHelp2 “Slot for the soul gem used to enchant an item. Only soul gems filled with a soul can be used. The soul amount is the total charge placed into the item.”668 String sEnchantmentHelp3 “The first number is the total amount the enchantment would cost to cast. The second number is the total enchantment cost that can be placed on this type of item.”669 String sEnchantmentHelp4 “The amount of charge points needed each time this enchantment is cast. This number is modified by your enchant skill.”670 String sEnchantmentHelp5 “The amount of soul in the soul gem in the soul gem slot”671 String sEnchantmentHelp6 “Amount of gold to buy this enchantment”672 String sEnchantmentHelp7 “Type of cast for the enchantment.”673 String sEnchantmentHelp8 “Name you give the spell.”674 String sEnchantmentHelp9 “Magic effects you know that you can add to an item”675 String sEnchantmentHelp10 “Current effects on the item”676 String sInputMenu1 “Enter”677 String sInventoryMenu1 “You cannot equip items being bartered.”678 String sLevelUpMenu1 “You have ascended to Level”679 String sLevelUpMenu2 “It’s all suddenly obvious to you. You just have to concentrate. All the energy and time you’ve wasted is a sin, but without the experience you’ve gained, taking risks, taking responsibility for failure how could you have understood?”680 String sLevelUpMenu3 “x2”681 String sLevelUpMenu4 “x3”682 String sLevelUpMsg “You should rest and meditate on what you’ve learned.”683 String sLevelUp “Level Up”684 String sRange “Range”685 String sArea “Area”686 String sMagnitude “Magnitude”687 String sDuration “Duration”688 String sDrain “Drain”689 String sAbsorb “Absorb”690 String sFortify “Fortify”691 String sRestore “Restore”692 String sDamage “Damage”693 String spoint “pt”694 String spoints “pts”695 String spercent “%”696 String sfor “for”697 String ssecond “sec”698 String sseconds “secs”699 String sin “in”700 String sfootarea “ft”701 String sfeet “ft”702 String sXTimes “x”703 String sXTimesINT “x INT”704 String sonword “on”705 String sNone “None”706 String sDone “Done”707 String sStartCell “Cavern of the Incarnate”708 String sStartError “Cannot start in an empty interior cell!”709 String sStartCellError “Starting interior cell Cavern of the Incarnate not found!”710 String sAdmire “Admire”711 String sIntimidate “Intimidate”712 String sTaunt “Taunt”713 String sBribe 10 Gold “Bribe 10 Gold”

Continued on next page

39

Page 44: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value714 String sBribe 100 Gold “Bribe 100 Gold”715 String sBribe 1000 Gold “Bribe 1000 Gold”716 String sPersuasionMenuTitle “Persuasion”717 String sFast “Fast”718 String sSlow “Slow”719 String sBestAttack “Always Use Best Attack”720 String sSubtitles “Subtitles”721 String sMouseFlip “Invert Y Axis”722 String sCursorOff “Crosshair”723 String sEnableJoystick “Enable Joystick”724 String sXStrafe “X-Axis Movement”725 String sStrafe “Strafe”726 String sTurn “Turn”727 String sMouseWheelUpShort “MWheel Up”728 String sMouseWheelDownShort “MWheel Down”729 String sMouse “Mouse”730 String sJoystickShort “Joy”731 String sJoystickHatShort “JHat”732 String sPickUp “Take”733 String sItemName “Item Name”734 String sNoName “NO NAME GIVEN!”735 String sItem “Item”736 String sRaceMenu1 “Appearance”737 String sRaceMenu2 “Change Sex”738 String sRaceMenu3 “Change Face”739 String sRaceMenu4 “Change Hair”740 String sRaceMenu5 “Race”741 String sRaceMenu6 “Race Description”742 String sRaceMenu7 “Specials”743 String sRestMenu1 “How many hours?”744 String sRestMenu2 “Hours”745 String sRestMenu3 “REST”746 String sRestMenu4 “You can’t rest right now.”747 Float fRestMagicMult 0.15748 String sSaveMenu1 “New Save Game”749 String sServiceRepairTitle “Repair Service Menu”750 String sServiceTravelTitle “Travel”751 String sServiceTrainingTitle “Training”752 String sServiceTrainingWords “I can teach nothing more about that skill”753 String sServiceSpellsTitle “Spells”754 String sSkillsMenu1 “Choose a Skill”755 String sBonusSkillTitle “Skill Bonus”756 String sSpecializationMenu1 “Choose a Specialization”757 String sSpellmakingMenuTitle “Spellmaking”758 String sSpellmakingMenu1 “Spell Chance”759 String sSpellmakingHelp1 “Name you give the spell.”760 String sSpellmakingHelp2 “Amount of Magika one cast of the spell will cost”761 String sSpellmakingHelp3 “The chance you have to cast the spell at your current skill level”762 String sSpellmakingHelp4 “How much gold the spell will cost you.”

Continued on next page

40 Chapter 7. GMST List

Page 45: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value763 String sSpellmakingHelp5 “Magic effects you know that you can add to a spell”764 String sSpellmakingHelp6 “Current effects on the spell”765 String sKilledEssential “With this character’s death, the thread of prophecy is severed. Restore a saved game to restore the weave of fate, or persist in the doomed world you have created.”766 String sCrimeMessage “Your crime has been reported!”767 String sPotionSuccess “You created a potion”768 String sMagicItem “Magic Items”769 String sMagnitudeDes “The range of a spells power”770 String sAreaDes “The radius the spell attempt to affect”771 String sDurationDes “The length a spell lasts”772 String sRangeDes “What the spell is directed at such as yourself, a target or who you touch”773 String sCrimeHelp “The penalty you must pay for your crimes, if caught.”774 String sSoulGem “Soul”775 String sCastCost “Cast Cost”776 String sTravelServiceTitle “Select destination”777 String sSpellServiceTitle “Select spell to buy”778 String sRepairServiceTitle “Select item to repair”779 String sTrainingServiceTitle “Select skill to train”780 String sMortar “Mortar”781 String sCalcinator “Calcinator”782 String sAlembic “Alembic”783 String sRetort “Retort”784 String sQuestionMark “?”785 String s3dAudio “3D Audio”786 String s3dHardware “Hardware Accelerated”787 String s3dSoftware “Software Mode”788 String sYourGold “YOUR GOLD”789 String sSellerGold “SELLER GOLD”790 String sMaxSale “Max Sale”791 String sTotalCost “TOTAL COST”792 String sTotalSold “TOTAL SOLD”793 String sOffer “Offer”794 String sLess “Less”795 String sMore “More”796 String sInventory “Inventory”797 String sBookPageOne “1”798 String sBookPageTwo “2”799 String sDisposeofCorpse “Dispose of Corpse”800 String sCaughtStealingMessage “Hey he’s stealing my stuff!”801 String sUserDefinedClass “User Defined Class”802 String sAsk “Ask”803 String sEnchantItems “Items to Enchant”804 String sSoulGemsWithSouls “Soul Gems with Souls”805 String sDoYouWantTo “Do you want to”806 String sRechargeEnchantment “Recharge Enchanted Item”807 String sMake Enchantment “Make an Enchanted Item”808 String sSell “Sell”809 String sEquip “Equip”810 String sDrop “Drop”811 String sContainer “Container”

Continued on next page

41

Page 46: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value812 String sStats “Stats”813 String sMap “Map”814 String sCenter “Center”815 String sSaveMenuHelp01 “th of”816 String sSaveMenuHelp02 “month”817 String sSaveMenuHelp03 “day”818 String sSaveMenuHelp04 “a.m.”819 String sSaveMenuHelp05 “p.m.”820 String sSaveMenuHelp06 “Delete Game?”821 String sDeleteNote “Delete Note?”822 String sEditNote “Edit Note”823 String sBlocks “Blocks”824 String sFileSize “File Size”825 String sSave “Save”826 String sDeleteSpell “Delete Spell”827 String sQuestionDeleteSpell “Are you sure you wish to delete %s?”828 String sDeleteSpellError “You cannot delete this item from the Magic Menu”829 String sLocal “Local”830 String sLoadFailedMessage “Your last load failed. You must load another game or start a new game.”831 String sShadows “Shadows”832 String sControlerVibration “Controller Vibration”833 String sQuanityMenuMessage01 “Amount to Sell”834 String sQuanityMenuMessage02 “Amount to Buy”835 String sSex “Sex”836 String sHair “Hair”837 String sFace “Face”838 String sRepairFailed “Your repair failed!”839 String sRepairSuccess “Your repair succeeded!”840 String sHeal “Heal”841 String sgp “gp”842 String sSetValueMessage01 “The maximum magnitude cannot be less then the minimum magnitude!”843 String sDelete “Delete”844 String sVideoWarning “Warning: Video Resolution does not allow shadows.”845 String sResChangeWarning “Desired resolution not supported by video card.”846 String sShift “Shift”847 String sBackspace “Backspace”848 String sCustomClassName “Adventurer”849 String sSpace “Space”850 String sInventorySelectNoItems “You have no items to fill this slot.”851 String sInventorySelectNoSoul “You have no filled Soul Gems”852 String sInventorySelectNoIngredients “You have no ingredients”853 String sDisposeCorpseFail “You can not remove this corpse”854 String sQuickMenuTitle “Quick Keys”855 String sQuickMenuInstruc “Click on quick key slot to add a spell, magic item or inventory item”856 String sQuickMenu1 “Item to QuickKey”857 String sQuickMenu2 “Inventory Menu Item”858 String sQuickMenu3 “Magic Menu Item”859 String sQuickMenu4 “Delete QuickKey Item”860 String sQuickMenu5 “You no longer have”

Continued on next page

42 Chapter 7. GMST List

Page 47: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value861 String sQuickMenu6 “Inventory Items to Quick key”862 String sMagicSelectTitle “Select a magic to Quick key.”863 String sNextRank “Next Rank:”864 String sNeedOneSkill “Need one skill at”865 String sNeedTwoSkills “Need two skills at”866 String sand “and”867 String sOneHanded “One Handed”868 String sTwoHanded “Two Handed”869 String sType “Type:”870 String sAt “At”871 String sUnequip “Unequip”872 String sScrolldown “Scroll Down”873 String sScrollup “Scroll Up”874 String sSleepInterrupt “Your rest has been interrupted.”875 String sSoultrapSuccess “Your have trapped a soul”876 String sCantEquipWeapWarning “Finish your current attack before equipping a new weapon”877 String sOfferMenuTitle “Offer Menu”878 String sPowers “Powers”879 String sBreath “Breath”880 String sDifficulty “Difficulty”881 String sEasy “Easy”882 String sHard “Hard”883 String sProfitValue “Profit Value”884 String sCompanionShare “Companion Share”885 String sCompanionWarningMessage “Your mercenary is poorer now than when he contracted with you. Your mercenary will quit if you do not give him gold or goods to bring his Profit Value to a positive value.”886 String sCompanionWarningButtonOne “Let the mercenary quit.”887 String sCompanionWarningButtonTwo “Return to Companion Share display.”888 String sAttributeStrength “Strength”889 String sAttributeIntelligence “Intelligence”890 String sAttributeWillpower “Willpower”891 String sAttributeAgility “Agility”892 String sAttributeSpeed “Speed”893 String sAttributeEndurance “Endurance”894 String sAttributePersonality “Personality”895 String sAttributeLuck “Luck”896 String sSkillBlock “Block”897 String sSkillArmorer “Armorer”898 String sSkillMediumarmor “Medium Armor”899 String sSkillHeavyarmor “Heavy Armor”900 String sSkillBluntweapon “Blunt Weapon”901 String sSkillLongblade “Long Blade”902 String sSkillAxe “Axe”903 String sSkillSpear “Spear”904 String sSkillAthletics “Athletics”905 String sSkillEnchant “Enchant”906 String sSkillDestruction “Destruction”907 String sSkillAlteration “Alteration”908 String sSkillIllusion “Illusion”909 String sSkillConjuration “Conjuration”

Continued on next page

43

Page 48: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value910 String sSkillMysticism “Mysticism”911 String sSkillRestoration “Restoration”912 String sSkillAlchemy “Alchemy”913 String sSkillUnarmored “Unarmored”914 String sSkillSecurity “Security”915 String sSkillSneak “Sneak”916 String sSkillAcrobatics “Acrobatics”917 String sSkillLightarmor “Light Armor”918 String sSkillShortblade “Short Blade”919 String sSkillMarksman “Marksman”920 String sSkillMercantile “Mercantile”921 String sSkillSpeechcraft “Speechcraft”922 String sSkillHandtohand “Hand-to-hand”923 String sHealth “Health”924 String sRace “Race”925 String sLevel “Level”926 String sLevels “Levels”927 String sFaction “Faction”928 String sBirthSign “Sign”929 String sBounty “Bounty”930 String sReputation “Reputation”931 String sSchool “School”932 String sSkill “Skill”933 String sSkillProgress “Progress towards skill increase”934 String sSkillMaxReached “Maximum proficiency has been reached.”935 String sLevelProgress “Progress towards level increase”936 String sMagic “Magicka”937 String sMagicMenu “Magic”938 String sFatigue “Fatigue”939 String sSkillsMenuReputationHelp “Your fame rating in the world of Morrowind.”940 String sStrDesc “Affects your starting Health, how much you can carry, your maximum Fatigue, and how much damage you do in melee.”941 String sIntDesc “Determines your maximum amount of Magicka.”942 String sWilDesc “Affects your ability to resist magic, and your maximum Fatigue.”943 String sAgiDesc “Affects your ability to dodge and hit targets in melee as well as your maximum Fatigue.”944 String sSpdDesc “Determines how fast you can move.”945 String sEndDesc “Affects your starting Health, your Health gain per level, and your maximum Fatigue.”946 String sPerDesc “Affects your ability to deal with other characters and how much they like you.”947 String sLucDesc “Affects every action you do in a small way.”948 String sFatDesc “How tired you are. Low fatigue makes it harder to successfully perform actions.”949 String sHealthDesc “The amount of damage you can take before you die. Increases every time you gain a level.”950 String sMagDesc “Used to cast spells. Magicka is naturally restored by resting.”951 Float fWortChanceValue 15.0952 String sDefaultCellname “Wilderness”953 Float fMinWalkSpeed 100.0954 Float fMaxWalkSpeed 200.0955 Float fMinWalkSpeedCreature 5.0956 Float fMaxWalkSpeedCreature 300.0957 Float fEncumberedMoveEffect 0.3958 Float fBaseRunMultiplier 1.75

Continued on next page

44 Chapter 7. GMST List

Page 49: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value959 Float fAthleticsRunBonus 1.0960 Float fJumpAcrobaticsBase 128.0961 Float fJumpAcroMultiplier 4.0962 Float fJumpEncumbranceBase 0.5963 Float fJumpEncumbranceMultiplier 1.0964 Float fJumpRunMultiplier 1.0965 Float fJumpMoveBase 0.5966 Float fJumpMoveMult 0.5967 Float fSwimWalkBase 0.5968 Float fSwimRunBase 0.5969 Float fSwimWalkAthleticsMult 0.02970 Float fSwimRunAthleticsMult 0.1971 Float fSwimHeightScale 0.9972 Float fHoldBreathTime 20.0973 Float fHoldBreathEndMult 0.5974 Float fSuffocationDamage 3.0975 Float fMinFlySpeed 5.0976 Float fMaxFlySpeed 300.0977 Float fStromWindSpeed 0.7978 Float fStromWalkMult 0.25979 Float fFallDamageDistanceMin 400.0980 Float fFallDistanceBase 0.0981 Float fFallDistanceMult 0.07982 Float fFallAcroBase 0.25983 Float fFallAcroMult 0.01984 Long iMaxActivateDist 192985 Long iMaxInfoDist 192986 Float fVanityDelay 30.0987 Float fMaxHeadTrackDistance 400.0988 Float fInteriorHeadTrackMult 0.5989 Long iHelmWeight 5990 Long iPauldronWeight 10991 Long iCuirassWeight 30992 Long iGauntletWeight 5993 Long iGreavesWeight 15994 Long iBootsWeight 20995 Long iShieldWeight 15996 Float fLightMaxMod 0.6997 Float fMedMaxMod 0.9998 Float fUnarmoredBase1 0.1999 Float fUnarmoredBase2 0.0651000 Long iBaseArmorSkill 301001 Float fBlockStillBonus 1.251002 Float fDamageStrengthBase 0.51003 Float fDamageStrengthMult 0.11004 Float fSwingBlockBase 1.01005 Float fSwingBlockMult 1.01006 Float fFatigueBase 1.251007 Float fFatigueMult 0.5

Continued on next page

45

Page 50: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value1008 Float fFatigueReturnBase 2.51009 Float fFatigueReturnMult 0.021010 Float fEndFatigueMult 0.041011 Float fFatigueAttackBase 2.01012 Float fFatigueAttackMult 0.01013 Float fWeaponFatigueMult 0.251014 Float fFatigueBlockBase 4.01015 Float fFatigueBlockMult 0.01016 Float fWeaponFatigueBlockMult 1.01017 Float fFatigueRunBase 5.01018 Float fFatigueRunMult 2.01019 Float fFatigueJumpBase 5.01020 Float fFatigueJumpMult 0.01021 Float fFatigueSwimWalkBase 2.51022 Float fFatigueSwimRunBase 7.01023 Float fFatigueSwimWalkMult 0.01024 Float fFatigueSwimRunMult 0.01025 Float fFatigueSneakBase 1.51026 Float fFatigueSneakMult 1.51027 Float fMinHandToHandMult 0.11028 Float fMaxHandToHandMult 0.51029 Float fHandtoHandHealthPer 0.11030 Float fCombatInvisoMult 0.21031 Float fCombatKODamageMult 1.51032 Float fCombatCriticalStrikeMult 4.01033 Long iBlockMinChance 101034 Long iBlockMaxChance 501035 Float fLevelUpHealthEndMult 0.11036 Float fSoulGemMult 3.01037 Float fEffectCostMult 0.51038 Float fSpellPriceMult 2.01039 Float fFatigueSpellBase 0.01040 Float fFatigueSpellMult 0.01041 Float fFatigueSpellCostMult 0.01042 Float fPotionStrengthMult 0.51043 Float fPotionT1MagMult 1.51044 Float fPotionT1DurMult 0.51045 Float fPotionMinUsefulDuration 20.01046 Float fPotionT4BaseStrengthMult 20.01047 Float fPotionT4EquipStrengthMult 12.01048 Float fIngredientMult 1.01049 Float fMagicItemCostMult 1.01050 Float fMagicItemPriceMult 1.01051 Float fMagicItemOnceMult 1.01052 Float fMagicItemUsedMult 1.01053 Float fMagicItemStrikeMult 1.01054 Float fMagicItemConstantMult 1.01055 Float fEnchantmentMult 0.11056 Float fEnchantmentChanceMult 3.0

Continued on next page

46 Chapter 7. GMST List

Page 51: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value1057 Float fPCbaseMagickaMult 1.01058 Float fNPCbaseMagickaMult 2.01059 Float fAutoSpellChance 80.01060 Float fAutoPCSpellChance 50.01061 Long iAutoSpellTimesCanCast 31062 Long iAutoSpellAttSkillMin 701063 Long iAutoSpellAlterationMax 51064 Long iAutoSpellConjurationMax 21065 Long iAutoSpellDestructionMax 51066 Long iAutoSpellIllusionMax 51067 Long iAutoSpellMysticismMax 51068 Long iAutoSpellRestorationMax 51069 Long iAutoPCSpellMax 1001070 Long iAutoRepFacMod 21071 Long iAutoRepLevMod 01072 Long iMagicItemChargeOnce 11073 Long iMagicItemChargeConst 101074 Long iMagicItemChargeUse 51075 Long iMagicItemChargeStrike 101076 Long iMonthsToRespawn 41077 Float fCorpseClearDelay 72.01078 Float fCorpseRespawnDelay 72.01079 Float fBarterGoldResetDelay 24.01080 Float fEncumbranceStrMult 5.01081 Float fPickLockMult -1.01082 Float fTrapCostMult 0.01083 Float fMessageTimePerChar 0.11084 Float fMagicItemRechargePerSecond 0.051085 Long i1stPersonSneakDelta 101086 Long iBarterSuccessDisposition 11087 Long iBarterFailDisposition -11088 Long iLevelupTotal 101089 Long iLevelupMajorMult 11090 Long iLevelupMinorMult 11091 Long iLevelupMajorMultAttribute 11092 Long iLevelupMinorMultAttribute 11093 Long iLevelupMiscMultAttriubte 11094 Long iLevelupSpecialization 11095 Long iLevelUp01Mult 21096 Long iLevelUp02Mult 21097 Long iLevelUp03Mult 21098 Long iLevelUp04Mult 21099 Long iLevelUp05Mult 31100 Long iLevelUp06Mult 31101 Long iLevelUp07Mult 31102 Long iLevelUp08Mult 41103 Long iLevelUp09Mult 41104 Long iLevelUp10Mult 51105 Long iSoulAmountForConstantEffect 400

Continued on next page

47

Page 52: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value1106 Float fConstantEffectMult 15.01107 Float fEnchantmentConstantDurationMult 100.01108 Float fEnchantmentConstantChanceMult 0.51109 Float fWeaponDamageMult 0.11110 Float fSeriousWoundMult 0.01111 Float fKnockDownMult 0.51112 Long iKnockDownOddsBase 501113 Long iKnockDownOddsMult 501114 Float fCombatArmorMinMult 0.251115 Float fHandToHandReach 1.01116 Float fVoiceIdleOdds 10.01117 Long iVoiceAttackOdds 101118 Long iVoiceHitOdds 301119 Float fProjectileMinSpeed 400.01120 Float fProjectileMaxSpeed 3000.01121 Float fThrownWeaponMinSpeed 300.01122 Float fThrownWeaponMaxSpeed 1000.01123 Float fTargetSpellMaxSpeed 1000.01124 Float fProjectileThrownStoreChance 25.01125 Long iPickMinChance 51126 Long iPickMaxChance 751127 Float fDispRaceMod 5.01128 Float fDispPersonalityMult 0.51129 Float fDispPersonalityBase 50.01130 Float fDispFactionMod 3.01131 Float fDispFactionRankBase 1.01132 Float fDispFactionRankMult 0.51133 Float fDispCrimeMod 0.01134 Float fDispDiseaseMod -10.01135 Long iDispAttackMod -501136 Float fDispWeaponDrawn -5.01137 Float fDispBargainSuccessMod 1.01138 Float fDispBargainFailMod -1.01139 Float fDispPickPocketMod -25.01140 Long iDaysinPrisonMod 1001141 Float fDispAttacking -10.01142 Float fDispStealing -0.51143 Long iDispTresspass -201144 Long iDispKilling -501145 Long iTrainingMod 101146 Long iAlchemyMod 21147 Float fBargainOfferBase 50.01148 Float fBargainOfferMulti -4.01149 Float fDispositionMod 1.01150 Float fPersonalityMod 5.01151 Float fLuckMod 10.01152 Float fReputationMod 1.01153 Float fLevelMod 5.01154 Float fBribe10Mod 35.0

Continued on next page

48 Chapter 7. GMST List

Page 53: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value1155 Float fBribe100Mod 75.01156 Float fBribe1000Mod 150.01157 Float fPerDieRollMult 0.31158 Float fPerTempMult 1.01159 Long iPerMinChance 51160 Long iPerMinChange 101161 Float fSpecialSkillBonus 0.81162 Float fMajorSkillBonus 0.751163 Float fMinorSkillBonus 1.01164 Float fMiscSkillBonus 1.251165 Long iAlarmKilling 901166 Long iAlarmAttack 501167 Long iAlarmStealing 11168 Long iAlarmPickPocket 201169 Long iAlarmTresspass 51170 Float fAlarmRadius 2000.01171 Long iCrimeKilling 10001172 Long iCrimeAttack 401173 Float fCrimeStealing 1.01174 Long iCrimePickPocket 251175 Long iCrimeTresspass 51176 Long iCrimeThreshold 10001177 Long iCrimeThresholdMultiplier 101178 Float fCrimeGoldDiscountMult 0.51179 Float fCrimeGoldTurnInMult 0.91180 Long iFightAttack 1001181 Long iFightAttacking 501182 Long iFightDistanceBase 201183 Float fFightDistanceMultiplier 0.0051184 Long iFightAlarmMult 11185 Float fFightDispMult 0.21186 Float fFightStealing 50.01187 Long iFightPickpocket 251188 Long iFightTrespass 251189 Long iFightKilling 501190 Long iFlee 01191 Long iGreetDistanceMultiplier 61192 Long iGreetDuration 41193 Float fGreetDistanceReset 512.01194 Float fIdleChanceMultiplier 0.751195 Float fSneakUseDist 500.01196 Float fSneakUseDelay 1.01197 Float fSneakDistanceBase 0.51198 Float fSneakDistanceMultiplier 0.0021199 Float fSneakSpeedMultiplier 0.751200 Float fSneakViewMult 1.51201 Float fSneakNoViewMult 0.51202 Float fSneakSkillMult 1.01203 Float fSneakBootMult -1.0

Continued on next page

49

Page 54: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value1204 Float fCombatDistance 128.01205 Float fCombatAngleXY 60.01206 Float fCombatAngleZ 60.01207 Float fCombatForceSideAngle 30.01208 Float fCombatTorsoSideAngle 45.01209 Float fCombatTorsoStartPercent 0.31210 Float fCombatTorsoStopPercent 0.81211 Float fCombatBlockLeftAngle -90.01212 Float fCombatBlockRightAngle 30.01213 Float fCombatDelayCreature 0.11214 Float fCombatDelayNPC 0.11215 String sTargetCriticalStrike “Critical Damage!”1216 Float fAIMeleeWeaponMult 2.01217 Float fAIRangeMeleeWeaponMult 5.01218 Float fAIMagicSpellMult 3.01219 Float fAIRangeMagicSpellMult 5.01220 Float fAIMeleeArmorMult 1.01221 Float fAIMeleeSummWeaponMult 1.01222 Float fAIFleeHealthMult 7.01223 Float fAIFleeFleeMult 0.31224 Float fPickPocketMod 0.31225 Float fSleepRandMod 0.251226 Float fSleepRestMod 0.31227 Long iNumberCreatures 11228 Float fAudioDefaultMinDistance 5.01229 Float fAudioDefaultMaxDistance 40.01230 Float fAudioVoiceDefaultMinDistance 10.01231 Float fAudioVoiceDefaultMaxDistance 60.01232 Float fAudioMinDistanceMult 20.01233 Float fAudioMaxDistanceMult 50.01234 Float fNPCHealthBarTime 3.01235 Float fNPCHealthBarFade 0.51236 Float fDifficultyMult 5.01237 Float fWereWolfRunMult 1.51238 Float fWereWolfSilverWeaponDamageMult 1.51239 Long iWereWolfBounty 100001240 Float fWereWolfStrength 150.01241 Float fWereWolfAgility 150.01242 Float fWereWolfEndurance 150.01243 Float fWereWolfSpeed 150.01244 Float fWereWolfHandtoHand 100.01245 Float fWereWolfUnarmored 100.01246 Long iWereWolfLevelToAttack 201247 Long iWereWolfFightMod 1001248 Long iWereWolfFleeMod 1001249 Float fWereWolfAthletics 150.01250 Float fWereWolfAcrobatics 150.01251 Float fWereWolfHealth 2.01252 Float fWereWolfFatigue 400.0

Continued on next page

50 Chapter 7. GMST List

Page 55: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value1253 Float fWereWolfMagicka 100.01254 Float fWereWolfIntellegence 1.01255 Float fWereWolfWillPower 1.01256 Float fWereWolfPersonality 1.01257 Float fWereWolfLuck 1.01258 Float fWereWolfBlock 1.01259 Float fWereWolfArmorer 1.01260 Float fWereWolfMediumArmor 1.01261 Float fWereWolfHeavyArmor 1.01262 Float fWereWolfBluntWeapon 1.01263 Float fWereWolfLongBlade 1.01264 Float fWereWolfAxe 1.01265 Float fWereWolfSpear 1.01266 Float fWereWolfDestruction 1.01267 Float fWereWolfAlteration 1.01268 Float fWereWolfIllusion 1.01269 Float fWereWolfConjuration 1.01270 Float fWereWolfMysticism 1.01271 Float fWereWolfRestoration 1.01272 Float fWereWolfEnchant 1.01273 Float fWereWolfAlchemy 1.01274 Float fWereWolfSecurity 1.01275 Float fWereWolfSneak 1.01276 Float fWereWolfLightArmor 1.01277 Float fWereWolfShortBlade 1.01278 Float fWereWolfMarksman 1.01279 Float fWereWolfMerchantile 1.01280 Float fWereWolfSpeechcraft 1.01281 Float fCombatDistanceWerewolfMod 0.31282 Float fFleeDistance 3000.01283 String sEffectWaterBreathing “Water Breathing”1284 String sEffectSwiftSwim “Swift Swim”1285 String sEffectWaterWalking “Water Walking”1286 String sEffectShield “Shield”1287 String sEffectFireShield “Fire Shield”1288 String sEffectLightningShield “Lightning Shield”1289 String sEffectFrostShield “Frost Shield”1290 String sEffectBurden “Burden”1291 String sEffectFeather “Feather”1292 String sEffectJump “Jump”1293 String sEffectLevitate “Levitate”1294 String sEffectSlowFall “SlowFall”1295 String sEffectLock “Lock”1296 String sEffectOpen “Open”1297 String sEffectFireDamage “Fire Damage”1298 String sEffectShockDamage “Shock Damage”1299 String sEffectFrostDamage “Frost Damage”1300 String sEffectDrainAttribute “Drain Attribute”1301 String sEffectDrainHealth “Drain Health”

Continued on next page

51

Page 56: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value1302 String sEffectDrainSpellpoints “Drain Magicka”1303 String sEffectDrainFatigue “Drain Fatigue”1304 String sEffectDrainSkill “Drain Skill”1305 String sEffectDamageAttribute “Damage Attribute”1306 String sEffectDamageHealth “Damage Health”1307 String sEffectDamageMagicka “Damage Magicka”1308 String sEffectDamageFatigue “Damage Fatigue”1309 String sEffectDamageSkill “Damage Skill”1310 String sEffectPoison “Poison”1311 String sEffectWeaknessToFire “Weakness to Fire”1312 String sEffectWeaknessToFrost “Weakness to Frost”1313 String sEffectWeaknessToShock “Weakness to Shock”1314 String sEffectWeaknessToMagicka “Weakness to Magicka”1315 String sEffectWeaknessToCommonDisease “Weakness to Common Disease”1316 String sEffectWeaknessToBlightDisease “Weakness to Blight Disease”1317 String sEffectWeaknessToCorprusDisease “Weakness to Corprus Disease”1318 String sEffectWeaknessToPoison “Weakness to Poison”1319 String sEffectWeaknessToNormalWeapons “Weakness to Normal Weapons”1320 String sEffectDisintegrateWeapon “Disintegrate Weapon”1321 String sEffectDisintegrateArmor “Disintegrate Armor”1322 String sEffectInvisibility “Invisibility”1323 String sEffectChameleon “Chameleon”1324 String sEffectLight “Light”1325 String sEffectSanctuary “Sanctuary”1326 String sEffectNightEye “Night Eye”1327 String sEffectCharm “Charm”1328 String sEffectParalyze “Paralyze”1329 String sEffectSilence “Silence”1330 String sEffectBlind “Blind”1331 String sEffectSound “Sound”1332 String sEffectCalmHumanoid “Calm Humanoid”1333 String sEffectCalmCreature “Calm Creature”1334 String sEffectFrenzyHumanoid “Frenzy Humanoid”1335 String sEffectFrenzyCreature “Frenzy Creature”1336 String sEffectDemoralizeHumanoid “Demoralize Humanoid”1337 String sEffectDemoralizeCreature “Demoralize Creature”1338 String sEffectRallyHumanoid “Rally Humanoid”1339 String sEffectRallyCreature “Rally Creature”1340 String sEffectDispel “Dispel”1341 String sEffectSoultrap “Soultrap”1342 String sEffectTelekinesis “Telekinesis”1343 String sEffectMark “Mark”1344 String sEffectRecall “Recall”1345 String sEffectDivineIntervention “Divine Intervention”1346 String sEffectAlmsiviIntervention “Almsivi Intervention”1347 String sEffectDetectAnimal “Detect Animal”1348 String sEffectDetectEnchantment “Detect Enchantment”1349 String sEffectDetectKey “Detect Key”1350 String sEffectSpellAbsorption “Spell Absorption”

Continued on next page

52 Chapter 7. GMST List

Page 57: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value1351 String sEffectReflect “Reflect”1352 String sEffectCureCommonDisease “Cure Common Disease”1353 String sEffectCureBlightDisease “Cure Blight Disease”1354 String sEffectCureCorprusDisease “Cure Corprus Disease”1355 String sEffectCurePoison “Cure Poison”1356 String sEffectCureParalyzation “Cure Paralyzation”1357 String sEffectRestoreAttribute “Restore Attribute”1358 String sEffectRestoreHealth “Restore Health”1359 String sEffectRestoreSpellPoints “Restore Magicka”1360 String sEffectRestoreFatigue “Restore Fatigue”1361 String sEffectRestoreSkill “Restore Skill”1362 String sEffectFortifyAttribute “Fortify Attribute”1363 String sEffectFortifyHealth “Fortify Health”1364 String sEffectFortifySpellpoints “Fortify Magicka”1365 String sEffectFortifyFatigue “Fortify Fatigue”1366 String sEffectFortifySkill “Fortify Skill”1367 String sEffectFortifyMagickaMultiplier “Fortify Maximum Magicka”1368 String sEffectAbsorbAttribute “Absorb Attribute”1369 String sEffectAbsorbHealth “Absorb Health”1370 String sEffectAbsorbSpellPoints “Absorb Magicka”1371 String sEffectAbsorbFatigue “Absorb Fatigue”1372 String sEffectAbsorbSkill “Absorb Skill”1373 String sEffectResistFire “Resist Fire”1374 String sEffectResistFrost “Resist Frost”1375 String sEffectResistShock “Resist Shock”1376 String sEffectResistMagicka “Resist Magicka”1377 String sEffectResistCommonDisease “Resist Common Disease”1378 String sEffectResistBlightDisease “Resist Blight Disease”1379 String sEffectResistCorprusDisease “Resist Corprus Disease”1380 String sEffectResistPoison “Resist Poison”1381 String sEffectResistNormalWeapons “Resist Normal Weapons”1382 String sEffectResistParalysis “Resist Paralysis”1383 String sEffectRemoveCurse “Remove Curse”1384 String sEffectTurnUndead “Turn Undead”1385 String sEffectSummonScamp “Summon Scamp”1386 String sEffectSummonClannfear “Summon Clannfear”1387 String sEffectSummonDaedroth “Summon Daedroth”1388 String sEffectSummonDremora “Summon Dremora”1389 String sEffectSummonAncestralGhost “Summon Ancestral Ghost”1390 String sEffectSummonSkeletalMinion “Summon Skeletal Minion”1391 String sEffectSummonLeastBonewalker “Summon Bonewalker”1392 String sEffectSummonGreaterBonewalker “Summon Greater Bonewalker”1393 String sEffectSummonBonelord “Summon Bonelord”1394 String sEffectSummonWingedTwilight “Summon Winged Twilight”1395 String sEffectSummonHunger “Summon Hunger”1396 String sEffectSummonGoldensaint “Summon Golden Saint”1397 String sEffectSummonFlameAtronach “Summon Flame Atronach”1398 String sEffectSummonFrostAtronach “Summon Frost Atronach”1399 String sEffectSummonStormAtronach “Summon Storm Atronach”

Continued on next page

53

Page 58: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value1400 String sEffectFortifyAttackBonus “Fortify Attack”1401 String sEffectCommandCreatures “Command Creature”1402 String sEffectCommandHumanoids “Command Humanoid”1403 String sEffectBoundDagger “Bound Dagger”1404 String sEffectBoundLongsword “Bound Longsword”1405 String sEffectBoundMace “Bound Mace”1406 String sEffectBoundBattleAxe “Bound Battle Axe”1407 String sEffectBoundSpear “Bound Spear”1408 String sEffectBoundLongbow “Bound Longbow”1409 String sEffectExtraSpell “EXTRA SPELL”1410 String sEffectBoundCuirass “Bound Cuirass”1411 String sEffectBoundHelm “Bound Helm”1412 String sEffectBoundBoots “Bound Boots”1413 String sEffectBoundShield “Bound Shield”1414 String sEffectBoundGloves “Bound Gloves”1415 String sEffectCorpus “Corprus”1416 String sEffectVampirism “Vampirism”1417 String sEffectSummonCenturionSphere “Summon Centurion Sphere”1418 String sEffectSunDamage “Sun Damage”1419 String sEffectStuntedMagicka “Stunted Magicka”1420 String sEffectSummonFabricant “sEffectSummonFabricant”1421 String sEffectSummonCreature01 “sEffectSummonCreature01”1422 String sEffectSummonCreature02 “sEffectSummonCreature02”1423 String sEffectSummonCreature03 “sEffectSummonCreature03”1424 String sEffectSummonCreature04 “sEffectSummonCreature04”1425 String sEffectSummonCreature05 “sEffectSummonCreature05”1426 String sSchoolAlteration “Alteration”1427 String sSchoolConjuration “Conjuration”1428 String sSchoolDestruction “Destruction”1429 String sSchoolIllusion “Illusion”1430 String sSchoolMysticism “Mysticism”1431 String sSchoolRestoration “Restoration”1432 String sTypeSpell “Spells”1433 String sTypeAbility “Abilities”1434 String sTypeBlightDisease “Blight Disease”1435 String sTypeDisease “Disease”1436 String sTypeCurse “Curse”1437 String sTypePower “Powers”1438 String sItemCastOnce “Cast Once”1439 String sItemCastWhenStrikes “Cast When Strikes”1440 String sItemCastWhenUsed “Cast When Used”1441 String sItemCastConstant “Constant Effect”1442 String sRangeSelf “Self”1443 String sRangeTouch “Touch”1444 String sRangeTarget “Target”1445 String sMagicSkillFail “You failed casting the spell.”1446 String sMagicInsufficientSP “You do not have enough Magicka to cast the spell.”1447 String sMagicInsufficientCharge “Item does not have enough charge.”1448 String sPowerAlreadyUsed “You already used that power today.”

Continued on next page

54 Chapter 7. GMST List

Page 59: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value1449 String sMagicInvalidTarget “Your spell did not get a target.”1450 String sMagicLockSuccess “Your spell has locked its target.”1451 String sMagicOpenSuccess “Your spell has unlocked its target.”1452 String sMagicTargetResistsWeapons “Your weapon has no effect.”1453 String sMagicContractDisease “You have contracted %s”1454 Float fMagicDetectRefreshRate 0.01671455 Float fMagicStartIconBlink 3.01456 Float fMagicCreatureCastDelay 1.51457 String sMagicScampID “Scamp_summon”1458 String sMagicClannfearID “Clannfear_summon”1459 String sMagicDaedrothID “Daedroth_summon”1460 String sMagicDremoraID “Dremora_summon”1461 String sMagicAncestralGhostID “Ancestor_Ghost_summon”1462 String sMagicSkeletalMinionID “Skeleton_summon”1463 String sMagicLeastBonewalkerID “Bonewalker_summon”1464 String sMagicGreaterBonewalkerID “Bonewalker_Greater_summ”1465 String sMagicBonelordID “Bonelord_summon”1466 String sMagicWingedTwilightID “Winged Twilight_summon”1467 String sMagicHungerID “Hunger_summon”1468 String sMagicGoldenSaintID “Golden Saint_summon”1469 String sMagicFlameAtronachID “Atronach_Flame_summon”1470 String sMagicFrostAtronachID “Atronach_Frost_summon”1471 String sMagicStormAtronachID “Atronach_Storm_summon”1472 String sMagicCenturionSphereID “centurion_sphere_summon”1473 String sMagicFabricantID “Fabricant”1474 String sMagicCreature01ID “sMagicCreature01ID”1475 String sMagicCreature02ID “sMagicCreature02ID”1476 String sMagicCreature03ID “sMagicCreature03ID”1477 String sMagicCreature04ID “sMagicCreature04ID”1478 String sMagicCreature05ID “sMagicCreature05ID”1479 String sMagicBoundDaggerID “Bound_Dagger”1480 String sMagicBoundLongswordID “Bound_Longsword”1481 String sMagicBoundMaceID “Bound_Mace”1482 String sMagicBoundBattleAxeID “Bound_Battle_Axe”1483 String sMagicBoundSpearID “Bound_Spear”1484 String sMagicBoundLongbowID “Bound_Longbow”1485 String sMagicBoundCuirassID “Bound_Cuirass”1486 String sMagicBoundHelmID “Bound_Helm”1487 String sMagicBoundBootsID “Bound_Boots”1488 String sMagicBoundShieldID “Bound_Shield”1489 String sMagicBoundLeftGauntletID “Bound_Gauntlet_Left”1490 String sMagicBoundRightGauntletID “Bound_Gauntlet_Right”1491 Float fDiseaseXferChance 2.51492 Float fElementalShieldMult 0.11493 String sMagicCorprusWorsens “Your case of Corprus has worsened.”1494 String sMagicCannotRecast “You cannot re-cast this spell while it is still in effect.”1495 Float fMagicSunBlockedMult 0.51496 String sMagicPCResisted “You resisted magic.”1497 String sMagicTargetResisted “Target resisted magic.”

Continued on next page

55

Page 60: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Table 7.1 – continued from previous pageIndex Type Identifier Default Value1498 String sMagicInvalidEffect “You cannot cast this effect right now.”1499 String sAcrobat “Acrobat”1500 String sAgent “Agent”1501 String sArcher “Archer”1502 String sAssassin “Assassin”1503 String sBarbarian “Barbarian”1504 String sBard “Bard”1505 String sBattlemage “Battlemage”1506 String sCrusader “Crusader”1507 String sCustom “Custom”1508 String sHealer “Healer”1509 String sKnight “Knight”1510 String sMage “Mage”1511 String sMonk “Monk”1512 String sNightblade “Nightblade”1513 String sPilgrim “Pilgrim”1514 String sRogue “Rogue”1515 String sScout “Scout”1516 String sSorceror “Sorcerer”1517 String sSpellsword “Spellsword”1518 String sThief “Thief”1519 String sWarrior “Warrior”1520 String sWitchhunter “Witchhunter”

56 Chapter 7. GMST List

Page 61: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

CHAPTER 8

Function List

Below is a categorized list of functions added to Morrowind’s scripting language.

8.1 xAITravel

Parameters:

• float x: The position to travel to on the X axis.

• float y: The position to travel to on the Y axis.

• float z: The position to travel to on the Z axis.

Returned:

• None

This is a wrapper for the vanilla AITravel function that can take variable input.

8.2 xAddEffect

Parameters:

• long recordType: Record Type value for the target’s type.

• string recordID: Record ID of target spell, enchantment, or potion.

• long effectID: Magic Effect ID that will be added to the target.

• long skillAttributeID: Skill or Attribute ID to be used. (Only for absorb/damage/drain/fortify/restore effects- ignored otherwise.)

• long rangeType: New range type. (0 = SELF, 1 = TOUCH, 2 = TARGET)

• long area: Area of effect.

57

Page 62: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

• long duration: Duration in seconds.

• long magMin: Minimum magnitude.

• long magMax: Maximum magnitude.

Returned:

• long success: 1 if the effect was added, or 0 if it wasn’t.

Adds a new effect to the given spell, enchantment, or potion.

8.2.1 Example

begin Example_xAddEffect

short result

; Fire Damage (14), On Touch (1), Duration (30), Magnitude (1 to 5)setx result to xAddEffect 1279610963 "fire bite" 14 0 1 0 30 1 5

if ( result != 0 )MessageBox "Your 'Fire Bite' spell has been upgraded!"

endif

StopScript Example_xAddEffect

end

8.3 xAddItem

Parameters:

• string objectID: The object ID of the item to add.

• long count: The number of items to add.

Returned:

• None

This is a wrapper for the vanilla AddItem function that can take variable input.

8.4 xAddSpell

Parameters:

• string objectID: The object ID of the spell to add.

Returned:

• None

This is a wrapper for the vanilla AddSpell function that can take variable input.

58 Chapter 8. Function List

Page 63: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.5 xAnd

Parameters:

• long leftValue: First value for the logical operation.

• long rightValue: Second value for the logical operation.

Returned:

• long result: 1 if the logical operation returns true.

This function performs an AND logical operation, and returns its result. An AND operation returns true if both of thevalues are non-zero.

A B xAnd A B0 0 00 1 01 0 01 1 1

8.6 xArcCos

Parameters:

• float angle: The angle to take the trigonometric function of.

Returned:

• float result: Result of the function.

Provides the inverse trigonometric function arccosine on the given angle.

8.7 xArcSin

Parameters:

• float angle: The angle to take the trigonometric function of.

Returned:

• float result: Result of the function.

Provides the inverse trigonometric function arcsine on the given angle.

8.8 xArcTan

Parameters:

• float angle: The angle to take the trigonometric function of.

Returned:

• float result: Result of the function.

Provides the inverse trigonometric function arctangent on the given angle.

8.5. xAnd 59

Page 64: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.9 xArcTan2

Parameters:

• float x: The angle to take the trigonometric function of.

• float y: The angle to take the trigonometric function of.

Returned:

• float result: Result of the function.

Provides the inverse trigonometric function arctan2 on y/x.

8.10 xBitAnd

Parameters:

• long leftValue: First value for the bitwise operation.

• long rightValue: Second value for the bitwise operation.

Returned:

• long result: 1 if the bitwise operation returns true.

This function performs an AND bitwise operation, and returns its result.

A B xBitAnd A B0000 0000 00000101 1010 00001100 1111 11001111 0000 0000

8.11 xBitNot

Parameters:

• long leftValue: Value for the bitwise operation.

Returned:

• long result: 1 if the bitwise operation returns true.

This function performs a NOT bitwise operation, and returns its result.

A xBitNot A0000 11110101 10101100 00111111 0000

60 Chapter 8. Function List

Page 65: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.12 xBitOr

Parameters:

• long leftValue: First value for the bitwise operation.

• long rightValue: Second value for the bitwise operation.

Returned:

• long result: 1 if the bitwise operation returns true.

This function performs an OR bitwise operation, and returns its result.

A B xBitOr A B0000 0000 00000101 1010 11111100 1111 11111111 0000 1111

8.13 xBitXor

Parameters:

• long leftValue: First value for the bitwise operation.

• long rightValue: Second value for the bitwise operation.

Returned:

• long result: 1 if the bitwise operation returns true.

This function performs an XOR bitwise operation, and returns its result.

A B xBitXor A B0000 0000 00000101 1010 11111100 1111 00111111 0000 1111

8.14 xClearArray

Parameters:

• long arrayId: The id of the array to clear.

Returned:

• long result: 1 if the array was successfully cleared.

This function clears an array, removing any values from it.

8.12. xBitOr 61

Page 66: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.15 xContentList

Parameters:

• long node: For the first call, this should be 0 to get the first item. In following iterations, this value will bewhat is returned as nextNode from the previous call.

Returned:

• string id: The object ID string of the item.

• long count: How many items are in the item stack.

• long type: The Object Type of the item.

• long value: The value of the item.

• float weight: The weight of the item. (Always 0.000001 for LEVI objects.)

• string name: The name of the item.

• long nextNode: The next node to provide back into this function to continue looping. When this value is 0,there are no more items.

This function allows a script to iterate through the inventory of an actor or container and retrieve information aboutthe contents found. Unlike the xInventory and xNextStack functions, xContentList also provides access to the type,value, weight, and name of items processed.

Tip: If you are only interested in items of specific types, consider using xContentListFiltered instead.

Tip: If you are only interested in items currently equipped by the actor, consider using xEquipmentList.

8.16 xContentListFiltered

Parameters:

• long node: For the first call, this should be 0 to get the first item. In following iterations, this value will bewhat is returned as nextNode from the previous call.

• long filter: A filter that matches the Filter Mask that is desired. Only items matching the type(s) will bereturned. This means that passing a value of 0 will return nothing.

Returned:

• string id: The id string of the item.

• long count: How many items are in the item stack.

• long type: The Record Type of the item.

• long value: The value of the item.

• float weight: The weight of the item.

• string name: The name of the item.

• long nextNode: The next node to provide back into this function to continue looping. When this value is 0,there are no more items.

62 Chapter 8. Function List

Page 67: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

This function behaves similar to xContentList, with the added convenience of filtering for one or more Record Type.

Tip: If you are trying to specifically get the equipped items of an actor, consider using xEquipmentList.

8.16.1 Filter Mask

The filter mask below is meant to be summed for each Record Type desired in the filter. The exception to this rule isthe ENCH filter, which restricts the results to enchanted items.

For example, if you wanted clothing (128) and armor (16) results, you would pass a value of 144 (128+16).

Type MaskACTI 1ALCH 2AMMO 4APPA 8ARMO 16BODY 32BOOK 64CLOT 128CONT 256CREA 512DOOR 1024INGR 2048LEVC 4096LEVI 8192LIGH 16384LOCK 32768MISC 65536NPC 131072PROB 262144REPA 524288STAT 1048576WEAP 2097152ENCH 4194304

8.16.2 Example: Simple Filtered Loop

This example demonstrates how to loop through all potions the player is carrying.

begin Example_xContentListFiltered

long idlong countlong typelong valuefloat weightlong name

long nextlong filter

8.16. xContentListFiltered 63

Page 68: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

long reflong loop

setx ref to xGetRef "player"

set filter to 2 ; ALCH

set loop to 1whilex ( loop )

setx id count type value weight name next to ref->xContentListFiltered next filter

xLogMessage "id: %s" idxLogMessage " count: %d" countxLogMessage " type: %l" typexLogMessage " value: %d" valuexLogMessage " weight: %.2f" weightxLogMessage " name: %s" namexLogMessage " next: %d" next

set loop to nextendwhile

StopScript Example_xContentListFiltered

end

8.16.3 Example: Transfer Ingredients

This example shows how to efficiently transfer all ingredients and potions from the player to another container. Aplaceholder variable, such as “_”, can be used to ignore return values that are not needed for your script.

begin TransferIngreds

long _long idlong count

long srclong dst

setx src to xGetRef "player"setx dst to xGetRef "ingred_storage"

set count to 1whilex ( count )

; get the next ingred and countsetx id count _ _ _ _ _ to src->xContentListFiltered _ 2050 ; INGR + ALCH

; remove the ingred from sourcesrc->xRemoveItem id count

; add the ingred to destinationdst->xAddItem id count

; continue with next ingredient

64 Chapter 8. Function List

Page 69: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

set count to _endwhile

src->PlaySound3D "Item Ingredient Down"

StopScript TransferIngreds

end

8.16.4 Example: Get first item of a specific type.

This example shows how to efficiently check if the player is carrying any weapons at all. No explicit loop is neededhere, so evaluating the weapon id alone will suffice.

begin NoWeaponsAllowed

; local script on a door

long pcReflong weapID

if ( OnActivate == 0 )return

endif

setx pcRef to xGetRef "player"setx weapID to pcRef->xContentListFiltered 0 2097152 ; Weapon

if ( weapID != 0 )MessageBox "No weapons are allowed inside the royal chamber!"PlaySound3D "Door Heavy Close"return

endif

Activate

end

8.17 xCos

Parameters:

• float angle: The angle to take the trigonometric function of.

Returned:

• float result: Result of the function.

Provides the trigonometric function cosine on the given angle.

8.18 xCreateArray

Parameters:

8.17. xCos 65

Page 70: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

• None

Returned:

• long arrayId: The id of the array that was created.

This function creates an empty array, and returns the id of it.

8.19 xCreateSpell

Parameters:

• string ID: The object ID of the spell to create.

• string name: The name of the spell to create.

Returned:

• long wasCreated: 1 if the spell was successfully created.

Creates a new spell with all flags cleared, origin set to spellmaker (2) and a single Water Breathing effect and adds itto the master spell list.

Note: This function will fail if ID already exists or if either ID or name are longer than 31 characters.

8.20 xDegRad

Parameters:

• float angle: An angle, in degrees.

Returned:

• float result: The value of angle in radians.

This simple function converts from degrees to radians.

8.21 xDeleteEffect

Parameters:

• long type: The Object Type to delete an effect from. Must be an alchemy, spell, or enchantment object.

• string id: The object ID to remove an effect from.

• long index: The index of the effect to remove. Must be between (inclusive) 1 and 8.

Returned:

• long result: 1 if the effect was deleted.

Removes the effect at index from the given spell or enchantment.

Other effects are reordered, e.g. if effect 1 is removed, effect 2 becomes 1, 3 becomes 2, etc.

66 Chapter 8. Function List

Page 71: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.22 xDistance

Parameters:

• reference target: The reference of the target to get the distance from.

Returned:

• float distance: The distance between the calling reference and the target reference.

Calculates the distance between the calling reference and target.

Note: Unlike the vanilla GetDistance function, this function will work on non-actors.

8.22.1 Example: Distance from PC Target

This example calculates the distance between the PC and what they are looking at.

begin DistanceToTarget

long pcReflong targetReffloat distance

setx pcRef to xGetRef "player"setx targetRef to xGetPCTarget

setx distance to pcRef->xDistance targetRef

end

8.23 xDrop

Parameters:

• string objectID: The object ID of the item to drop.

• long count: The number of items to drop.

Returned:

• None

This is a wrapper for the vanilla Drop function that can take variable input.

8.24 xEquip

Parameters:

• string objectID: The object ID of the item to equip.

Returned:

• None

8.22. xDistance 67

Page 72: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

This is a wrapper for the vanilla Equip function that can take variable input.

8.25 xEquipmentList

Parameters:

• long node: For the first call, this should be 0 to get the first equipped item. In following iterations, this valuewill be what is returned as nextNode from the previous call.

• long typeFilter: A type filter that matches the Record Type that is desired. Only equipped items matching thattype will be returned. A value of 0 will perform no type filtering.

• long subTypeFilter: An optional subtype filter, allowing the loop to search for a specific Armor Type, ClothingType or Weapon Type. The value passed must be one higher than the value on the linked table. A value of 0 willperform no subtype filtering.

Returned:

• string id: The id string of the equipped item.

• long count: This value will always be 1. Future version of MWSE may expand this to return the actual itemcount for arrows, bolts, and thrown weapons.

• long type: The Record Type of the equipped item.

• long subtype: The Armor Type, Clothing Type or Weapon Type of the equipped item, or 0 if it is not an armor,clothing, or weapon record. Note that the value returned is one higher than the value on the given table.

• long value: The value of the equipped item.

• float weight: The weight of the equipped item.

• string name: The name of the equipped item.

• string enchantId: The enchantment id of the equipped item. This can be fed to enchantment related functionsthat take an id.

• long nextNode: The next node to provide back into this function to continue looping. When this value is 0,there are no more equipped items.

This function behaves similar to xContentList/xContentListFiltered, returning inventory information. This allowslooping over equipped items instead of all items in the target’s inventory.

Note: The subTypeFilter parameter does not exactly match the associated table. Instead, the function requires onemore than the value on the table. For example if searching for clothing records, a value of 0 will perform no filteringby subtype, while a value of 1 will filter for only pants.

Tip: At present this function is the only way to reliably get the equipment a reference has currently worn. Using thetypeFilter and subTypeFilter the script can quickly query to see if, for example, the player is wearing pants.

8.25.1 Example: Simple Equipment Loop

This example demonstrates how to do a simple loop through all equipped items (on the player in this instance).

68 Chapter 8. Function List

Page 73: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Begin loopEquippedItems

long idlong countlong typelong subtypelong valuelong weightlong namelong enchantIdlong node

long loop

long ref

setx ref to xGetRef "player"

set loop to 1whilex ( loop )

setx id count type subtype value weight name enchantId node to ref->→˓xEquipmentList node 0 0

; Code to be run for each looped item.

set loop to nodeendwhile

End

8.25.2 Example: Get Equipped Weapon’s Enchantment

This example shows how to get the enchantment objectId for the currently equipped weapon. Looping isn’t requiredas the player can never have more than one equipped weapon.

begin GetPlayerWeaponInfo

long ref

long idlong countlong typelong subtypelong valuelong weightlong namelong enchlong node

; get the player referencesetx ref to xGetRef "player"

; get info about his weaponsetx id count type subtype value weight name ench node to ref->xEquipmentList 0→˓1346454871 0

8.25. xEquipmentList 69

Page 74: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

ifx ( name )xMessageFix "Weapon: %s" nameMessageBox "Weapon: ________________________________"

endif

ifx ( ench )xMessageFix "Enchantment: %s" enchMessageBox "Enchantment: ________________________________"

endif

end

8.26 xExplodeSpell

Parameters:

• string objectID: The object ID of the spell to explode.

Returned:

• None

This is a wrapper for the vanilla ExplodeSpell function that can take variable input.

8.27 xFileReadFloat

Parameters:

• string filename: The file to read values from.

• long count: The number of values desired.

Returned:

• long valuesRead: The number of results actually read. This may differ from count if it encountered an errorwhile reading.

• float value: A value read. A number of values are returned equal to valuesRead.

Reads a number of float (4 byte) values requested from filename at the current reading position. The currentposition is then advanced. Returns the number of values actually read (valuesRead) followed by the values.

8.28 xFileReadLong

Parameters:

• string filename: The file to read values from.

• long count: The number of values desired.

Returned:

• long valuesRead: The number of results actually read. This may differ from count if it encountered an errorwhile reading.

• long value: A value read. A number of values are returned equal to valuesRead.

70 Chapter 8. Function List

Page 75: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Reads a number of long (4 byte) values requested from filename at the current reading position. The current positionis then advanced. Returns the number of values actually read (valuesRead) followed by the values.

8.29 xFileReadShort

Parameters:

• string filename: The file to read values from.

• long count: The number of values desired.

Returned:

• long valuesRead: The number of results actually read. This may differ from count if it encountered an errorwhile reading.

• short value: A value read. A number of values are returned equal to valuesRead.

Reads a number of short (2 byte) values requested from filename at the current reading position. The currentposition is then advanced. Returns the number of values actually read (valuesRead) followed by the values.

8.30 xFileReadString

Parameters:

• string filename: The file to read values from.

Returned:

• string value: The value read from the file.

Reads from filename at the current reading position, until a C-style null terminator (\0/0x00) is read. The currentposition is advanced as read, and the resultant bytes are returned as a string.

8.31 xFileReadText

Parameters:

• string filename: The file to read values from.

• string pattern: The pattern to match when reading.

Returned:

• long numMatches: The number of values read.

• varies matches: A value returned. A number of values will be returned matching numMatches.

xFileReadText reads a text string from from the file at the current reading position. The current position is thenadvanced. The pattern string is then used to extract data from the string just read; the first return value indicates howmuch of the pattern is matched. The values matched by the pattern are also returned.

The pattern and return values are the same as for the xStringParse function with one addition: placing a single % signat the end of the pattern will cause the read routine to stop when it gets to the end of a line (CR/LF) allowing you touse this to read a normal text file instead of a binary file. Without the trailing % sign on the pattern this will read up tothe first NULL character or to the end of the file if it doesn’t find a NULL character.

8.29. xFileReadShort 71

Page 76: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.32 xFileRewind

Parameters:

• string filename: The file to rewind.

Returned:

• None

This function moves the current reading position to the start of the file.

Call this or xFileSeek at the start of any script which uses file reading or writing functions, otherwise you will haveproblems with the current file position not being as expected.

8.33 xFileSeek

Parameters:

• string filename: The file to seek in.

• long position:

Returned:

• None

This function moves the current reading position to the specified offset in the file.

You should call this or xFileRewind every frame before using other file functions. Use an offset divisible by 2 to readshorts and an offset divisible by 4 to read longs.

This function isn’t very useful if the file contains string data.

8.34 xFileWriteFloat

Parameters:

• string filename: The file to write value to.

• float value: The value to write to file.

Returned:

• None

Writes a float (4 byte) value to filename at the current position. The current position is then advanced.

Note: The file is truncated at the current position (just after the end of the new value). This means that you cannotuse this to modify the values in the middle of an existing file.

8.35 xFileWriteLong

Parameters:

• string filename: The file to write value to.

72 Chapter 8. Function List

Page 77: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

• long value: The value to write to file.

Returned:

• None

Writes a long (4 byte) value to filename at the current position. The current position is then advanced.

Note: The file is truncated at the current position (just after the end of the new value). This means that you cannotuse this to modify the values in the middle of an existing file.

8.36 xFileWriteShort

Parameters:

• string filename: The file to write value to.

• short value: The value to write to file.

Returned:

• None

Writes a short (2 byte) value to filename at the current position. The current position is then advanced.

Note: The file is truncated at the current position (just after the end of the new value). This means that you cannotuse this to modify the values in the middle of an existing file.

8.37 xFileWriteString

Parameters:

• string filename: The file to write value to.

• string value: The value to write to file.

Returned:

• None

Writes a string value to filename at the current position. The string is stored in the file as a C-style null-terminatedstring. The current position is then advanced.

Note: The file is truncated at the current position (just after the end of the new value). This means that you cannotuse this to modify the values in the middle of an existing file.

8.38 xFileWriteText

Parameters:

• string filename: The file to write value to.

8.36. xFileWriteShort 73

Page 78: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

• string format: The format to use when writing to the file.

• varies values: Multiple values that match the format.

Returned:

• None

Writes a formatted string to the file at the current position and advances.

The formatting rules are the same as for the xStringBuild function with one addition. Placing a % at the end of thepattern will suppress the NULL that is normally printed, so a format string ending with %N% can be used to create anormal text file.

Note: The file is truncated at the current position (just after the end of the new value). This means that you cannotuse this to modify the values in the middle of an existing file.

8.39 xFirstItem

Parameters:

• None

Returned:

• long reference: The first reference in the current cell’s “Item” list.

xFirstItem returns the first reference in the current cell’s “Item” list. Despite the name of this function, the associatedlist can contain references of any Object Type other than those exclusive to xFirstNPC. Once acquired, the referencecan be used with various other MWSE functions, such as xRefID and xRefType. Passing the reference as the argumentto the xNextRef function will return the next reference in its associated list.

Note: Scripts that intend to process all references in the loaded cells will need to independently handle the separatelists provided by xFirstItem, xFirstStatic, and xFirstNPC.

8.40 xFirstNPC

Parameters:

• None

Returned:

• long reference: The first reference in the current cell’s “NPC” list.

xFirstNPC returns the first reference in the current cell’s “NPC” list. Once acquired, the reference can be used withvarious other MWSE functions, such as xRefID and xRefType. Passing the reference as the argument to the xNextReffunction will return the next reference in its associated list.

Note: Scripts that intend to process all references in the loaded cells will need to independently handle the separatelists provided by xFirstItem, xFirstStatic, and xFirstNPC.

74 Chapter 8. Function List

Page 79: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.41 xFirstStatic

Parameters:

• None

Returned:

• long reference: The first reference in the current cell’s “Static” list.

xFirstStatic returns the first reference in the current cell’s “Static” list. Despite the name of this function, the associatedlist can contain references of any Object Type other than those exclusive to xFirstNPC. Once acquired, the referencecan be used with various other MWSE functions, such as xRefID and xRefType. Passing the reference as the argumentto the xNextRef function will return the next reference in its associated list.

Note: Scripts that intend to process all references in the loaded cells will need to independently handle the separatelists provided by xFirstItem, xFirstStatic, and xFirstNPC.

8.42 xFloatsToLong

Parameters:

• float value1: First value. Order doesn’t matter.

• float value2: Second value. Order doesn’t matter.

Returned:

• long result: Merged value from value1 and value2.

This function retrieves a long value using a pair of floats. It is intended to work around the issue that all globals arereally floats.

This work by splitting the long 32-bit value into two 16-bit values and adding a flag to indicate which value maps tothe high 16 bits. Argument order doesn’t matter.

Warning: MWEdit doesn’t like to compile these functions with globals as arguments, and temporary locals willneed to be used instead.

8.42.1 Example

long lVal1long lVal2float fVal1float fVal2

set lVal1 to 2147483647setx fVal1 fVal2 to xLongToFloats lVal1setx lVal2 to xFloatsToLong fVal1 fVal2

if ( lVal1 == lVal2 )MessageBox "Success!"

else

8.41. xFirstStatic 75

Page 80: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

MessageBox "Failure!"endif

8.43 xGetAlchemyInfo

Parameters:

• string id: ID of the alchemy item to get information for.

Returned:

• long effectCount: The number of effects on the alchemy item, between 1 and 8.

• long flags: 1 = autocalc, 2 = PC Start, 4 = Always Succeeds

Provides information important to a given alchemy record. Unlike the other related functions, there is no associatedability to set this information. The effects themselves can still be retrieved and modified using xGetEffectInfo andxSetEffectInfo.

Tip: Use this function to determine the state of a potion before modifying it with xAddEffect, xDeleteEffect orxSetEffectInfo.

8.43.1 Example

begin Example_xGetAlchemyInfo

long numEffectslong flags

setx numEffects flags to xGetAlchemyInfo "potion_skooma_01"

MessageBox "flags: %g" flagsMessageBox "numEffects: %g" numEffectsMessageBox "potion_skooma_01"

end

8.44 xGetArraySize

Parameters:

• long arrayId: The id of the array.

Returned:

• long size: The number of elements in the array.

This function determines the size of an array.

76 Chapter 8. Function List

Page 81: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.45 xGetArrayValue

Parameters:

• long arrayId: The id of the array to get a value from.

• long index: The index in the array to fetch.

Returned:

• long value: The value in the array at the given index.

This function retrieves a value in an array, identified by arrayId and at index.

8.46 xGetAttribute

Parameters:

• long attributeID: The Attribute ID to get the value of.

Returned:

• float value: Current value of the attribute.

Returns the current value of the referenced object’s attribute.

Note: This function only supports the player and NPCs.

8.47 xGetBaseAttribute

Parameters:

• long attributeID: The Attribute ID to get the value of.

Returned:

• float value: Base value of the attribute.

Returns the base current value of the referenced object’s attribute.

Note: This function only supports the player and NPCs.

8.48 xGetBaseEffectInfo

Parameters:

• long attributeID: The School ID to get the value of.

Returned:

• long school: The School of the effect.

• float baseCost: The base cost of the effect.

8.45. xGetArrayValue 77

Page 82: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

• long flags: The flags of the effect.

Returns the properties of a magic effect.

Note: This function only supports the player and NPCs.

8.49 xGetBaseGold

Parameters:

• None

Returned:

• long gold: The base amount of bartering gold of the reference.

Returns the base amount of barter gold assigned to the NPC (or creature). This is the value that resets automaticallyeach day.

8.50 xGetBaseID

Parameters:

• None

Returned:

• string id: The reference’s base object ID.

xGetBaseID returns reference’s base object ID. In contrast to xRefID, this function will not include the hexadecimalsuffix that identifies unique instances of containers, creatures, or NPCs. For example, where xRefID would return“Fargoth00000000”, xGetBaseID would instead return just “Fargoth”.

8.51 xGetBaseSkill

Parameters:

• long skillID: The Skill ID to get the value of.

Returned:

• float value: Base value of the skill.

Returns the base value of the referenced object’s skill.

Note: This function only supports the player and NPCs.

8.52 xGetCharge

Parameters:

78 Chapter 8. Function List

Page 83: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

• None

Returned:

• float charge: The current charge on a item.

Returns the current charge on a ‘cast when used’ or ‘cast when strikes’ enchanted item. Constant effect and non-enchanted items return 0.

8.53 xGetClass

Parameters:

• long attributesMask: A bit mask to apply to the attributes value.

• long majorMask: A bit mask to apply to the majorSkills value.

• long minorMask: A bit mask to apply to the minorSkills value.

Returned:

• string classID: The unique string identifier of the class.

• string name: The name of the class.

• long playable: 1 if the class can be chosen by the PC, 0 otherwise.

• long specialization: 0 = Combat, 1 = Magic, 2 = Stealth

• long attributes: A bitmap of the two primary attributes. The result is obtained by adding the values found inthe attributes table below.

• long majorSkills: A bitmap of the 5 major skills. The result is obtained by adding the values found in theskills table below.

• long minorSkills: A bitmap of the 5 minor skills. The result is obtained by adding the values found in theskills table below.

Returns info about the class of the target NPC/PC, or 0 if the target is not an NPC or the PC.

Note: For a custom class created at PC creation, the classID is “NEWCLASSID_CHARGEN” and playable is 0

8.53.1 Attribute and Skill Bitmaps

Value Attribute1 Strength2 Intelligence4 Willpower8 Agility16 Speed32 Endurance64 Personality128 Luck

8.53. xGetClass 79

Page 84: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Value Skill1 Block2 Armorer4 Medium Armor8 Heavy Armor16 Blunt Weapon32 Long Blade64 Axe128 Spear256 Athletics512 Enchant1024 Destruction2048 Alteration4096 Illusion8192 Conjuration16384 Mysticism32768 Restoration65536 Alchemy131072 Unarmored262144 Security524288 Sneak1048576 Acrobatics2097152 Light Armor4194304 Short Blade8388608 Marksman16777216 Mercantile33554432 Speechcraft67108864 Hand-to-Hand

8.54 xGetCombat

Parameters:

• None

Returned:

• reference reference: Reference to the current combat target.

Returns a reference to the reference NPC/creature’s combat target, or 0 if the reference is not in combat.

8.55 xGetCondition

Parameters:

• None

Returned:

• float condition: The current condition on a item.

Returns the current condition for armor and weapons and remaining uses for lockpicks, probes, and repair tools.

80 Chapter 8. Function List

Page 85: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Tip: Use xSetCondition to edit this value.

8.56 xGetEffectInfo

Parameters:

• long type: The Object Type to get the effect of.

• string objectID: The Object ID of the object to get the effect of.

• long index: The effect index to get the info from, from 1 to 8.

Returned:

• long effectId: The Effect ID of the effect.

• long skillAttribId: The Attribute or Skill ID associated with the effect, if applicable.

• long rangeType: 0 = SELF, 1 = TOUCH, 2 = TARGET

• long area: Area of effect.

• long duration: Duration in seconds.

• long magMin: Minimum magnitude.

• long magMax: Maximum magnitude.

Returns the properties of an effect on the given alchemy item, spell, or enchantment.

Note: On failure, effectId is set to -1.

8.57 xGetEnchant

Parameters:

• None

Returned:

• string enchantID: The Object ID of the enchantment.

• short type: The type of the enchantment. 0 = Cast Once, 1 = Cast on Strike, 2 = Cast on Use, 3 = Constant

• short cost: The cost of the enchantment.

• float currentCharge: The current charge for the enchantment.

• long maxCharge: The maximum charge for the enchantment.

• short numEffect: The number of effects on the enchantment.

• long autocalc: 1 if the enchantment is auto-calculated.

Returns info about the enchantment on the target item, or 0 if no enchantment is present.

8.56. xGetEffectInfo 81

Page 86: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.58 xGetEnchantInfo

Parameters:

• string objectID: The Object ID of the enchantment.

Returned:

• short type: 0 = Cast Once, 1 = Cast When Strikes, 2 = Cast When Used, 3 = Constant

• short cost: The cost of using the enchantment.

• long maxCharge: The maximum charge for the enchantment.

• short numEffects: The number of effects on the enchantment.

• long autocalc: 0 = off, 1 = on

Returns info about the given enchantId, or 0 if enchantId is invalid.

8.59 xGetEncumb

Parameters:

• None

Returned:

• float weight: The weight, in pounds, of all the reference’s inventory. This value is negative if leveled itemsare present.

Calculates the total, unmodified encumbrance of the target reference’s inventory. This function does not take intoaccount any feather or burden spell effects.

Note: If the target has any leveled items in its inventory, the returned weight is negative.

8.60 xGetGSString

Parameters:

• long index: ID of the GMST to look up.

Returned:

• string value: The GMST value at the given index.

Fetches a GMST string by its given index and returns its value.

8.61 xGetGlobal

Parameters:

• string globalName: The name of the global.

Returned:

82 Chapter 8. Function List

Page 87: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

• long found: 1 if the global was found, otherwise 0.

• float value: The value of the global.

Returns the value of a global represented by globalName.

8.62 xGetGold

Parameters:

• None

Returned:

• long gold: The reference’s current barter gold.

xGetGold returns the current amount of barter gold possessed by the NPC (or creature). The base gold amount isused if you haven’t bartered with the NPC/creature recently.

Tip: Use xSetGold to edit this value.

8.63 xGetIngredientEffect

Parameters:

• string id: The id of the ingredient to fetch data for.

• long effectIndex: A value between 1 and 4, matching the effect index desired.

Returned:

• long effectType: The Effect Type that the ingredient has at the given effectIndex.

• long skillAttributeType: The Attribute Type or Skill Type, if the effectType supports one. Otherwise willalways be -1.

This function allows scripts to determine the effects of a given ingredient programmatically. Scripts can alter thesevalues as well using xSetIngredientEffect.

8.63.1 Example

begin Example_xGetIngredientEffect

long effectlong skillAttribute

setx effect skillAttribute to xGetIngredientEffect "food_kwama_egg_01" 1

MessageBox "skill / attribute: %g" skillAttributeMessageBox "effect: %g" effectIDMessageBox "food_kwama_egg_01"

end

8.62. xGetGold 83

Page 88: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.64 xGetItemCount

Parameters:

• string objectId: The item’s object ID to get the count of.

Returned:

• long itemCount: The number of items that the reference has.

This is a wrapper function around GetItemCount that allows variable input.

8.64.1 Example

begin Example_xGetItemCount

long ref

long idlong count

setx ref to xGetRef "player"

setx id to xStringBuild "Gold_001"

setx count to ref->xGetItemCount id

MessageBox "Total Gold: %g" count

StopScript Example_xGetItemCount

end

8.65 xGetKeyBind

Parameters:

• long controlType: The Control Type desired.

Returned:

• long scanCode: The Key Scan Code for the controlType.

• long scanDevice: The device type used for the associated scan code. A value of 0 is keyboard, 1 is mouse, 2is joystick.

• long keyCode: The Virtual-Key Code for the controlType. If this value is 0, the scan code could not beconverted to a key code.

This function allows scripts to determine what keys are configured by the player. Typically the keyCode is passed toxKeyPressed to determine if it is pressed. Other functions that require a scan code would make use of scanCode.

84 Chapter 8. Function List

Page 89: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.65.1 Example: Determine if the Activation Key is Pressed

Begin IsActivating

long scanCodelong scanDevicelong keyCode

; Get input information for the Activate key.setx scanCode scanDevice keyCode to xGetKeyBind 5

ifx (keyCode); Activation key was successfully obtained, get its state.setx isPressed to xKeyPressed keyCodeif (isPressed)

MessageBox "Activation key pressed!"endif

endif

StopScript "IsActivating"

End

8.66 xGetLockLevel

Parameters:

• None

Returned:

• short lockLevel: The reference’s lock level, or -1 if none was found.

Returns the lock level of a door or container. This function returns -1 for doors/containers that have never been lockedand for items that aren’t doors or containers.

This returns the lock level regardless of whether the item is locked or unlocked. Use GetLocked to determine the stateof the lock.

Lock level is stored as a signed short (16 bits, max value = 32,767). Values less than 0 do not survive saving, exiting,and reloading. They are converted to their absolute value and the door/container is flagged as unlocked.

8.67 xGetMCPFeatureState

Parameters:

• long id: Identifier for the MCP feature.

Returned:

• short state: 1 if the feature is enabled, 0 if it is disabled, or -1 if MWSE couldn’t determine the MCPinstallation state.

This function can be used to attempt to ensure that the user has the correct Morrowind Code Patch features enabled.

8.66. xGetLockLevel 85

Page 90: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Note: The id parameter comes from mcpatch\describe.json. For example, 137 matches with the Slowfall Overhaulcomponent.

Warning: This functions depends on the user not deleting their mcpatch\installed file. If the user doesn’t havethis file (because they deleted it or don’t have the MCP installed), this function returns a value of -1.

8.67.1 Example

begin DetectPickPocketOverhaul

short state

setx state to xGetMCPFeatureState 77

if (state) thenMessageBox "Pickpocket overhaul is enabled in MCP."

endif

end

8.68 xGetMagic

Parameters:

• None

Returned:

• string objectID: The object ID of the spell or enchantment selected.

• long objectType: The Object Type of the equipped magical source.

Returns the currently equipped spell or enchanted item. This is specifically the object that appears in the equippedmagic slot and includes on-use magical items as well as spells.

Note: The returned objectType and objectID will always be associated with a Spell or Enchantment object, not theWeapon, Armor, Clothing, or Book that the magic is placed on.

8.69 xGetMaxCharge

Parameters:

• None

Returned:

• float maxCharge: The current charge on a item.

86 Chapter 8. Function List

Page 91: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Returns the maximum charge on an enchanted item.

Tip: Use xSetMaxCharge to edit this value.

8.70 xGetMaxCondition

Parameters:

• None

Returned:

• float maxCondition: The current maximum condition on a item.

Returns the maxium condition for armor and weapons and maximum uses for lockpicks, probes, and repair tools.

Tip: Use xSetMaxCondition to edit this value.

8.71 xGetMaxFatigue

Parameters:

• None

Returned:

• float maxFatigue: The reference’s maximum fatigue.

Returns maximum fatigue. This function only supports the player and NPCs.

8.72 xGetMaxHealth

Parameters:

• None

Returned:

• float maxHealth: The reference’s maximum health.

Returns maximum health. This function only supports the player and NPCs.

8.73 xGetMaxMagicka

Parameters:

• None

Returned:

• float maxMagicka: The reference’s maximum magicka.

8.70. xGetMaxCondition 87

Page 92: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Returns maximum magicka. This function only supports the player and NPCs.

8.74 xGetModel

Parameters:

• string objectId: The object ID to get the model of. If 0, the reference will be used.

Returned:

• string modelPath: The path to the model.

This function returns the model of an object. This can be done by passing a string for the object Id, or 0 can be passedto use the script’s reference.

Note: The path returned does not include the Data Files\models prefix.

8.74.1 Example: Get Model by Object ID

begin Example_xGetModelById

long model

setx model to xGetModel "ingred_bonemeal_01"if ( model == 0 )

returnendif

xMessageFix "Model: %s" modelMessageBox "Model: ________________________________"

end

8.74.2 Example: Get Model by Reference

begin Example_xGetModelByRef

long reflong model

setx ref to xGetPCTargetif ( ref == 0 )

returnendif

setx model to ref->xGetModel 0if ( model == 0 )

returnendif

xMessageFix "Model: %s" modelMessageBox "Model: ________________________________"

88 Chapter 8. Function List

Page 93: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

end

8.75 xGetName

Parameters:

• None

Returned:

• string name: The reference’s name, or 0 if no name was found.

xGetName returns a string containing the name (suitable for display, not the objectid) for the object or 0 if the objectdoesn’t have a name. The NPC who falls from the sky near Seyda Neen has an object id of “agronian guy” but hisname is “Tarhiel” when you look at his corpse.

Tip: Use xSetName to edit this value.

8.76 xGetOwnerInfo

Parameters:

• None

Returned:

• string owner: The object ID of the NPC or faction owner of the object.

• long or string condition: If owned by a faction, this is a long indicating the required rank. If this is anNPC this value is either 0, or a string for the global variable to check.

• long type: The Object Type of owner, either NPC or Faction.

Ownership of entities in the world in Morrowind is comprised of two parts: owner and condition (this can specifywhen the player being detected taking or using the entity is not considered a crime). These work in two modes:

1. The first is where owner is an NPC ID, and condition is a global variable - while the global var is set to anon-zero value, activating the entity is never considered a crime.

2. In the second mode, owner is a faction id, and condition is a rank within it. If the player has equal (or higher)rank in that faction, then he can be seen using or taking the entity without it being a crime. This is how supplychests and beds in guildhalls work (their rank requirement is the minimal rank).

This function allows getting full ownership information of an entity: both parts, whatever they may be (as well as whatmode is used for the ownership). It is more in-depth than the xGetOwner function, which does not fully handle factionownership or ownership with a global var requirement.

Tip: If the returned condition is a global variable, it can be used with xGetGlobal and xSetGlobal.

8.75. xGetName 89

Page 94: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.76.1 Example: Boobytrapped Mages Guild and Telvanni faction containers

begin boobycontainers;if the player tries to open a container owned by either MG or GHT that he;doesn't have the required rank to legally take items from, then instead of;the container opening, the player will be zapped.

short framecountshort tempshort player_ranklong pctargetlong typelong own_idlong own_cond

if ( MenuMode )return

endif

set framecount to ( framecount + 1 )if ( framecount < 30 )

returnendifset framecount to 0

setx pctarget to xGetPCTargetifx ( pctarget )

setx type to pctarget->xRefTypeif ( type != 1414418243 ) ;if it's not a container ref type

returnendifsetx type own_id own_cond to pctarget->xGetOwnerInfoif ( type != 1413693766 ) ;if it's not a faction ownership type

returnendif

setx temp to xStringCompare own_id "Mages Guild" ;if the owner of the container→˓is MG, temp will be 0

ifx ( temp ) ;not MGsetx temp to xStringCompare own_id "Telvanni"ifx ( temp )

;owner is not MG and not GHT, eitherreturn

endif;owner is GHTset player_rank to GetPCRank "Telvanni" ;doesn't hurt here, but remember 0

→˓and -1 are both possible return values of this functionelse

;owner is MGset player_rank to GetPCRank "Mages Guild"

endif

set temp to 0if ( player_rank >= own_cond ) ;player is of the right rank in whichever faction

→˓to be able to claim the container's contentsset temp to 1

endififx ( temp )

90 Chapter 8. Function List

Page 95: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

;originally, there was only a return here.;the following block is needed in case activation was already blocked by the

→˓OnActivate call (the 2nd instance of it, now) on a previous run, but the player→˓since raised in rank enough; without this line, the player will no longer get the→˓trap, but the container may not open (as it normally should), either

xSetRef pctargetset temp to OnActivateifx ( temp )

pctarget->Activateendifreturn

endif

;if reached here, player doesn't meet rank requirementxSetRef pctargetif ( OnActivate ) ;merely CALLING this function will block any further normal

→˓activation attempts. it makes the object's activation temporarily only possible→˓through the Activate function

MessageBox "A trap is sprung!"set temp to - ( player->GetFatigue + 1 )player->ModCurrentFatigue temp ;makes player fall down ("knocked out")

→˓briefly - causes current fatigue to be -1player->PlaySound "destruction hit"

endifendif

end

8.76.2 Example: World entity destruction with ownership penalty

begin entitydestruction

;allows the player to destroy objects in the world by striking at them with;a weapon (or barehanded). but if the player wouldn't have been (legally) allowed to→˓pick up that;object, he gets a bounty as if he stole it (with respect to the GMST that controls→˓the bounty amount for theft).

;the value of containers is assumed to be only the value of all the items within them.;the value of doors is assumed to be 100 septims, and of activators, 200 septims.

;this script doesn't take into account whether player is detected (sneaking,→˓invisible),;etc. well, he's doing a loud and incriminating action, anyway.;it doesn't do faction expulsion, either...

short framecountshort update_collong templong pctargetlong typelong valuelong nextreflong invvaluelong invcountlong ownerid

8.76. xGetOwnerInfo 91

Page 96: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

long conditionfloat glob;note: in this script, existing vars are often reused, so that a bunch of;vars are also used for other purposes than their name suggests.

;for example, because it is the only float and there's no problem with;overwriting it, 'glob' is used to (temporarily) hold both the result of;a reading of a global var, and also of reading a float GMST.

if ( MenuMode )return

endif

set framecount to ( framecount + 1 )if ( framecount < timing1 )

returnendifset framecount to 0

if ( player->GetWeaponDrawn == 0 )return

endif

if ( player->GetWeaponType == 0 )return ;ignore lockpicks and probes; unfortuantely this also applies to Short

→˓Blades...endif

setx temp to xKeyPressed 1 ;left mouse buttonsetx pctarget to xGetPCTarget

setx temp to xAnd temp pctarget;if player looking at something AND pressing LMB, temp→˓will be 1

if ( temp == 0 )return

endif

;you should also be able to just use 'if ( player->GetSoundPlaying "weapon swish" )'→˓instead, to check;if the player is making a strike, at least on machines where GetSoundPlaying works→˓fine.;you'd also be able to automatically support all swinging weapons, then.

setx type to pctarget->xRefTypeset value to 0set nextref to 0if ( type == 1598246990 ) ;NPC

returnelseif ( type == 1095062083 ) ;creature

returnelseif ( type == 1414418243 ) ;container

set nextref to 1 ;flag that we need to tally the container's total valueset update_col to 1

elseif ( type == 1380929348 ) ;door (this script allows player to destroy load→˓doors too, careful)

set value to 100

92 Chapter 8. Function List

Page 97: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

set update_col to 1elseif ( type == 1230259009 ) ;activator

set value to 200set update_col to 1

endif

set invvalue to 0set invcount to 0setx type ownerid condition to pctarget->xGetOwnerInfoif ( type == 0 ) ;no owner

set value to 1 ;in case 'value' wasn't determined yet - there's no need to→˓calculate it belowelseif ( type == 1598246990 ) ;NPC owner

set invvalue to 1 ;(temp flag)elseif ( type == 1413693766 ) ;faction owner

set invcount to 1 ;(temp flag)else

MessageBox "ERROR?!" ;this should never happenreturn

endif

ifx ( invvalue ) ;NPC ownersetx temp to xGetRef owneridifx ( temp )

xSetRef tempset temp to GetHealth

elseset temp to 0 ;if can't find the owner, assume he's dead

endifif ( temp <= 0 ) ;if he's dead, then it's all legal...

set type to 0 ;no ownershipset value to 1 ;no need to calculate 'value'

elseifx ( condition )

setx temp glob to xGetGlobal conditionifx ( temp ) ;got the global successfully

ifx ( glob ) ;if it had a true value;then player is allowed to take/use the targetset type to 0set value to 1

endifelse

MessageBox "Got a problem..."endif

endifendif

endif

ifx ( invcount ) ;faction owner;setx temp to xGetPCRank ownerid ;(this function doesn't exist yet)set temp to 0 ;temp filler since can't use above line. this makes the player

→˓count as of the lowest rank in the faction.

if ( temp >= condition ) ;if player is of the required rank or above...;then it's legalset type to 0set value to 1

8.76. xGetOwnerInfo 93

Page 98: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

endifendif

ifx ( value )else

;if value is still 0, we're looking at an item (or a container)

ifx ( nextref ) ;containerset nextref to 0setx temp invcount temp invvalue temp temp nextref to pctarget->xContentList

→˓nextref ;values we don't care about get stored in temp and overwrittenwhilex ( invcount ) ;might take a short... while, if container has tons of

→˓stacks in itset temp to ( invcount * invvalue )set value to ( value + temp )ifx ( nextref )

setx temp invcount temp invvalue temp temp nextref to pctarget->→˓xContentList nextref

elseset invcount to 0 ;break the loop

endifendwhile

else ;looking at an itemsetx value to pctarget->xGetValue

endif

endif

pctarget->Disable ;'destroy' the targetplayer->PlaySound "critical damage"if ( type ) ;if it was determined to be illegal...

setx glob to xGetGS 1173 ;GMST fCrimeStealing (default: 1.0)set value to ( value * glob )ModPCCrimeLevel value

endif

if ( update_col )set update_col to 0;in the event that that the player just disable'd a door or a large;container or activator, its collision will normally remain until the;cell is re-loaded, and the player won't be able to go through th;space it used to occupy.;this part of the script solves that issue, making use of the fact that;the FixMe function also reloads some stuff in the active cell, such as;object coliisions.

;unfortunately, it also seems to always teleport the player, and,;ironically, sometimes cause him to get stuck. therefore, this line is commented

→˓out.

;FixMeendif

end

94 Chapter 8. Function List

Page 99: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.77 xGetPCTarget

Parameters:

• None

Returned:

• long reference: The target reference, or 0 if none was found.

Returns a reference to the object in the player’s crosshair, or 0 if the player is not looking at anything that can bemanipulated.

8.78 xGetProgressLevel

Parameters:

• None

Returned:

• long progress: The player’s progress to next level.

Returns the current progress to the next level.

8.79 xGetProgressSkill

Parameters:

• long skillID: The Skill ID to get the progress of.

Returned:

• float raw: Raw skill progress value.

• float normalized: Normalized skill progress value.

Returns the skill progress for the given skill ID. Returned values will be zero if skill ID is invalid.

8.80 xGetQuality

Parameters:

• None

Returned:

• float quality: The quality of the reference’s base object.

xGetQuality returns the quality of reference’s base object. Supports alchemy apparatus, lockpicks, probes, repair tools.

Tip: Use xSetQuality to edit this value.

8.77. xGetPCTarget 95

Page 100: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.81 xGetRace

Parameters:

• short returnType: The return pattern desired. See below for details.

Returned (returnType is 0):

• string raceID: The object ID of the target’s race.

Returned (returnType is 1):

• array arrayID: An array ID containing the values of the race.

This function fetches the objectID or complete details about the target’s race.

Warning: The arrays returned by this function when returnType is 1 are volatile. They should not be used forcustom storage. Whenever xGetRace is called, the arrays are cleared and refilled with up-to-date information.

If returnType is 0, the response is the race’s object ID. Otherwise, the returned array contains the following values:

Index Type Contents0 string Object ID.1 string Name.2 array Skill bonuses.3 array Starting attributes.4 float Male height.5 float Female height.6 float Male weight.7 float Female weight.8 long Playable flag.9 long Beast flag.

The skill bonuses array begins with index 0 holding the number of skill bonuses (a value between 0 and 7). Pairs ofvalues are then returned. The odd indexes hold the Skill while the even indexes hold the bonus to the given skill.

The starting attributes array contains the following values:

96 Chapter 8. Function List

Page 101: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Index Type Contents0 long Male strength.1 long Female strength.2 long Male intelligence.3 long Female intelligence.4 long Male willpower.5 long Female willpower.6 long Male agility.7 long Female agility.8 long Male speed.9 long Female speed.10 long Male endurance.11 long Female endurance.12 long Male personality.13 long Female personality.14 long Male luck.15 long Female luck.

8.82 xGetRef

Parameters:

• long objectID: An object ID to get a reference to, or 0 to get the script caller’s reference.

Returned:

• long reference: The reference requested, or 0 if none were found.

Returns a reference to one of the active objects that match the object ID. An active object is an object in one of theloaded cells, or a persistent object such as an NPC.

8.83 xGetService

Parameters:

• long mask: A filter to limit the services returned.

Returned:

• long services: The services offered by the reference, limited by mask.

This function returns a bitfield of services offered by a given reference.

The service values are shown in the following table. If an NPC offers more than one service the sum of the servicenumbers will be returned. The mask parameter can be used as a filter to limit the return value to only consider theservices indicated.

8.82. xGetRef 97

Page 102: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Value Service1 Barters for weapons.2 Barters for armor.4 Barters for clothing.8 Barters for books.16 Barters for ingredients.32 Barters for lockpicks.64 Barters for probes.128 Barters for lights.256 Barters for alchemical apparatus.512 Barters for repair tools.1024 Barters for miscellaneous items.2048 Offers spells.4096 Barters for enchanted items.8192 Barters for potions.16384 Provides training.32768 Provides spellmaking service.65536 Provides enchanting service.131072 Repairs armor and weapons.

Note: Previous versions of MWSE made use of xIsTrader, xIsTrainer, and xIsProvider. This function supercedesthose. Old scripts that use them will continue to work, but new scripts should make use of xGetService.

8.84 xGetSkill

Parameters:

• long skillID: The Skill ID to get the value of.

Returned:

• float value: Current value of the skill.

Returns the current value of the referenced object’s skill.

Note: This function only supports the player and NPCs.

8.85 xSetSkillInfo

Parameters:

• long skillID: 1 if the effect was added, or 0 if it wasn’t.

Returned:

• long skillID: ID of the Skill to be modified.

• long attributeID: ID of the new governing Attribute.

• long specialization: The new Specialization Type.

98 Chapter 8. Function List

Page 103: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

• float action1: Progress value for the 1st action.

• float action2: Progress value for the 2nd action.

• float action3: Progress value for the 3rd action.

• float action4: Progress value for the 4th action.

All parameters seem to take effect immediately. There may be side-effects other than those listed below that I havenot discovered yet. Changing the governing attribute will cause any subsequent skill-ups to count toward that attributeat level-up. (Which implies they’re counted, not inferred, and could be modified. Stay tuned. . . ) Changing thespecialization will cause the target progress needed for skill up to change. This function invokes the native skill-upfunction when changing specialization, in case the change would cause progress to reach 100. Actions can be set anegative value, in which case they’ll remove progress, but progress will never go below zero.

setx attribute specialization action1 action2 action3 action4 to xGetSkillInfo 9

8.86 xGetSpell

Parameters:

• string spellID: The spell ID to search for.

Returned:

• long result: 1 if the spell was found, otherwise 0.

Returns 1 if spellId is present, 0 otherwise. This is not a wrapper for GetSpell; it’s a reimplementation. It only worksfor NPCs and the player.

8.87 xGetSpellEffects

Parameters:

• string spellID: The spell ID to check for.

Returned:

• long result: 1 if the object is equipped, otherwise 0.

Returns 1 if the calling object is under the effect of the given spell, or 0 otherwise.

8.88 xGetSpellInfo

Parameters:

• string objectID: The object ID of the spell to get information from.

Returned:

• string name: The spell’s name.

• short type: 0 = Spell, 1 = Ability, 2 = Blight, 3 = Disease, 4 = Curse, 5 = Power.

• short cost: The cost to cast the spell.

• short numEffects: The number of effects the spell has.

• long flags: Bit array of spell flags. 1 = Auto-Calc, 2 = PC Starting Spell, 4 = Always Succeeds.

8.86. xGetSpell 99

Page 104: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

This function gets information about a spell, given its objectID.

Tip: The numEffects value is useful when looping over spell effects using xGetEffectInfo.

8.89 xGetStackSize

Parameters:

• None

Returned:

• long stackSize: The amount of items in the stack, or 0 if not called on a reference.

This function returns the stack size of a given reference. For example if used on a reference to iron arrows, xGetStack-Size will tell you how many arrows there are in that stack.

8.89.1 Example: Get player target’s stack size.

begin Example_xGetStackSize

long reflong size

setx ref to xGetPCTargetif ( ref == 0 )

returnendif

setx size to ref->xGetStackSize

if ( size > 1 )MessageBox "Target stack size is %g." size

elseMessageBox "Target is a single item."

endif

end

8.90 xGetTrap

Parameters:

• None

Returned:

• string spellID: The trap’s spell ID.

• string spellName: The trap’s spell name.

• short spellCost: The trap’s spell cost.

100 Chapter 8. Function List

Page 105: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Returns info about the reference’s trap spell. Only works on container and doors. All returns will be zero if no trap ispresent.

Tip: Use xSetTrap to edit this value.

8.91 xGetValue

Parameters:

• None

Returned:

• long Value: The total value or maximum capacity of the object.

xGetValue returns the Value of reference’s base object.

Tip: Use xSetValue to edit this value.

8.92 xGetWeight

Parameters:

• None

Returned:

• float weight: The total weight or maximum capacity of the object.

xGetWeight returns the weight of reference’s base object. If the reference is a stack of objects, return the total weightof the entire stack. If the reference is a container, return the maximum capacity.

Tip: Use xSetWeight to edit this value.

8.93 xHasItemEquipped

Parameters:

• string objectID: The object ID to check if equipped.

Returned:

• long result: 1 if the object is equipped, otherwise 0.

Returns 1 if the NPC or creature has the object equipped, 0 otherwise.

8.91. xGetValue 101

Page 106: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.94 xInventory

Parameters:

• None

Returned:

• string objectID: The object ID of the item.

• long count: The number of items in the stack.

• node nextStack: A handle to the next stack in the inventory. This is 0 when no more items are in the inventory.

Returns the objectID and count of an item in the target’s inventory. The nextStack can be fed into xNextStack tocontinue iteration.

Warning: This function is limited. Consider using xContentList, xContentListFiltered or xEquipmentList instead.

8.95 xIsFemale

Parameters:

• None

Returned:

• long result: 1 if the reference is female, otherwise 0.

Returns 1 if the NPC is female and 0 otherwise.

8.96 xKeyPressed

Parameters:

• long keyCode: The Virtual-Key Code to check for input.

Returned:

• long (many) keyStatus: The status of keyCode if the parameter is non-zero. Otherwise it returns multipletimes, with every key code pressed.

Monitors the status of the keyboard (and mouse buttons). This can be similar to GetPCSneaking, but actually detectswhether a particular key is really being pressed. If input parameter code is a Virtual-Key Code (between 1 and 254)the return value will indicate the status of that key. A non-zero value means the key is being pressed. If the input codeis 0, then on each call, the function will return the key code for the key (or one of the keys) currently being pressed.

Warning: Some of the codes match different keys on different keyboard layouts.

Note: The key VK code for a given input can be fetched using xKeyPressed, instead of having to rely on hardcodedvalues.

102 Chapter 8. Function List

Page 107: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.97 xLogMessage

Parameters:

• string format: The formatting for the log message.

• varies (many) input: Values to inject into the format.

Returned:

• None

Writes out formatted strings to the log file (MWSELog.txt). This works much like MessageBox but with the additionalformatting options described for xStringBuild. A trailing % in the format string will suppress the printing of the newline sequence allowing a single line of text to be created with two or more xLogMessage calls. The number ofparameters specified in the format MUST match those supplied or there will be trouble.

Note: Literal strings in MWEdit have a maximum length of 63 characters.

8.98 xLongToFloats

Parameters:

• long value: Value to split.

Returned:

• float result1: First half of the split value.

• float result2: Second half of the split value.

This function stores a long value using a pair of floats. It is intended to work around the issue that all globals are reallyfloats.

This work by splitting the long 32-bit value into two 16-bit values and adding a flag to indicate which value maps tothe high 16 bits. Argument order doesn’t matter.

Warning: MWEdit doesn’t like to compile these functions with globals as arguments, and temporary locals willneed to be used instead.

8.98.1 Example

long lVal1long lVal2float fVal1float fVal2

set lVal1 to 2147483647setx fVal1 fVal2 to xLongToFloats lVal1setx lVal2 to xFloatsToLong fVal1 fVal2

if ( lVal1 == lVal2 )MessageBox "Success!"

else

8.97. xLogMessage 103

Page 108: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

MessageBox "Failure!"endif

8.99 xMessageFix

Parameters:

• string (many) newStrings: The strings used to overwrite the following MessageBox call.

Returned:

• None

This function allows you to use strings from variables with the MessageBox function with a few restrictions.

1. The MessageBox command must immediately follow this one.

2. The number of strings for this function must match the number of strings for the MessageBox.

3. The MessageBox can have buttons but it can’t use variables.

4. The values of the strings used on the MessageBox will be replaced with the values from xMessageFix, but theMessageBox strings set a maximum size for each of the xMessageFix strings (it’s OK if the MessageBox stringsare longer than the MessageFix ones).

Using xMessageFix can take both the string variable and literal string types and each string acts as a format string asdescribed for the xStringBuild function. If a string ends in a single % and the formatted string takes less space thanthe matching string from MessageBox, the remaining characters of the MessageBox string will be used.

While it is possible to use formatted messages and buttons, it is best to format strings with xStringBuild if there arebuttons involved because of the limit of 12 parameters per function.

8.100 xModAttribute

Parameters:

• long attributeID: The Attribute ID to modify.

• float value: The value to modify the attribute by.

Returned:

• short result: Result of the function.

Modifies the current and base values of the specified attribute. This suffers from the same display issue as xSetLevel.It ignores the 100 max attribute limit.

Note: This function only supports the player and NPCs.

8.101 xModProgressLevel

Parameters:

• long value: Value added toward the player’s progress to next level.

104 Chapter 8. Function List

Page 109: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Returned:

• short result: 1 if successful, otherwise 0.

Adds value to the progress to the next player level. If the new progress value is less than zero, it’s set to zero instead.Returns non-zero on success, zero on failure.

8.102 xModProgressSkill

Parameters:

• long skillID: The Skill ID to modify.

• float value: The value to modify the skill’s progress by.

• long normalized: flag indicating whether value is raw (0) or normalized (1)

Returned:

• short result: 1 if successful, otherwise 0.

Modifies the current progress for the given skill. If the new progress value is less than zero, it’s set to zero instead.Returns non-zero on success, zero on failure. This function will fail if skill ID is out of range.

8.103 xModService

Parameters:

• long services: The combined value of services the reference should offer (positive) or refuse (negative).

Returned:

• None

Uses the services parameter to modify the services offered by an NPC. A positive value adds that service (or set ofservices) to those already offered. A negative value will remove a service or service. The changes are not permanent.

Value Service1 Barters for weapons.2 Barters for armor.4 Barters for clothing.8 Barters for books.16 Barters for ingredients.32 Barters for lockpicks.64 Barters for probes.128 Barters for lights.256 Barters for alchemical apparatus.512 Barters for repair tools.1024 Barters for miscellaneous items.2048 Offers spells.4096 Barters for enchanted items.8192 Barters for potions.16384 Provides training.32768 Provides spellmaking service.65536 Provides enchanting service.131072 Repairs armor and weapons.

8.102. xModProgressSkill 105

Page 110: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.104 xMyCellID

Parameters:

• None

Returned:

• string cellID: The reference’s current cell ID.

Returns a string containing the name of the cell the object (intended to be used with references to unique NPCs)inhabits. So fargoth_ref->xMyCellID would return “Seyda Neen” unless you’ve lured him into the wilderness forsome reason. Useful for locating that missing companion. Can’t locate items stored in containers or inventory.

8.105 xNextRef

Parameters:

• long reference: A valid reference. See xFirstItem, xFirstNPC, xFirstStatic.

Returned:

• long nextReference: The next reference in the given reference’s associated list.

xNextRef returns the next reference in the supplied reference’s associated list.

8.106 xNextStack

Parameters:

• node stack: The result from a previous xInventory or xNextStack call.

Returned:

• string objectID: The object ID of the item.

• long count: The number of items in the stack.

• node nextStack: A handle to the next stack in the inventory. This is 0 when no more items are in the inventory.

Returns the objectID and count of an item in the target’s inventory. The nextStack can be fed into xNextStack tocontinue iteration.

Warning: This function is limited. Consider using xContentList, xContentListFiltered or xEquipmentList instead.

8.107 xNot

Parameters:

• long value: Value for the logical operation.

Returned:

• long result: 1 if the logical operation returns true.

106 Chapter 8. Function List

Page 111: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

This function performs a NOT logical operation, and returns its result. A NOT operation returns true if its parameteris zero.

A xNot A0 11 0

8.108 xOr

Parameters:

• long leftValue: First value for the logical operation.

• long rightValue: Second value for the logical operation.

Returned:

• long result: 1 if the logical operation returns true.

This function performs an OR logical operation, and returns its result. An OR operation returns true if either of thevalues are non-zero.

A B xOr A B0 0 00 1 11 0 11 1 1

8.109 xPCCellID

Parameters:

• None

Returned:

• string cellID: The player’s current cell ID.

Returns a string containing the name of the current cell.

8.110 xPlace

Parameters:

• string objectID: The object ID of the item to add.

Returned:

• reference placedObject: The reference to the placed object.

This is based on the vanilla PlaceAtPC function that can take variable objectID. Unlike the original function, xPlacedoes not allow specifying a count or location for the placed object.

xPlace returns a reference to the placedObject that can be used to take further actions or obtain further information.

8.108. xOr 107

Page 112: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Note: Unlike previous version of MWSE, the reference returned from xPlace is immediately available on the sameframe it was created.

8.111 xPosition

Parameters:

• float x: The X location to reposition to.

• float y: The Y location to reposition to.

• float z: The Z location to reposition to.

• float rotation: The rotation to take when positioned.

Returned:

• None

This is a wrapper for the vanilla Position function that can take variable input.

8.112 xPositionCell

Parameters:

• float x: The X location to reposition to.

• float y: The Y location to reposition to.

• float z: The Z location to reposition to.

• float rotation: The rotation to take when positioned.

• string cellID: The name/ID of the cell to position to.

Returned:

• None

This is a wrapper for the vanilla PositionCell function that can take variable input.

8.113 xPow

Parameters:

• float base: Base value.

• float exponent: Exponent to calculate.

Returned:

• float result: Result of the function.

Calculates the value of base raised to exponent.

108 Chapter 8. Function List

Page 113: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.114 xDegRad

Parameters:

• float angle: An angle, in radians.

Returned:

• float result: The value of angle in degrees.

This simple function converts from radians to degrees.

8.115 xRandomFloat

Parameters:

• float minimum: Lowest value to return.

• float maximum: Highest value to return.

Returned:

• float result: A random value between minimum and maximum.

This function returns a random float value.

8.116 xRandomLong

Parameters:

• long minimum: Lowest value to return.

• long maximum: Highest value to return.

Returned:

• long result: A random value between minimum and maximum.

This function returns a random long value.

8.117 xRefID

Parameters:

• None

Returned:

• string id: The reference’s ID.

xRefID returns the reference’s ID. In contrast to xGetBaseID, this function will include the hexadecimal suffixthat identifies unique instances of containers, creatures, or NPCs. For example, where xRefID would return “Far-goth00000000”, xGetBaseID would instead return just “Fargoth”.

8.114. xDegRad 109

Page 114: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.118 xRefType

Parameters:

• None

Returned:

• long type: The Record Type of the reference.

Returns the four byte record name of the calling reference.

8.119 xRemoveItem

Parameters:

• string objectID: The object ID of the item to remove.

• long count: The number of items to remove.

Returned:

• None

This is a wrapper for the vanilla RemoveItem function that can take variable input.

8.120 xRemoveSpell

Parameters:

• string objectID: The object ID of the spell to remove.

Returned:

• None

This is a wrapper for the vanilla RemoveSpell function that can take variable input.

8.121 xScriptRunning

Parameters:

• string scriptName: The name of the script to determine the status of.

Returned:

• long status: 1 if the script is running, or 0 if it is not (or does not exist).

This function is a wrapper around ScriptRunning which allows a variable input.

Note: Two other wrapper functions exist to allow dynamic script execution, xStartScript and xStopScript.

110 Chapter 8. Function List

Page 115: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.122 xSetArrayValue

Parameters:

• long arrayId: The id of the array to get a value from.

• long index: The index in the array to fetch.

• long value: The value to set into the array.

Returned:

• short status: 1 if the value was set, otherwise 0.

This function retrieves sets a value in an array, identified by arrayId and at index.

8.123 xSetBaseEffectInfo

Parameters:

• long effectID: The Magic Effect to modify.

• long school: New spell School.

• float cost: New base cost in magicka.

• long flags: New Magic Effect Flags. Only spellmaking, enchanting, and negative lighting are valid here. Allothers are ignored.

Returned:

• long result: 1 on success, 0 on failure.

This function changes the properties of the effect for all magic that uses it. Changes to school and flags take effectimmediately.

E.g. if you have a spell with a Fire Damage effect and you change the Fire Damage school to Alteration, casting thatspell will raise Alteration instead of Destruction. Likewise, if you clear the Spellmaking or Enchanting flags, FireDamage will no longer be available at the respective crafter. Changes to the base cost take effect on any subsequentspell or magic item creation, but don’t affect any spells or items already in the game.

8.124 xSetBaseGold

Parameters:

• long gold: New value to set the reference’s base barter gold to.

Returned:

• None

Changes the base amount of barter gold assigned to the NPC (or creature). Unfortunately this change won’t be savedwith the save game so you will need to reset it after each game reload or after the “72-hour bug” affects the merchant.

Tip: Use xGetBaseGold to read this value.

8.122. xSetArrayValue 111

Page 116: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.125 xSetCharge

Parameters:

• float charge: New charge that will be set on the reference.

Returned:

• long result: 1 if the reference’s was modified, otherwise 0.

Sets the current charge on a ‘cast when used’ or ‘cast when strikes’ enchanted item. May not work if the item hasnever been used.

Tip: Use xGetCharge to read this value.

8.126 xSetCondition

Parameters:

• float Condition: New condition that will be set on the reference.

Returned:

• long result: 1 if the reference’s was modified, otherwise 0.

Sets the current condition of armor and weapons. Armor must not be at 100% or this function will fail. It must havealready sustained some damage.

Tip: Use xGetCondition to read this value.

8.127 xSetEffectInfo

Parameters:

• long type: The Object Type of the object to alter.

• string id: The object ID of the object to alter.

• long index: The index of the effect to alter.

• long effectID: The Effect Type to change to.

• long skillOrAttributeID: The Attribute or Skill ID to use, if the effectID uses one.

• long rangeType: 0 = Self, 1 = Touch, 2 = Target.

• long area: Area of effect.

• long duration: Effect duration (in seconds).

• long minimumMagnitude: Minimum magnitude.

• long maximumMagnitude: Maximum magnitude.

Returned:

• long result: 1 on success, 0 on failure.

112 Chapter 8. Function List

Page 117: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Modifies an existing effect on the given spell or enchantment.

8.128 xSetEnchantInfo

Parameters:

• string enchantID: Object ID of the enchantment to modify.

• long type: 0 = Cast Once, 1 = Cast When Strikes, 2 = Cast When Used, 3 = Constant.

• long cost: New cost per use.

• long charge: New maximum charge.

• long autoCalc: 0 = Off, 1 = On.

Returned:

• long result: 1 on success, 0 on failure.

Sets the properties of the given enchantId.

8.129 xSetGSString

Parameters:

• long index: ID of the GMST to look up.

• string newValue: The value to set the GMST to.

Returned:

• long valueSet: 1 if the value was successfully set.

Fetches a GMST string by its given index, and sets its value to newValue

8.130 xSetGlobal

Parameters:

• string globalName: The name of the global.

• float value: The value to set the global to.

Returned:

• long found: 1 if the global was set, otherwise 0.

Set the global represented by globalName to value.

8.131 xSetGold

Parameters:

• long gold: New value to set the reference’s current barter gold to.

Returned:

8.128. xSetEnchantInfo 113

Page 118: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

• None

xSetGold changes the current amount of barter gold possessed by the NPC (or creature). This value is stored in savegame files so it will survive a game reload. Setting this will have no effect if you haven’t recently bartered with theNPC/creature. (But setting both this and the base gold amount at the same time will likely do what you want.)

Tip: Use xGetGold to read this value.

8.132 xSetIngredientEffect

Parameters:

• string id: The id of the ingredient to fetch data for.

• long effectIndex: A value between 1 and 4, matching the effect index desired.

• long effectType: The Effect Type that the ingredient has at the given effectIndex.

• long skillAttributeType: The Attribute Type or Skill Type, if the effectType supports one.

Returned:

• long success: If the effect was set, this value is 1. If it failed, the value is 0.

This function allows scripts to modify the effects of an ingredient programmatically.

To instead retrieve these values, use xGetIngredientEffect.

8.132.1 Example: Set an ingredient’s first effect.

begin WheatAllergy

long ingredlong indexlong effectlong attrib

setx ingred to xStringBuild "ingred_bread_01"set index to 1 ; First Slotset effect to 22 ; Damage Attributeset attrib to 0 ; StrengthxSetIngredientEffect ingred index effect attrib

; in this case, we could've also used literalsxSetIngredientEffect "ingred_bread_01" 1 22 0

; needs to run only once per sessionStopScript WheatAllergy

end

8.133 xSetLevel

Parameters:

114 Chapter 8. Function List

Page 119: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

• long level: New value to set the reference’s level to.

Returned:

• None

Sets the level of the given reference. This function is a wrapper for SetLevel, and suffers from the same display issue:when using this function on the player, the character screen does not update with the new level.

8.134 xSetMaxCharge

Parameters:

• float maxCharge: New charge that will be set on the reference.

Returned:

• long result: 1 if the reference’s was modified, otherwise 0.

Sets the maximum charge on an enchanted item.

Tip: Use xGetMaxCharge to read this value.

8.135 xSetMaxCondition

Parameters:

• float maxCondition: New maximum condition that will be set on the reference.

Returned:

• long result: 1 if the reference’s was modified, otherwise 0.

Sets the maxium condition for armor and weapons and maximum uses for lockpicks, probes, and repair tools.

Tip: Use xGetMaxCondition to read this value.

8.136 xSetName

Parameters:

• string name: The new name to apply to the reference’s base object. (Maximum 31 characters)

Returned:

• None

xSetName uses the value parameter to change the reference’s name. The new name will not persist through restarts.

Tip: Use xGetName to read this value.

8.134. xSetMaxCharge 115

Page 120: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.137 xSetProgressLevel

Parameters:

• long progress: New value for the player’s progress to next level.

Returned:

• short result: 1 if successful, otherwise 0.

Sets the progress to next level. There are some limits to what you can do with this, because of how the game handlesthis and other values.

Progress is stored in memory as a signed long (32 bits, max value = 2147483647). Progress is stored in the save file asan unsigned char (8 bits, max value = 255) Progress is cast to a float before being displayed on the character screen.This appears to be true for iLevelupTotal as well.

8.138 xSetProgressSkill

Parameters:

• long skillID: The Skill ID to modify.

• float value: The value to set the skill’s progress to.

• long normalized: Flag indicating whether value is raw (0) or normalized (1)

Returned:

• short result: 1 if successful, otherwise 0.

Sets the current progress for the given skill. If the new progress value is less than zero, it’s set to zero instead. Returnsnon-zero on success, zero on failure. This function will fail if skill ID is out of range.

8.139 xSetQuality

Parameters:

• float quality: New quality that will be set on the reference’s base object.

Returned:

• long result: 1 if the reference’s base object was modified, otherwise 0.

xSetQuality modifies the quality of reference’s base object. Supports alchemy apparatus, lockpicks, probes, repairtools.

Tip: Use xGetQuality to read this value.

8.140 xSetRef

Parameters:

• reference newReference: A reference to the use for future function calls.

116 Chapter 8. Function List

Page 121: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Returned:

• None

xSetRef provides a way of calling object functions where the syntax does not allow it, changing the reference used infuture function calls.

8.141 xSetService

Parameters:

• long services: The combined value of services the reference should offer.

Returned:

• None

xSetService uses the value parameter to change the NPC to offer the set of services represented by the number. Theservice number values are used and any old services are ignored.

For example using a value of 8 will make the NPC a bookseller. A value of 131587 (1+2+512+131072) is typical forsmiths. The values changed by this function are not permanent and may be reset after 72-hours or a game reload.

Value Service1 Barters for weapons.2 Barters for armor.4 Barters for clothing.8 Barters for books.16 Barters for ingredients.32 Barters for lockpicks.64 Barters for probes.128 Barters for lights.256 Barters for alchemical apparatus.512 Barters for repair tools.1024 Barters for miscellaneous items.2048 Offers spells.4096 Barters for enchanted items.8192 Barters for potions.16384 Provides training.32768 Provides spellmaking service.65536 Provides enchanting service.131072 Repairs armor and weapons.

8.142 xSetSkillInfo

Parameters:

• long skillID: ID of the Skill to be modified.

• long attributeID: ID of the new governing Attribute.

• long specialization: The new Specialization Type.

• float action1: Progress value for the 1st action.

8.141. xSetService 117

Page 122: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

• float action2: Progress value for the 2nd action.

• float action3: Progress value for the 3rd action.

• float action4: Progress value for the 4th action.

Returned:

• long success: 1 if the effect was added, or 0 if it wasn’t.

All parameters seem to take effect immediately. There may be side-effects other than those listed below that I havenot discovered yet. Changing the governing attribute will cause any subsequent skill-ups to count toward that attributeat level-up. (Which implies they’re counted, not inferred, and could be modified. Stay tuned. . . ) Changing thespecialization will cause the target progress needed for skill up to change. This function invokes the native skill-upfunction when changing specialization, in case the change would cause progress to reach 100. Actions can be set anegative value, in which case they’ll remove progress, but progress will never go below zero.

8.143 xSetSpellInfo

Parameters:

• string spellID: The spell ID to modify.

• string spellName: New display name. Names longer than 31 characters will be truncated.

• long type: New spell type. (0=SPELL, 1=ABILITY, 2=BLIGHT, 3=DISEASE, 4=CURSE, 5=POWER)

• long cost: New magicka cost.

• long flags: New flags. (1=AUTOCALC, 2=PCSTART, 4=ALWAYSSUCCEEDS)

• long origin: New origin. (1=module, 2=spellmaker, 0 to leave unmodified)

Returned:

• short result: 1 if the function was successfull, other wise 0.

8.144 xSetTrap

Parameters:

• string spellID : The spell ID to set as the trap, or 0 to unset a trap.

Returned:

• short result: 1 if the reference’s trap was modified, otherwise 0.

Sets a trap. Only works on containers or doors. In order to have a trap, a reference must also have a lock. Forreferences without locks, call Lock 0 and Unlock prior to xSetTrap.

Traps that are set this way do not persist through saving and loading. If a trap is removed its removal persists only ifthe object is activated or its lock is manipulated before saving.

If you want to set a trap on a door/container, first check for an existing lock (xGetLockLevel). If no lock is alreadyinstalled, use Lock 0, Unlock to create the lock/trap record. Set the trap. To make sure the trap is persistent,manipulate the lock, but then put it back to its original state. In other words, if the lock is currently unlocked, lock it(use xGetLockLevel to determine the correct lock level) then unlock it. Do the reverse if it’s currently unlocked.

Tip: Use xGetTrap to read this value.

118 Chapter 8. Function List

Page 123: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.145 xSetValue

Parameters:

• long value: New value that will be set on the reference’s base object.

Returned:

• long result: 1 if the reference’s base object was modified, otherwise 0.

xSetValue modifies the value of reference’s base object.

Tip: Use xGetValue to read this value.

8.146 xSetWeight

Parameters:

• float weight: New weight that will be set on the reference’s base object.

Returned:

• long result: 1 if the reference’s base object was modified, otherwise 0.

xSetWeight modifies the weight of the reference’s base object. Supports alchemy apparatus, lockpicks, probes, andrepair tools.

Tip: Use xGetWeight to read this value.

8.147 xShift

Parameters:

• long value: The value to shift.

• long magnitude: The number of bits to shift. If negative, the bits will be reverse-shifted.

Returned:

• long result: value, shifted magnitude bits.

This function allows shifting a value by a number of bits equal to magnitude.

8.148 xSin

Parameters:

• float angle: The angle to take the trigonometric function of.

Returned:

• float result: Result of the function.

Provides the trigonometric function sine on the given angle.

8.145. xSetValue 119

Page 124: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.149 xSpellList

Parameters:

• long node: For the first call, this should be 0 to get the first spell. In following iterations, this value will bewhat is returned as nextNode from the previous call.

Returned:

• long totalSpells : Total number of spells the caller knows.

• long spellId : The spell ID.

• long name : The spell name.

• long type : The spell type. (0=SPELL, 1=ABILITY, 2=BLIGHT, 3=DISEASE, 4=CURSE, 5=POWER)

• long cost : The spell cost.

• long effects : The spell’s number of effects. (1 to 8)

• long flags : The spell flags. (1=AUTOCALC, 2=PCSTART, 4=ALWAYSSUCCEEDS)

• long nextNode : The next node to supply to function to continue looping. When this value is 0, there are nomore items.

This function allows a script to iterate through the spell list of an actor and retrieve information about the spells found.Currently this function does not work on creatures.

8.150 xSqrt

Parameters:

• float value: Value to take the square root of.

Returned:

• float result: Result of the function.

Calculates the square root of value.

8.151 xStartCombat

Parameters:

• long reference: Target reference for the caller to initiate combat with.

Returned:

• None

xStartCombat is a wrapper for the original StartCombat to take variables.

8.152 xStartScript

Parameters:

• string scriptName: The name of the script to determine the status of.

120 Chapter 8. Function List

Page 125: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Returned:

• None

This function is a wrapper around StartScript which allows a variable input.

Note: Two other wrapper functions exist to allow dynamic script execution, xStopScript and xScriptRunning.

8.153 xStopScript

Parameters:

• string scriptName: The name of the script to determine the status of.

Returned:

• None

This function is a wrapper around StartScript which allows a variable input.

Note: Two other wrapper functions exist to allow dynamic script execution, xStartScript and xScriptRunning.

8.154 xStringBuild

Parameters:

• string format: The format string to use, given the tokens below.

• varies (many) input: The variables to use, matching the pattern of special tokens below.

Returned:

• string result: A string build from the combined input.

xStringBuild returns a new string that is constructed based on the format string and any other variable values asneeded. The format string is similar to those for MessageBox with % indicating some special character or variablesubstitution.

Some patterns can be used to place special characters into the string:

Token Meaning%% A single % sign is placed in the string.%n A new line marker (CR/LF) is placed in the string.%q A quotation mark (“) is placed in the string.

The rest are used to insert values from the remaining parameters into the output string.

Token Meaning%d A short or long value is inserted as a decimal integer.%h A short or long value is inserted as a hexadecimal integer.%f A float value is inserted as real decimal number.%s A string value is inserted.%l A long value is inserted as a four character string.

8.153. xStopScript 121

Page 126: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Note: The uppercase forms %N, %Q, %D, %H, %F, %S, and %L also work.

The float specifier takes a precision specifier just like the MessageBox command. The format %.3f will print afloating point value with three digits after the decimal point.

The string specifier can take two numbers in its specifier:

Token Meaning%2s Skips the first two characters of the string, but inserts the rest.%.3s Inserts only three characters of the string.%4.5s Skips 4 characters, then inserts the next 5 characters of the string.

Note: The compiler doesn’t currently support more than 12 parameters at a time.

Note: The format string is limited to 64 characters.

8.155 xStringCapture

Parameters:

• string string: The string to search for pattern in.

• string pattern: The regex pattern to use.

• long desiredMatches: The number of results to return.

Returned:

• string (many) matches: Results of the pattern matching for pattern on string. The function always returndesiredMatches results.

This function performs much as xStringMatch, but returns the result groups of the regex match. The a number ofresults matching desiredMatches is always returned. The matches will be 0 if a match isn’t made.

8.156 xStringCompare

Parameters:

• string leftString: The first string in the comparison.

• string rightString: The second string in the comparison.

Returned:

• string result: 0 if the strings are equal, otherwise a signed number based on sorting.

Compares the two strings based on alphabetical order and returns 0 if they are equal, a negative number if leftStringwould appear first, and a positive number if rightString would appear first.

122 Chapter 8. Function List

Page 127: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.157 xStringLength

Parameters:

• string string: The string to take the length of.

Returned:

• long length: The length of string.

Returns the number of characters in the input, string.

8.158 xStringMatch

Parameters:

• string string: The string to search for pattern in.

• string pattern: The regex pattern to use.

Returned:

• string (many) matches: Results of the pattern matching for pattern on string. The function always returndesiredMatches results.

This function performs a regular expression check on string, allowing for very flexible and powerful pattern and stringmatching/identification. For example, you can check if a string contains certain words, or a certain set of characters,in it and in a specific position and order, if you want, and much more.

Note: To return the tokenized regex result, use xStringCapture.

MWSE uses the Regex library from the Boost C++ library. The regular expression style is the Perl syntax; please seethe Boost Regex documentation for full details. However, here is a partial quick summary:

8.157. xStringLength 123

Page 128: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

Pat-tern

Description

. Matches any one character.^ Matches the beginning of the string.$ Matches then end of the string.(and)

Groups a sub-expression (see below).

* Makes the preceeding item or group match zero or more times.? Makes the preceeding item or group match zero or once.+ Makes the preceeding item or group match one or more times.{in-te-ger}

Makes the preceeding item or group match exactly integer times.

{int1,int2}Makes the preceeding item or group match from int1 to int2 times.| Alternation; makes the pattern match either the item on the left of the | or the item on the right.[char-ac-terset]

Matches a single character from the set character set. The set can contain individual characters, or rangesof the form a-b, which matches all characters between a and b, including a and b. (For example, [A-Z] willmatch upper case letters.) If the character set begins with ^, then it will match any character except those inthe character set.

[[:name:]]Matches a single character from the pre-defined set name.\char-ac-ter

Matches the character; that is, removes the special meaning, if any, from character. (For example, “.”matches any single character, but “.” matches the period character.)

\d Match a digit (0-9).\l Match a lower case letter (a-z).\s Match whitespace (space, tab).\u Match an upper case letter (A-Z).\w Match a word (a string of letters, digits, and underscores)\D Match anything but a digit.\L Match anything but a lower case letter (a-z).\S Match anything but whitespace (space, tab).\U Match anything but an upper case letter (A-Z).\W Match anything but a word.\< Match the start of a word.\> Match the end of a word.\b Match the end or start of a word.\B Match anything but the end or start of a word.(?i) Turns on the i modifier (case insensitive match) for the rest of the pattern or until an enclosing ).(?i:pattern)Turns on the i modifier for the enclosed pattern only.

8.159 xStringParse

Parameters:

• string pattern: The pattern to parse.

• string source: Indicates how much of the pattern matched successfully.

Returned:

• long matchCount: The number of matches returned.

124 Chapter 8. Function List

Page 129: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

• varies (many) matches: The values parsed out of the string.

This function identifies and extracts data from the source string based on the pattern string. The first return valuematchCount is a long indicating how much of the pattern matched successfully. The matches by the pattern will thenbe returned in order.

In the pattern string, all of the special features begin with a % symbol. Some, simply match special characters thatcan’t otherwise be typed in the pattern string.

Token Description%% Matches a single % sign.%n Matches the new line marker, CR/LF.%q Matches the ” quotation mark.

The rest return the values matched so they can be stored in variables with setx.

Token Description%d Matches a decimal integer and the value is returned as type long.%h Matches a hexadecimal integer and the value is returned as type long.%f Matches a real number and the value is returned as type float.%s Matches the rest of the string and returns it as type string.%l Matches exactly four characters and returns them as type long.

Note: The uppercase forms %N, %Q, %D, %H, %F, %S, and %L also work.

8.159.1 MWSE Version Checking

A special use case of xStringParse is to check the version of MWSE. If a value of zero is returned, the version ofMWSE is older than version 2.0.

To do this, pattern must be MWSE_VERSION. source is instead a long, to compare to the return value. If the versionreturned is greater than or equal to source, the second return value is 1.

Example:

long versionlong versionAbove2p0

setx version versionAbove2p0 to xStringParse "MWSE_VERSION" 2000000

The version returned is spaced. Version 2.0.0 is 2000000 while the hypothetical version 2.34.9 would be 2034009.

8.160 xTan

Parameters:

• float angle: The angle to take the trigonometric function of.

Returned:

• float result: Result of the function.

Provides the trigonometric function tangent on the given angle.

8.160. xTan 125

Page 130: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

8.161 xTextInput

Parameters:

• string string: The string to modify with the user’s input.

• long endCode: The Virtual-Key Code used to stop reading input.

Returned:

• long length: The length of text.

• string text: The text entered.

This function allows you to directly read keyboard input from the user and the results will be returned as a string. Passa string and a virtual key code to the function. The function will wait for a key to be pressed and then take one of threeactions. If the key pressed matches the endCode parameter, the string and its length are returned. If the key pressedis a printable ASCII character, the character is added to the string and the string and the number 0 are returned. If thekey is RETURN or BACKSPACE, a new line is started or one character is removed from the string, and the modifedstring and a 0 are returned. The function returns after each key press so that the current value of the string can beshown with xMessageFix and MessageBox but the string should only be used normally after the length is returned.Player controls should be disabled while this function is used.

Note: xGetKeyBind can be used to determine a specific key the user has configured.

8.162 xTextInputAlt

Parameters:

• string string: The string to modify with the user’s input.

• long endCode: The Virtual-Key Code used to stop reading input.

Returned:

• long length: The length of text.

• string text: The text entered.

This function is identical to xTextInput except that the function simply checks the status of keys and returns immedi-ately rather than waiting for a key to be pressed.

8.163 xXor

Parameters:

• long leftValue: First value for the logical operation.

• long rightValue: Second value for the logical operation.

Returned:

• long result: 1 if the logical operation returns true.

This function performs an XOR logical operation, and returns its result. An XOR operation returns true if one of thevalues is non-zero, but not both.

126 Chapter 8. Function List

Page 131: Morrowind Script Extender v2 Documentation · Morrowind Script Extender v2 Documentation, Release 2.0 The Morrowind Script Extender makes additional functions available for use in

Morrowind Script Extender v2 Documentation, Release 2.0

A B xXor A B0 0 00 1 11 0 11 1 0

8.163. xXor 127