Detecting when player is in combat with MWSE?

Post » Mon Aug 03, 2015 6:10 pm

So, I'm trying to write a simple script which will stop a certain script when the player enters combat, and have a second script running which will restart said script when the player exits combat. However, I have no idea how to use XGetCombat. I read http://wiki.theassimilationlab.com/mmw/XGetCombat on MMW, but I don't understand the examples or the description, can someone help me out with this?

User avatar
Helen Quill
 
Posts: 3334
Joined: Fri Oct 13, 2006 1:12 pm

Post » Tue Aug 04, 2015 4:43 am

setx InCombat to PCRef->xGetCombatifx ( InCombat )    ; Do something here if PC has a combat target.else    ; Do something here if PC has no combat target.endif

Since MW scripts run every frame, in this example the 'else' section will continually run until the player actually acquires a combat target, then at that point the 'ifx' section will run instead. Once said target dies or combat ends, then InCombat would once again evaluate to 0 and the 'else' code would resume. You could place StartScript/StopScript/etc in those as needed.

Edit: I should probably note that this won't actually detect if the player is in combat or not, just if the player has a combat target. If someone else is attacking the PC but he never hits back, he'll never actually have combat target.

User avatar
Jani Eayon
 
Posts: 3435
Joined: Sun Mar 25, 2007 12:19 pm

Post » Tue Aug 04, 2015 5:02 am

Hmm, if that won't detect if the player is in combat, what will? My script is playing music and I want it to stop playing music if the player is in combat, and restart once combat is done. I got the idea this could only be accomplished by MWSE functions, but I've read through scripts in both MAO and BetterMusicSystem and frankly I have no idea what's going on. :P

User avatar
Riky Carrasco
 
Posts: 3429
Joined: Tue Nov 06, 2007 12:17 am

Post » Mon Aug 03, 2015 9:12 pm

I believe MAO does it by detecting when the player is attacked, not really when they're in combat. No idea about BetterMusicSystem.

User avatar
e.Double
 
Posts: 3318
Joined: Tue Jul 24, 2007 11:17 pm

Post » Mon Aug 03, 2015 11:02 pm

How would one detect when/if the player is attacked then? I don't see any reference to functions that would do that on MMW. :unsure:

Here is my script for reference:
Spoiler
begin NMMw_Music_Dungeon	short rand	short playOnce	float timerif ( CellChanged == 1 );WARNING: May not work in cases of teleport, only on going through the door	set playonce to 0	Streammusic "nmmw/endmusic.mp3"	set timer to 1endif;if (combat_initiates);	set playonce to 0;	Streammusic "nmmw/endmusic.mp3";	set timer to 1;	startscript NMMw_CombatReactivator_Dungeon;endif;block is executed when the player enters the cell, or the song finishedif ( playonce == 0 )	set Rand to random 7	if ( Rand == 0 )		Streammusic "nmmw\dngn\dngn1.mp3"		set timer to 103	elseif ( Rand == 1 )		Streammusic "nmmw\dngn\dngn2.mp3"		set timer to 250	elseif ( Rand == 2 )		Streammusic "nmmw\dngn\dngn3.mp3"		set timer to 184	elseif ( Rand == 3 )		Streammusic "nmmw\dngn\dngn4.mp3"		set timer to 186	elseif ( Rand == 4 )		Streammusic "nmmw\dngn\dngn5.mp3"		set timer to 407	elseif ( Rand == 5 )		Streammusic "nmmw\dngn\dngn6.mp3"		set timer to 267	elseif ( Rand == 6 )		Streammusic "nmmw\dngn\dngn7.mp3"		set timer to 279	elseif ( Rand == 7 )		Streammusic "nmmw\dngn\dngn8.mp3"		set timer to 286	endif	set playonce to 1endifif ( playonce == 1 )	set timer to ( timer - getsecondspassed )	if ( timer <= 0 );as the timer is counting down, we need to wait till it is less than 0	set playonce to 0	endif	endifend


