Morrowind Mod talk:DaysPassed

The UESPWiki – Your source for The Elder Scrolls since 1995
Jump to: navigation, search

DaysPassed, mods, and various versions of Morrowind: I've noticed various complaints about this variable being "broken", especially with Bloodmoon-only (no Tribunal,) and I think I know why. This seems the best place to quickly share that with others. I'll leave it to someone more active with wikis to put it in useful form on the actual page.

The skinny, in my experience, is this: If you used DaysPassed in a script or dialogue and compile the script without Tribunal or some other plugin that contains a DaysPassed global, the compiled script or dialogue will be broken, and stays broken AFAIK until you recompile it with a DaysPassed global present at the time of compilation. DaysPassed doesn't seem to be the only thing vulnerable to this: in general, compiling a script that refers to things that aren't loaded in the CS is bad karma. Bloodmoon doesn't seem to contain it, so compiling with Bloodmoon loaded and Tribunal not should consistantly break usage of DaysPassed.

To get around this, I use a simple dependancy plugin that contains simplex versions of everything I want to refer to (including a DaysPassed global, the gold armor from LeFemm, various bits and pieces of Tribunal and Bloodmoon, and Syc's Herbalism global which I refer to in a homebrew add-on expansion/modification of it.) Whenever I edit, I load that, Morrowind, the GMST vaccine, and the plugin I'm actually going to edit. No problems, no Tribunal or Bloodmoon loaded in the CS while I'm editing my plugins, no complaints about or involvement with TR/BM's dialogue conflicts, all very clean and tidy. Any modder should be able to make their own dependancy plugin like this that covers whatever they happen to need.

Playing with Bloodmoon loaded and Tribunal not I haven't tested, but I suspect it'll either work or be trivially fixable by providing an addon plugin that contains the global; putting the global in your main plugin even for use with Tribunal present might be safe or might cause obscure issues of its own, haven't tried.

DaysPassed is also subject to all the other global variable gotchas (which don't seem to be documented very well) such as using an expression too complex for the parser to deal with; for example, using constant math in the same if as 2 globals seems to be bad karma: if ( DaysPassed > ( PluginGlobal + 7 ) ) Simplifying expressions into a series of sets followed by a very simple if/while/etc generally fixes problems like that.


On a semi-related note, it should be quite possible to make a plugin that simply creates a usable DaysPassed global and updates it through a global script for people who have neither Tribal nor Bloodmoon (vanilla Morrowind, including early versions - though of course to get that global script running you'll likely need to resort to hooking something else since you can't use Start Scripts.) From the looks of how things work, such a thing should be usable more or less out of the box with plugins that use nothing else from Tribunal (such as many herbalism plugins) - just culling the Tribunal dependancy from the plugin with Wyremash would probably be enough, no script recompilations/etc.

188.165.2.5 21:37, 19 May 2014 (GMT)