Archaaz

Member
I recently added quite a few new music tracks, many for dungeons, without considering that much of those would mostly not be played due to constantly being in warmode. I attempted to edit the OnWarmodeChanged method in PlayerMobile to trigger a specific song when the player mobile is in a specific dungeon region. This worked briefly in warmode, but then the (I assume) client overrode it and it played the combat music. It did work when reverting to peace mode, and played the selected track.

I realize I can swamp out the combat tracks, but I was hoping for something more extensive. Has anyone had any luck circumventing this? I doubt it is possible, but though I would check. Thanks in advance!
 
I have looked in Region, at the OnRegionChange method, and Mobile on the WarMode ans OnWarModeChanged method. I also tried forcing it to send music in OnEnter in DungeonRegion, and doing the same in OnWarModeChanged in PlayerMobile, including setting up a timer delay to call a method to do this:

Code:
public override void OnWarmodeChanged()
		{
			if ( !Warmode )
				Timer.DelayCall( TimeSpan.FromSeconds( 10 ), new TimerCallback( RecoverAmmo ) );

			if ( Warmode )
				Timer.DelayCall( TimeSpan.FromSeconds( 65 ), new TimerCallback( DungeonMusic ) );
		}

		public void DungeonMusic()
		{

			this.Send(PlayMusic.GetInstance(this.Region.Music));
			

		}

Both this method and sending on the OnEnter method in DungeonRegion work one time, but do not work again after going back into warmode. I currently have the combat music set to not loop, so it runs through it once and then stops and there is just silence therafter. As long as the mobile is in warmode, entering a new region does not trigger that region's music. it is as if it does not recognize it. Upon leaving warmode, the music for that region starts again after a brief delay. I realize that this is normal, and that I am either overlooking something (or missing it or misunderstanding it) or that maybe it is just not possible to forcibly send music (consistently) while in warmode, including the usual sending of music when changing regions.
 
I would be interested in getting around this little issue too.

Have you tried sending an "invalid" music packet before sending your "override" packet?
It may help to reset the client's media player this way.
* Whenever war-mode changes to true, send the invalid music packet followed by your desired music packet.
 
I would be interested in getting around this little issue too.

Have you tried sending an "invalid" music packet before sending your "override" packet?
It may help to reset the client's media player this way.
* Whenever war-mode changes to true, send the invalid music packet followed by your desired music packet.


What do you mean by invalid? Like a track that does not actually exist?

One thing I did notice is that teleporting outside the region in warmode, and then back in did seem to reset the music, though I need to test this more.
[doublepost=1524630169][/doublepost]I am not sure about sending an invalid packet. I seems that the music is easy to change after initial log in, whatever method, either on region change, (with or without the code, walking into it or teleporting) or with the onwarmode change I made. After that it seems hardwired somehow to play one of the three combat songs if in combat mode, and to revert to the current region music when changing to peace mode.
 
Last edited:
There should be a MusicName.Invalid you can use.

I will give it a shot, though I suspect that it has something to do with the client, and sending the Warmode packet. I have also tried a few other methods, including Dawn's Music box and another system I have set up to play music on double-clicking an item. These do not work when in Warmode, but will revert to the music that was triggered by the item upon changing from warmode to peace.
 
I am pretty sure you could just go to your UO game's music folder and replace the music files and as long as you have the correct names it will play those instead no scripting needed.
 
The music folder is in the ultima online client folder. You will see a folder named "GDF" and one named "music." Inside the "music" folder should be a folder named "Digital." All the mp3 tracks are stored here. There is also a Config txt file. This file is a numerical list of the names of the music tracks.
 
So basically I need to set the mp3 file in the digital folder and then reference the song where else? I would just like to change the opening song at the moment.
 
I believe track 78 is the opening music track, at least in the version of the client I am using. I am not sure if it has changed in later versions. You would need to add the new mp3. You can either change the name of the mp3 file to match the name used in the Config file, and replace the existing mp3 with the new file, or you can change the name used in the config file under track 78 to the name of the new track you add.

Essentially, you can replace every mp3 in the Digital folder and change the names in the Config to match the new mp3 names, or you can change all of the names of the mp3s you wish to add to those of existing mp3s and replace them. The names of whatever mp3s you use must match those in the Config file.

If you wish to have the track loop, simply add ",loop" after the track name in Config. For example, "24 Yew,loop."

If you open up your Regions.xml file in the ServUO server, you will see how various Regions are set to trigger specific music tracks when a character enters the region.

Code:
   <region type="TrinsicRegion" priority="50" name="Trinsic">
      <rect x="1856" y="2636" width="75" height="28" />
      <rect x="1816" y="2664" width="283" height="231" />
      <rect x="2099" y="2782" width="18" height="25" />
      <rect x="1970" y="2895" width="47" height="32" />
      <rect x="1796" y="2696" width="20" height="67" zmin="0" />
      <rect x="1800" y="2796" width="16" height="52" zmin="0" />
      <go x="1867" y="2780" z="0" />
      <music name="21" />
      <region>

The above triggers track 21, which is set to Trinsic in the Config file: "21 Trinsic."
 
Thanks! I really appreciate the help.So all I did was rename my file loginloop.mp3 and replaced the current one and its worked perfectly. now my login sounds like it used to when I first started playing in 98.
Post automatically merged:

Luckily I just made a backup of the server because my account some how got delete?? this had happen like 3 times.... what makes it all of sudden delete my admin account?
 
Last edited:

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back