And the combat reactivator script:
Spoiler

begin NMMw_CombatReactivator_Dungeonif (not_in_combat)    If ( ScriptRunning, "NMMw_Music_Dungeon" == 0 )		startscript NMMw_Music_Dungeon	endifendifend

Obviously the references to being in combat are placeholders, since I'm not sure how I'd write something that detects it.
User avatar
meghan lock
 
Posts: 3451
Joined: Thu Jan 11, 2007 10:26 pm

Post » Mon Aug 03, 2015 10:36 pm

Detecting attacks is done through GetSoundPlaying. Here's an example script you can try out:

begin Hit_Testshort PCHitset PCHit to 1if ( Player->GetSoundPlaying "Health Damage" )elseif ( Player->GetSoundPlaying "destruction hit" )elseif ( Player->GetSoundPlaying "frost_hit" )elseif ( Player->GetSoundPlaying "shock hit" )elseif ( Player->GetSoundPlaying "Light Armor Hit" )elseif ( Player->GetSoundPlaying "Medium Armor Hit" )elseif ( Player->GetSoundPlaying "Heavy Armor Hit" )elseif ( Player->GetSoundPlaying "Hand to Hand Hit" )elseif ( Player->GetSoundPlaying "Hand to Hand Hit 2" )else    set PCHit to 0endifif ( PCHit )    MessageBox "I'm Hit!"endifend
User avatar
naome duncan
 
Posts: 3459
Joined: Tue Feb 06, 2007 12:36 am

Post » Mon Aug 03, 2015 11:43 pm

Thanks! That example looks promising. How would one detect when combat is finished? Would using XGetCombat to return 0 work? Stopping the music on combat is only half the battle. :)

User avatar
Krystal Wilson
 
Posts: 3450
Joined: Wed Jan 17, 2007 9:40 am

Post » Mon Aug 03, 2015 11:29 pm

