There needs to be a better way to work around that. That being said, if faced with the option of battle music not ending when it should or ending too quickly, I'd take the former over the latter. At least battle music not ending can be reset with a simple cell switch.
Well, one can force an enemy to be killed, like mentioned in the post linked above. Or maybe using OnDeath. The fact is that when you make the script see an enemy is dead, for the script the enemy is dead (...!). But with the enemy actually still alive (even if with very low hp), could lead the script to restart battle music (above all at the beginning, when you do low damage and you could miss a lot). So using mdocurrenthealth would fix the problem.
It's hilarious because a good sign that one of my tests has gone awry is when four or five of him suddenly spawn at once >.<
I'd not be surprised if that were due to the startscript function. Each time you call it, the entire frame is restarted from the beginning, so if you have 5 scripts, and you use startscript in the second one (in an order than only MW knows), then it will restart from the first. So you'll have the first 2 scripts processed two times (or maybe 3, or 4) in a frame while the last three have not been read yet. This was the reason why timers were always screwed up when playing with other particular mods that use startscritps a lot. Again, even when I was sure to have fixed the buggy "original music feature", testing it loading only BMS, then it was scrwed up again when I tested it with all the other mods I use. I had to insert a delay to be sure that one particular script couldn't be processed more than one time in a frame in certain conditions. Take always into consideration this matter when something goes wrong and you seem to have done all right.
Yeah, I'll look into it as soon as I'm done with mine. As quick of a job it is to look it over, I've noticed that constantly switching between your version of the mod and mine tends to cause lots of crashes when the game loads (apparently, Morrowind stores a lot of crap in the RAM that it shouldn't).
It may happen yes, but it should be resolvable cleaning the save with WM.
EDIT: I also seem to be having a *lot* of problems with your distance checks. Set the value any higher than 4000, and the game doesn't really keep track of them past 4500 or so and the music never resets. And lower, and the AI will usually still be tailing you, and there's lots of resets in and out of battle when you hit the threshold.
No, this time is my fault, when I remade the script I forgot to test that.And forgot to put it back this block, just under the "xNextRef/xFirstNPC" block:
ifx ( ref ) xSetRef ref set distance to GetDistance, "player" endif if ( distance > 8000 ) return endif
Now every thing works as intended, when going beyond the threshold, music stops, I even tried with 3 enemies and it works fine. Oh, [censored] carelessness!
The problem seems to be that there's no way to tie this in neatly to whether or not the AI is still following you or not, otherwise I'm sure you would have.
Well it doesn't behave always the same way, but an enemy probably will stop targeting you when you are a good distance.
REVENGE OF THE EDIT: Yeah, that definitely works. It makes the battle music behave a lot like I have the town and explore music behaving, actually (lack of harsh transitions and all). So, you either kill your opponent outright and have the battle music end immediately, or you run and (hopefully) have escaped by the time the battle music ends, at which point it transitions smoothly into the explore music. It also gives me one more excuse to just say "[censored] it" and reduce the HP thresholds for opponent deaths from 5 to 0 (at least until we figure out a better system).
No problems when the enemy dies but has still some hp?
Wow... I just said "we", didn't I? Sorry if I sound like I'm horning in on your work, here. I'm honestly just glad I feel like I have something to contribute at this point.
Well you've done a good job I suppose. And this discussion was constructive for me too, so I think it's a win-win.
Speaking of contributing, there seems to be something wrong with that latest update I downloaded. It's incredibly small (100 some-odd KB, whereas your last updates were around 800 kb-ish), and Morrowind refuses to even load when the file is in my "Data Files" directory, unchecked or not. It says that "BMS_UPDATE_v1.7.3 - Test vresion" isn't even a valid .esp file. Maybe I just got a corrupted download or something. I'll look into it more in the morning when I'm less exhausted.
Oh, and I'm, going to say that my version is pretty much "done" at this point, since the boss battle music was the last thing left that I hadn't tested. I ended up having to restructure the battle script a bit more to accommodate it properly, so the final version is a bit different from the last one I posted.
Again, if you're curious (which I frankly wouldn't fault you for not being at this point), this is my finished product:
http://btb2.free.fr/...rrowind_bms.zip
Oh, and I'm, going to say that my version is pretty much "done" at this point, since the boss battle music was the last thing left that I hadn't tested. I ended up having to restructure the battle script a bit more to accommodate it properly, so the final version is a bit different from the last one I posted.
Again, if you're curious (which I frankly wouldn't fault you for not being at this point), this is my finished product:
http://btb2.free.fr/...rrowind_bms.zip
I will surely check my esp and yours, when these 3 days will finally be passes I hope I'll have more time for this.
EDIT: I uploaded the esp with the latest changes.
http://www.megaupload.com/?d=UHM2S9EJ
(if you have problems with MU here another link http://rapidshare.com/files/439029006/BMS_UPDATE_1.8.esp )