Morrowind Mod:Wrapper function

Mod / Morrowind: Morrowind Mod: Tutorials and Guides

Some scripting functions that take arguments do not accept variables, meaning they can only be used with literal values (i.e. hardcoded constant values, such as 123). This severely limits their flexibility, and the usability of the scripting language as a whole.

A wrapper function is a kind of script extender function that accepts variables and passes their values to a preexisting function, thereby allowing that specific preexisting function to be used with dynamic values, and solving the issue mentioned above for it.

Less commonly, the same issue is solved by completely re-implementing an existing function as a script extender function. In this case, the reimplemented function may behave differently from the original, by design or by necessity. An example of one such function is the xGetSpell function.

Examples of wrapper functionsEdit