Go Back   RunUO - Ultima Online Emulation > RunUO > Utility Support > Ultima SDK

Ultima SDK Support for the Ultima SDK.

Reply
 
Thread Tools Display Modes
Old 02-27-2007, 09:07 AM   #1 (permalink)
Forum Expert
 
Join Date: Oct 2002
Age: 45
Posts: 4,304
Default Changing path SDK uses for MUL files

I want to create a utility that will compare the contents between 2 sets of MUL files. The SDK gets the UO installation path from the registry,

Is it possible to dynamically change the directory the SDK uses to read the MUL files via code?
HellRazor is online now   Reply With Quote
Old 02-27-2007, 09:23 AM   #2 (permalink)
Forum Expert
 
Join Date: May 2005
Age: 29
Posts: 949
Default

Didn't ever really use it, but the Mulpatcher has this feature already for the Art files :-)
Irian is offline   Reply With Quote
Old 02-27-2007, 11:32 AM   #3 (permalink)
Forum Expert
 
Join Date: Oct 2002
Age: 45
Posts: 4,304
Default

I know, but that doesn't answer my question.
HellRazor is online now   Reply With Quote
Old 02-27-2007, 11:51 AM   #4 (permalink)
Master of the Internet
 
Join Date: Oct 2005
Age: 44
Posts: 6,283
Default

Well, if the SDK has the capability to read mul files, I would expect that the reading routines are separate from the path definition code (however, I could easily be wrong since I've never looked at it). It should be possible to simply specify a path in the code, then read the muls.
__________________
Why is it that I'm never as smart as I thought I was yesterday?
My vast knowledge is only surpassed by my infinite ignorance.
<TheOutkastDev> i might have to hire an assassin to killl mal so that i can jump in front of the bullet and piss on him
Malaperth is offline   Reply With Quote
Old 02-27-2007, 12:59 PM   #5 (permalink)
Forum Expert
 
Join Date: Oct 2002
Age: 45
Posts: 4,304
Default

Currently the SDK gets the UO path from the registry and uses that for its MUL access.

What I'm not sure about is whether or not there is a way to change the path it reads from via code, or if its possible to read from 2 seperate paths.
HellRazor is online now   Reply With Quote
Old 02-27-2007, 01:06 PM   #6 (permalink)
Master of the Internet
 
Join Date: Oct 2005
Age: 44
Posts: 6,283
Default

Right, but does it do it all in one method? If not, you should be able to call the code that does things with the mul files directly instead of starting from the point where it finds the path.
__________________
Why is it that I'm never as smart as I thought I was yesterday?
My vast knowledge is only surpassed by my infinite ignorance.
<TheOutkastDev> i might have to hire an assassin to killl mal so that i can jump in front of the bullet and piss on him
Malaperth is offline   Reply With Quote
Old 02-27-2007, 01:43 PM   #7 (permalink)
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Location: In your mom
Age: 27
Posts: 4,760
Default

You'd have to code that all yourself
__________________
Jeff Boulanger
ConnectUO - Core Developer

Want to help make ConnectUO better? Click here to submit your ideas/requests
Use your talent to compete against other community members in RunUO hosted coding competitions

If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team.


Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO
Jeff is offline   Reply With Quote
Old 02-27-2007, 04:20 PM   #8 (permalink)
Administrator
 
Zippy's Avatar
 
Join Date: Aug 2002
Location: Baltimore, MD
Age: 25
Posts: 4,832
Default

In what universe would it *not* be possible to change what path it is reading by editing the code which reads the files?
__________________
Zippy, Razor Creator and RunUO Core Developer
The RunUO Software Team

"Intuition, like a flash of lightning, lasts only for a second. It generally comes when one is tormented by a difficult decipherment and when one reviews in his mind the fruitless experiments already tried. Suddenly the light breaks through and one finds after a few minutes what previous days of labor were unable to reveal."
~The Cryptonomicon

Zippy is offline   Reply With Quote
Old 02-27-2007, 05:44 PM   #9 (permalink)
Forum Expert
 
Join Date: Oct 2002
Age: 45
Posts: 4,304
Default

I was hoping that it might be possible from within the program without making changes to the DLL itself.
HellRazor is online now   Reply With Quote
Old 02-27-2007, 05:45 PM   #10 (permalink)
Master of the Internet
 
Join Date: Oct 2005
Age: 44
Posts: 6,283
Default

It seems improbable to me that there are no methods to be able to specify a path from which to read files from.
__________________
Why is it that I'm never as smart as I thought I was yesterday?
My vast knowledge is only surpassed by my infinite ignorance.
<TheOutkastDev> i might have to hire an assassin to killl mal so that i can jump in front of the bullet and piss on him
Malaperth is offline   Reply With Quote
Old 02-27-2007, 06:37 PM   #11 (permalink)
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Location: In your mom
Age: 27
Posts: 4,760
Default

I modified them myself, for my project. All i had to change was the contructor. Where uofolder is, just make it whatever folder you want the idx and mul file to be in.

Code:
public FileIndex(string uoFolder, string idxFile, string mulFile, int length)
		{
			m_Index = new Entry3D[length];

			string idxPath = Path.Combine(uoFolder, idxFile);
			string mulPath = Path.Combine(uoFolder, mulFile);

			if( idxPath != null && mulPath != null )
			{
				using( FileStream index = new FileStream(idxPath, FileMode.Open, FileAccess.Read, FileShare.Read) )
				{
					BinaryReader bin = new BinaryReader(index);
					m_Stream = new FileStream(mulPath, FileMode.Open, FileAccess.Read, FileShare.Read);

					int count = (int)( index.Length / 12 );

					for( int i = 0; i < count && i < length; ++i )
					{
						m_Index[i].lookup = bin.ReadInt32();
						m_Index[i].length = bin.ReadInt32();
						m_Index[i].extra = bin.ReadInt32();
					}

					for( int i = count; i < length; ++i )
					{
						m_Index[i].lookup = -1;
						m_Index[i].length = -1;
						m_Index[i].extra = -1;
					}
				}
			}
		}
__________________
Jeff Boulanger
ConnectUO - Core Developer

Want to help make ConnectUO better? Click here to submit your ideas/requests
Use your talent to compete against other community members in RunUO hosted coding competitions

If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team.


Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO
Jeff is offline   Reply With Quote
Old 02-28-2007, 02:00 AM   #12 (permalink)
Forum Expert
 
Join Date: Oct 2002
Age: 45
Posts: 4,304
Default

Awesome, I'll try this out. Thanks Jeff.
HellRazor is online now   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5