From my limited experimentation, pc_ref->xGetCombat starts returning the player's combat target as soon as the first aggressive targeted action (attack, etc) is taken by the player toward another actor... but not before then even if all of Vvardenfell is attacking the player; it does not stop returning that combat target until it is killed or changed or there's enough distance between them that it is dropped by the game engine (that's something like a few cells). I presume it works the same way in reverse for actor_ref->xGetCombat. So, unfortunately, to detect "combat" this way requires checking xGetCombat for the player and every actor in the cell, but that's certainly possible with xFirstNPC/xNextRef. Sound detection could work much more simply to detect if the player is hit (as in Greatness' example above) but if you want to detect the player being targeted without being hit then I think you're stuck with the aforementioned method (although I would be very happy to be proven wrong!).

User avatar
sam westover
 
Posts: 3420
Joined: Sun Jun 10, 2007 2:00 pm

Post » Tue Aug 04, 2015 1:53 am

Since we're not actually detecting when combat begins, just when the player gets hit, detecting when combat ends is sort of unrelated. :P

Anyways, as for how to do it, there's not really any "pretty" way. You could do what sveng suggested above and check every NPC in the cell to see if they're in combat, but doing that every frame would butcher your FPS. Your also not using MWSE in any other part of the script, so you might want to stick with vanilla functions to ensure compatability. A simpler alternative way might be to just have a generic timer running. If the player hasn't been hit for several minutes it's probably safe to assume combat is over and resume your music. If he gets hit again the music would stop as usual per the script, so it shouldn't be too big of a deal even if you cut in the music too early.

User avatar
Gen Daley
 
Posts: 3315
Joined: Sat Jul 08, 2006 3:36 pm

Post » Mon Aug 03, 2015 7:40 pm

Good to know. I think detecting hit sounds is a good way to handle starting combat so I'm going to do it that way. It has the added bonus of not interrupting the music if you sneak kill an enemy with a ranged weapon and adding an extra element of surprise if you aren't aware an enemy is coming after you.

As for detecting when combat ends, I made a request in Merzasphor's MWSE thread so hopefully I'll get a cleaner way of doing this soon. It should open up some neat scripting possibilities for others too. Thanks for all the help! I'm going to keep this thread open in case I have other scripting questions later. :)

User avatar
Kahli St Dennis
 
Posts: 3517
Joined: Tue Jun 13, 2006 1:57 am

Post » Mon Aug 03, 2015 10:21 pm

There's a problem with that example, compiling the script returns an error "Unknown object ID 'Player' found!". I'm not sure how to fix it. :unsure:

User avatar
Steve Fallon
 
Posts: 3503
Joined: Thu Aug 23, 2007 12:29 am

Post » Mon Aug 03, 2015 2:57 pm

You got this in MWEdit right? Don't forget to check the morrowind ESM manually in it. Unlike CS, when you load an ESP, its masters doesn't load automatically.

User avatar
Emily Shackleton
 
Posts: 3535
Joined: Sun Feb 11, 2007 12:36 am

Post » Mon Aug 03, 2015 1:16 pm

It should compile fine in the normal CS, but if you're using MWEdit you may need to enable the "Extra Script Records" option.

Download https://www.dropbox.com/s/zj7a6u1byfhmujj/mweditextrafile.esp?dl=0 file then put it in your MWEdit folder and go to View->Options then check the appropriate box and fill in the path. Example: http://i.imgur.com/IARIFtH.png

User avatar
Jason King
 
Posts: 3382
Joined: Tue Jul 17, 2007 2:05 pm

Post » Tue Aug 04, 2015 1:55 am

Ok, loading it with Morrowind.esm worked. However, this 'lil script is returning an error "Syntax Error: Expected 'Unknown' but found 'Symbol' (Player)!":
Spoiler

begin NMMw_CombatReactivator_Dungeon	short InCombatsetx InCombat to Player->xGetCombatifx ( InCombat == 0)	returnelse    If ( ScriptRunning, "NMMw_Music_Dungeon" == 0 )		startscript NMMw_Music_Dungeon	endifendif;    If ( ScriptRunning, "NMMw_Music_Dungeon" == 0 );		startscript NMMw_Music_Dungeon;	endif;endifend

It's mostly a placeholder until new MWSE functions are added, but I was hoping it would at least sort of work in the meantime.
User avatar
Cat Haines
 
Posts: 3385
Joined: Fri Oct 27, 2006 9:27 am

Post » Mon Aug 03, 2015 4:33 pm

"PCRef" that I gave in the original example is a variable containing a reference to the PC, you'll need to declare and assign it in your script.

begin NMMw_CombatReactivator_Dungeonlong PCReflong InCombatsetx PCRef to xGetRef "Player"setx InCombat to PCRef->xGetCombatif ( InCombat == 0 )    returnelseif ( ScriptRunning "NMMw_Music_Dungeon" == 0 )    StartScript NMMw_Music_Dungeonendif;    If ( ScriptRunning "NMMw_Music_Dungeon" == 0 );        StartScript NMMw_Music_Dungeon;    endif;endifend
User avatar
Kevin S
 
Posts: 3457
Joined: Sat Aug 11, 2007 12:50 pm

Post » Tue Aug 04, 2015 12:36 am

Ok, so both my scripts compile in MWEdit, but when the script starts ingame, I get these errors:
"Script Error: EXPRESSION in NMMw_Music_Dungeon
Infix to postfix"
No dungeon music plays, and then regular explore music starts playing.

Here's the script in question:
Spoiler

begin NMMw_Music_Dungeon	short rand	short playOnce	short PCHit	float timerif ( CellChanged == 1 );WARNING: May not work in cases of teleport, only on going through the door	set playonce to 0	Streammusic "nmmw/endmusic.mp3"	set timer to 1endifset PCHit to 1if ( Player->GetSoundPlaying "Health Damage" )elseif ( Player->GetSoundPlaying "destruction hit" )elseif ( Player->GetSoundPlaying "frost_hit" )elseif ( Player->GetSoundPlaying "shock hit" )elseif ( Player->GetSoundPlaying "Light Armor Hit" )elseif ( Player->GetSoundPlaying "Medium Armor Hit" )elseif ( Player->GetSoundPlaying "Heavy Armor Hit" )elseif ( Player->GetSoundPlaying "Hand to Hand Hit" )elseif ( Player->GetSoundPlaying "Hand to Hand Hit 2" )else    set PCHit to 0endifif ( PCHit )	set playonce to 0	Streammusic "nmmw/endmusic.mp3"	set timer to 1	startscript NMMw_CombatReactivator_Dungeonendif;block is executed when the player enters the cell, or the song finishedif ( playonce == 0 )	set Rand to random 7	if ( Rand == 0 )		Streammusic "nmmw\dngn\dngn1.mp3"		set timer to 103	elseif ( Rand == 1 )		Streammusic "nmmw\dngn\dngn2.mp3"		set timer to 250	elseif ( Rand == 2 )		Streammusic "nmmw\dngn\dngn3.mp3"		set timer to 184	elseif ( Rand == 3 )		Streammusic "nmmw\dngn\dngn4.mp3"		set timer to 186	elseif ( Rand == 4 )		Streammusic "nmmw\dngn\dngn5.mp3"		set timer to 407	elseif ( Rand == 5 )		Streammusic "nmmw\dngn\dngn6.mp3"		set timer to 267	elseif ( Rand == 6 )		Streammusic "nmmw\dngn\dngn7.mp3"		set timer to 279	elseif ( Rand == 7 )		Streammusic "nmmw\dngn\dngn8.mp3"		set timer to 286	endif	set playonce to 1endifif ( playonce == 1 )	set timer to ( timer - getsecondspassed )	if ( timer <= 0 );as the timer is counting down, we need to wait till it is less than 0	set playonce to 0	endif	endifend


Sorry for all the trouble! Thanks for all your patience. :blush:
User avatar
Alex Blacke
 
Posts: 3460
Joined: Sun Feb 18, 2007 10:46 pm

Post » Mon Aug 03, 2015 3:22 pm

I encountered the Infix to postfix error when there were too many elseifs inside an 'if'. try using ifs instead of elseifs like so:

;block is executed when the player enters the cell, or the song finishedif ( playonce == 0 )    set Rand to random 7    if ( Rand == 0 )        Streammusic "nmmw\dngn\dngn1.mp3"        set timer to 103    endif    if ( Rand == 1 )        Streammusic "nmmw\dngn\dngn2.mp3"        set timer to 250    endif    if ( Rand == 2 )        Streammusic "nmmw\dngn\dngn3.mp3"        set timer to 184    endif    if ( Rand == 3 )        Streammusic "nmmw\dngn\dngn4.mp3"        set timer to 186    endif    if ( Rand == 4 )        Streammusic "nmmw\dngn\dngn5.mp3"        set timer to 407    endif    if ( Rand == 5 )        Streammusic "nmmw\dngn\dngn6.mp3"        set timer to 267    endif    if ( Rand == 6 )        Streammusic "nmmw\dngn\dngn7.mp3"        set timer to 279    endif    if ( Rand == 7 )        Streammusic "nmmw\dngn\dngn8.mp3"        set timer to 286    endif    set playonce to 1endif
User avatar
Danny Warner
 
Posts: 3400
Joined: Fri Jun 01, 2007 3:26 am

Post » Tue Aug 04, 2015 2:41 am

There's nowhere near enough elseif's to cause issues here IMO. More likely it's some small inconsistencies like using "/" in some file paths and "\" in others.

Morrowind likes when scripts stay consistent, try this:

Spoiler

begin NMMw_Music_Dungeonshort randshort playOnceshort pcHitfloat timerif ( CellChanged );WARNING: May not work in cases of teleport, only on going through the door	set playOnce to 0	set timer to 1	StreamMusic "nmmw/endmusic.mp3"endifset pcHit to 1if ( Player->GetSoundPlaying "Health Damage" )elseif ( Player->GetSoundPlaying "destruction hit" )elseif ( Player->GetSoundPlaying "frost_hit" )elseif ( Player->GetSoundPlaying "shock hit" )elseif ( Player->GetSoundPlaying "Light Armor Hit" )elseif ( Player->GetSoundPlaying "Medium Armor Hit" )elseif ( Player->GetSoundPlaying "Heavy Armor Hit" )elseif ( Player->GetSoundPlaying "Hand to Hand Hit" )elseif ( Player->GetSoundPlaying "Hand to Hand Hit 2" )else    set pcHit to 0endifif ( pcHit )	set playOnce to 0	set timer to 1	StreamMusic "nmmw/endmusic.mp3"	StartScript NMMw_CombatReactivator_Dungeonendif;block is executed when the player enters the cell, or the song finishedif ( playOnce == 0 )	set rand to Random 7	if ( rand == 0 )		StreamMusic "nmmw/dngn/dngn1.mp3"		set timer to 103	elseif ( rand == 1 )		StreamMusic "nmmw/dngn/dngn2.mp3"		set timer to 250	elseif ( rand == 2 )		StreamMusic "nmmw/dngn/dngn3.mp3"		set timer to 184	elseif ( rand == 3 )		StreamMusic "nmmw/dngn/dngn4.mp3"		set timer to 186	elseif ( rand == 4 )		StreamMusic "nmmw/dngn/dngn5.mp3"		set timer to 407	elseif ( rand == 5 )		StreamMusic "nmmw/dngn/dngn6.mp3"		set timer to 267	elseif ( rand == 6 )		StreamMusic "nmmw/dngn/dngn7.mp3"		set timer to 279	elseif ( rand == 7 )		StreamMusic "nmmw/dngn/dngn8.mp3"		set timer to 286	endif	set playOnce to 1endifif ( playOnce )	set timer to ( timer - GetSecondsPassed )	if ( timer <= 0 );as the timer is counting down, we need to wait till it is less than 0		set playOnce to 0	endifendifend
User avatar
lilmissparty
 
Posts: 3469
Joined: Sun Jul 23, 2006 7:51 pm

Post » Tue Aug 04, 2015 4:28 am

@hollaajith & Greatness7, I tried both your suggested changes, it returned the same error. :(

What's good to know though is I started the combat reactivator script and it didn't return any errors! It probably doesn't work flawlessly either but it'll do in a pinch. :P

User avatar
Sista Sila
 
Posts: 3381
Joined: Fri Mar 30, 2007 12:25 pm

Post » Tue Aug 04, 2015 4:33 am

Make sure your music paths are correct. You could try changing the "set timer to 103"(etc) parts to "set timer to 103.0" as timer is a float and 103 is an integer. I don't think that would be the issue either though.

I tested the script on my own install (replacing the startscript/musics with alternatives) and didn't have any error. Your best bet would probably be just to comment out one block at a time and retest for the error in each instance.

User avatar
Eileen Collinson
 
Posts: 3208
Joined: Thu Dec 28, 2006 2:42 am

Post » Tue Aug 04, 2015 1:23 am

Ok, I fixed the script. I had to add "== 1.00" to all the instances of getsoundplaying, since the game didn't know what the script was trying to do otherwise.

Unfortunately, without a proper combat detection command, the detection of combat is wholly broken and often the dungeon music will just restart immediately after combat triggers, or just decide to start again in the middle of combat. Also, "CellChanged == 1", as noted in the scripts comment, is unreliable and often fails to stop the music.

Question, though. Would there be a way for the script to detect if the tagged activator is in the cell? If so, I could have the script be checking for the activator, and if it stopped being there the music would stop. This would work quite well for regional music, as every cell tagged in the playlist would have an activator, but as soon as you entered a cell without it, the music would change.

User avatar
Jesus Lopez
 
Posts: 3508
Joined: Thu Aug 16, 2007 10:16 pm

Post » Mon Aug 03, 2015 4:53 pm

I'm not sure why the GetSoundPlaying functions would need a '== 1.00'. To the scripting engine "if ( x )" is basically the same thing as "if ( x != 0 )", but if changing it worked for you. :shrug:

For the music stream being broken, be sure the logic of your script is correct. Make sure you understand what is happening on each step and then you should know where the problem arises. From looking at them it seems when the PC is hit it will stream "endmusic", which I assume is a 1 second silent track used to stop the current music stream. After that it doesn't actually use a StopScript command though, so it will continue on through the script and try to play the dungeon music as shown in the 'if ( playOnce == 0 )' block. That explains why the music continues to play after combat begins. You may want to change this section as so:

if ( pcHit )    set playOnce to 0    set timer to 1    StreamMusic "nmmw/endmusic.mp3"    StartScript NMMw_CombatReactivator_Dungeon    StopScript NMMw_Music_Dungeon    returnendif

The should make your music stop, but then you need to be sure that what's happening in the reactivator script makes sense as well.

if ( InCombat == 0 )    returnelseif ( ScriptRunning "NMMw_Music_Dungeon" == 0 )    StartScript NMMw_Music_Dungeonendif

This section on your second script isn't doing what I believe you want it to do. It checks if the player has a combat target and if not it does nothing, but if so it restarts your original script.

That means at the moment your scripts sort of play out like this:

1. Player gets hit
2. Music stops and 2nd script starts
3. The 2nd scripts sees the player has no combat target
4. So it (the 2nd script) restarts the first script
5. Keeps repeating from step 1 in a loop

Remember "InCombat" will always be 0 until the player actually attacks something, so it's not really a reliable way to detect when combat ends.

Here's how I would rewrite the whole thing, also combining both scripts into one as I don't really see any reason to split the job into two. It's hard for me to actually test this as I don't have all the details of your mod nor the actual music files, but I think it should work for the most part. There will still be some minor issues detecting when combat ends, but the only way I can see around that would be to store all NPC references in arrays and constantly monitor each one to see when they leave combat, which wouldn't be very FPS friendly. I included lots of comments and messageboxes to try and explain whats going on.

Spoiler

begin NMMw_Music_Dungeon; State Variablesfloat timershort pcHitshort pcCombatshort prevTargshort scanRefsshort randTrack; MWSE Variableslong pcReflong pcTarglong npcReflong npcTargfloat npcTemp    ; When player enters the cell, end the current music and queue the next    ; track to run after a 1 second timer.if ( CellChanged )    MessageBox "Cell Changed! Ending music and setting timer to 1s"    StreamMusic "nmmw/endmusic.mp3"    set timer to 1endif    ; Continuously detect for when player gets hit in combat.if ( pcTarg == 0 )    set pcHit to 1    if ( Player->GetSoundPlaying "Health Damage" )    elseif ( Player->GetSoundPlaying "destruction hit" )    elseif ( Player->GetSoundPlaying "frost_hit" )    elseif ( Player->GetSoundPlaying "shock hit" )    elseif ( Player->GetSoundPlaying "Light Armor Hit" )    elseif ( Player->GetSoundPlaying "Medium Armor Hit" )    elseif ( Player->GetSoundPlaying "Heavy Armor Hit" )    elseif ( Player->GetSoundPlaying "Hand to Hand Hit" )    elseif ( Player->GetSoundPlaying "Hand to Hand Hit 2" )    else        set pcHit to 0    endifendif    ; If the player does get hit whilst he wasn't already in combat, end the    ; current music and queue the next check to run after a 15s timer. If he    ; was already in combat however, we don't need to restart the battle music,    ; so in that case only restart the timer back to 15s.if ( pcHit )    if ( pcCombat )        set timer to 15    else        MessageBox "Player has been attacked from outside of combat! Ending music and setting timer."        set pcCombat to 1        StreamMusic "nmmw/endmusic.mp3"        set timer to 15    endif    returnendif    ; Continuously detect for when the player attacks someone else in combat.setx pcRef to xGetRef "Player"setx pcTarg to pcRef->xGetCombat    ; If the player attacks a target from outside of combat, end the current    ; music and prevent the rest of the script from processing so long as the    ; player still has said combat target.ifx ( pcTarg )    set prevTarg to 1    if ( pcCombat == 0 )        MessageBox "Player attacked a target from outside of combat! Ending music and setting timer."        set pcCombat to 1        StreamMusic "nmmw/endmusic.mp3"    endif    returnendif    ; If the PC previously had a target, but no longer has one, we can    ; assume he killed it. There may have been more than one NPC in combat    ; with him though, so to be sure combat is over we must scan them all.ifx ( prevTarg )    set scanRefs to 5    whilex ( scanRefs )        set scanRefs to ( scanRefs - 1 )        ifx ( npcRef )            setx npcRef to xNextRef npcRef        else            setx npcRef to xFirstNPC        endif        ifx ( npcRef )                ; If the NPC is dead then we needn't do any scan for it.            xSetRef npcRef            set npcTemp to GetHealth            if ( npcTemp <= 0 )                return            endif                ; We don't need to scan NPCs that are very far away either.            xSetRef npcRef            set npcTemp to ( GetDistance Player )            if ( npcTemp > 7000 )                return            endif                ; For everything else, find out if it's in combat or not.            setx npcTarg to npcRef->xGetCombat            if ( npcTarg )                MessageBox "Other NPCs are still in combat! Resetting timer to 15s."                set prevTarg to 0                set npcRef to 0                set timer to 15            endif            return        endif        set scanRefs to 0    endwhile    MessageBox "Player target dead and no other NPCs in combat! Stopping timer."    set prevTarg to 0    set timer to 0endif;    Don't play any new music whilst the timer is still active.if ( timer > 0 )    set timer to ( timer - GetSecondsPassed )    returnendif;    If the player doesn't have a target and hasn't been hit within the last 15;    seconds, we can assume combat has ended.set pcCombat to 0;    Once the timer has finished and combat is over, play a random music track.MessageBox "Timer Finished! Starting random dungeon track."set randTrack to Random 7if ( randTrack == 0 )    StreamMusic "nmmw/dngn/dngn1.mp3"    set timer to 103elseif ( randTrack == 1 )    StreamMusic "nmmw/dngn/dngn2.mp3"    set timer to 250elseif ( randTrack == 2 )    StreamMusic "nmmw/dngn/dngn3.mp3"    set timer to 184elseif ( randTrack == 3 )    StreamMusic "nmmw/dngn/dngn4.mp3"    set timer to 186elseif ( randTrack == 4 )    StreamMusic "nmmw/dngn/dngn5.mp3"    set timer to 407elseif ( randTrack == 5 )    StreamMusic "nmmw/dngn/dngn6.mp3"    set timer to 267elseif ( randTrack == 6 )    StreamMusic "nmmw/dngn/dngn7.mp3"    set timer to 279elseif ( randTrack == 7 )    StreamMusic "nmmw/dngn/dngn8.mp3"    set timer to 286endifend



If for some reason it doesn't work you could PM the esp and I can take a better look.

User avatar
patricia kris
 
Posts: 3348
Joined: Tue Feb 13, 2007 5:49 am


Return to III - Morrowind

cron