Go Back   RunUO - Ultima Online Emulation > RunUO > Custom Script Releases

Custom Script Releases This forum is where you can release your custom scripts for other users to use.

Please note: By releasing your scripts here you are submitting them to the public and as such agree to make them public domain. The RunUO Team has made its software GPL for you to use and enjoy you should do the same for anything based off of RunUO.

Reply
 
Thread Tools Display Modes
Old 12-05-2006, 08:45 AM   #1 (permalink)
Forum Expert
 
Vorspire's Avatar
 
Join Date: Jan 2005
Location: Newcastle, United Kingdom
Age: 21
Posts: 2,298
Send a message via ICQ to Vorspire Send a message via MSN to Vorspire Send a message via Skype™ to Vorspire
Cool [RunUO 1.0 Final] Squishy's Extended Localizer - Package

Key Words:// ObjectPropertyList, OPL, Wrapper, Packets, Localizer, Extended

Supported Versions:

* RunUO 1.0 Final
* RunUO 2.0 RC1
* RunUO 2.0 RC2 (?)


Here we go, another instance of "Impossible...? pfft". How many people have claimed that something is "impossible" with RunUO? Well, here is a development of a good friend, Dominik Seifert, aka, Squishy.

When I posted in the Script Support section asking for help with converting ObjectPropertyLists to a string format, that could easily be used in Gumps, I recieved negative karma from an un-named source, because I was positive that it was completely possible to do this, and would not accept that it was impossible...

I was talking to Dominik and I mentioned the subject, since that talk, he strived to prove the fact that nothing was impossible. Even though it took a lot of trial and error, as everything does, we have the final product...

So, without further adue, I give you;

Squishy's Extended Localizer - Package:
Quote:
Originally Posted by ReadMe.txt

squishy's extended Localizer - Package:

Enables you to get localized string-representation of message codes and
retrieve string-representation of ObjectPropertyLists.
See OPLWrapperTest.cs for examples.


################################################## #############################################
Files:

Localizer.cs Utility class that provides methods to translate
message-codes (with or without parameters) into readable strings

OPLWrapper.cs Wraps an ObjectPropertyList and provides a method to retrieve
all its entries as readable strings

OPLWrapperTest.cs Provides an example on how to use the OPLWrapper (its really easy anyway)

GoodPacketReader.cs Modified version of PacketReader: Original PacketReader was missing
reading unsafe unicode strings of fixed length

IndependentStringList.cs Modified version of Ultima SDK's StringList:
Does not require an UO installation

Also required are the Cliloc.* - files of any language you want to support.
If you do not have UO installed, copy them next to your other UO Data files or into
this folder: Data/UO Files



################################################## #############################################
Instructions:

1. Copy this directory to your script directory
2. Copy the Ultima.dll from the Ultima SDK to your data directory and add
it to the Assemblies.cfg (Only needed for StringEntry-class in IndependentStringList)
3. Done. Good luck!



################################################## #############################################
Remarks:

Feel free to embedd the Localizer into the Ultima SDK (please don't remove my credits).
Also in order to keep it consistent, you might want to replace all occurences of
IndependentStringList back into StringList:
You are welcome to do sufficient changes or let Vorspire know if you want me to do so.

Also do not believe that there is anything impossible. Some things might not be
worth the effort or are simply too resource-intensive for continuing use.

However you can do a lot of fine things with RunUO; its really a great project
which meanwhile (imo) is one of the main factors why UO is still alive.



Dominik Seifert
---
Criticism should not be the cause of anger.
Attached Files
File Type: zip Localize-RunUO-1.0-Final.zip (7.3 KB, 74 views)
File Type: zip Localize-RunUO-2.0-RC2.zip (7.3 KB, 98 views)
File Type: zip UO Software Development Kit.zip (19.9 KB, 75 views)
__________________

WWW.RPK-UO.COM - The WoW-UO Cross-Over Shard

Last edited by Admin Vorspire; 12-06-2006 at 09:59 PM. Reason: Update
Vorspire is offline   Reply With Quote
Old 12-05-2006, 08:55 AM   #2 (permalink)
Forum Expert
 
Vorspire's Avatar
 
Join Date: Jan 2005
Location: Newcastle, United Kingdom
Age: 21
Posts: 2,298
Send a message via ICQ to Vorspire Send a message via MSN to Vorspire Send a message via Skype™ to Vorspire
Question Faqs & Examples

F.A.Q.

Quote:
Originally Posted by Kenko
Does RC2 exist already?
A: "Apparently, it's the latest SVN.. but either way, it will support it.." (?)

-------------*****-------------

Quote:
Originally Posted by Liacs
erm... what is Ultima???

Code:
using Ultima;
it doesn't seem to know it...

Code:
+ AAA CUSTOM/Localize-RunUO-2.0-RC2/Localize/Localizer.cs:
CS0246: Line 6: The type or namespace name 'Ultima' could not be found (are
you missing a using directive or an assembly reference?)
*sniff*
A: "You need Ultima.dll from the UO SDK (Ultima Online Software Development Kit)"

-------------*****-------------

Quote:
Originally Posted by Kenko
Code:
/// <summary>
	/// Needed to copy PacketReader and add one simple method because for some very odd reason, 
	/// the original does not have ReadUnicodeStringLE(int fixedLength) (save values cannot be used because
	/// of the tab-seperator (\t)).
	/// RunUO Team, what's wrong?
	/// 
	/// Author: squishy (Dominik Seifert) 05/12/2006
	/// </summary>
Why don't you inherit PacketReader instead of copying it?
A:
Quote:
Originally Posted by Dominik Seifert
德明 says:
because the fields are private and thus not accessible in my custom method
-------------*****-------------

Quote:
Originally Posted by Pyro-Tech
so...what does this actually do
A:
Quote:
Originally Posted by ReadMe.txt
Enables you to get localized string-representation of message codes and
retrieve string-representation of ObjectPropertyLists.
See OPLWrapperTest.cs for examples.
He is talking about the lists you get when you hover over items or mobiles with the cursor)...
Quote:
Originally Posted by Admin Vorspire
OK, you can call any object's properties and display them directly in a gump.. for one example... without having to reference EVERY property on the object one by one in the script.
-------------*****-------------

Quote:
Originally Posted by Sorcerer
What does this exactly do? Localized messages? As in the localized messages from the uo client? Does it allow you to send your own?
A:
1)
See Above
2) The messages contained within the Cliloc files in your Ultima Online directory/folder. For english it gets the right clilocs dependant on your language. English is "Cliloc.enu".
3) Yes, it will get whatever custom Object Property Lists you have already set, since it gets the Packet information, then uses the right cliloc number (Example: list.Add( 3000103, arg ) in any Item/Mobile's "GetProperties()" or "AddNameList()" overrided method. - This make this package totally dynamic, and you shouldn't ever have to edit the source code


------------------------------

Examples of usage...(soon)
__________________

WWW.RPK-UO.COM - The WoW-UO Cross-Over Shard

Last edited by Admin Vorspire; 12-06-2006 at 10:25 AM. Reason: Update
Vorspire is offline   Reply With Quote
Old 12-05-2006, 09:05 AM   #3 (permalink)
Forum Master
 
Joeku's Avatar
 
Join Date: Feb 2005
Location: ShatteredSosaria.com
Posts: 9,260
Default

Sweet. Thanks man.
Joeku is offline   Reply With Quote
Old 12-05-2006, 09:36 AM   #4 (permalink)
Forum Expert
 
Kenko's Avatar
 
Join Date: Dec 2004
Location: Land of the Poor
Posts: 1,828
Send a message via MSN to Kenko
Default

Awww

Invalid Attachment specified. If you followed a valid link, please notify the administrator

Kenko is offline   Reply With Quote
Old 12-05-2006, 09:37 AM   #5 (permalink)
Forum Expert
 
Vorspire's Avatar
 
Join Date: Jan 2005
Location: Newcastle, United Kingdom
Age: 21
Posts: 2,298
Send a message via ICQ to Vorspire Send a message via MSN to Vorspire Send a message via Skype™ to Vorspire
Default

I was editing the main post, with updated version supports. try now
__________________

WWW.RPK-UO.COM - The WoW-UO Cross-Over Shard
Vorspire is offline   Reply With Quote
Old 12-05-2006, 09:37 AM   #6 (permalink)
Forum Master
 
Joeku's Avatar
 
Join Date: Feb 2005
Location: ShatteredSosaria.com
Posts: 9,260
Default

He just changed the attachments, try again.

P.S. @Vorspire: you may want to change those to .zip archives; some people don't have WinRAR (stupid school computers don't; I wanted to look at the code while I was here )
Joeku is offline   Reply With Quote
Old 12-05-2006, 09:41 AM   #7 (permalink)
Forum Expert
 
Vorspire's Avatar
 
Join Date: Jan 2005
Location: Newcastle, United Kingdom
Age: 21
Posts: 2,298
Send a message via ICQ to Vorspire Send a message via MSN to Vorspire Send a message via Skype™ to Vorspire
Default

Just for you...
__________________

WWW.RPK-UO.COM - The WoW-UO Cross-Over Shard
Vorspire is offline   Reply With Quote
Old 12-05-2006, 09:41 AM   #8 (permalink)
Forum Expert
 
Kenko's Avatar
 
Join Date: Dec 2004
Location: Land of the Poor
Posts: 1,828
Send a message via MSN to Kenko
Default

Does RC2 exist already?
Kenko is offline   Reply With Quote
Old 12-05-2006, 09:42 AM   #9 (permalink)
Forum Expert
 
Vorspire's Avatar
 
Join Date: Jan 2005
Location: Newcastle, United Kingdom
Age: 21
Posts: 2,298
Send a message via ICQ to Vorspire Send a message via MSN to Vorspire Send a message via Skype™ to Vorspire
Default

Apparently, it's the latest SVN.. but either way, it will support it..
__________________

WWW.RPK-UO.COM - The WoW-UO Cross-Over Shard
Vorspire is offline   Reply With Quote
Old 12-05-2006, 09:52 AM   #10 (permalink)
Forum Expert
 
Kenko's Avatar
 
Join Date: Dec 2004
Location: Land of the Poor
Posts: 1,828
Send a message via MSN to Kenko
Default

I thought it was still RC1
Kenko is offline   Reply With Quote
Old 12-05-2006, 11:51 AM   #11 (permalink)
Forum Expert
 
kmwill23's Avatar
 
Join Date: Feb 2003
Location: Phoenix, Arizona
Age: 31
Posts: 1,118
Send a message via MSN to kmwill23
Default

I like it when people do impossible things =) Thanks for your perseverance!
__________________
"Morality is a lonely path." - Me
kmwill23 is offline   Reply With Quote
Old 12-05-2006, 02:22 PM   #12 (permalink)
Forum Expert
 
Liacs's Avatar
 
Join Date: Mar 2004
Location: Belgium / Germany
Age: 31
Posts: 1,036
Send a message via MSN to Liacs
Default

erm... what is Ultima???

Code:
using Ultima;
it doesn't seem to know it...

Quote:
+ AAA CUSTOM/Localize-RunUO-2.0-RC2/Localize/Localizer.cs:
CS0246: Line 6: The type or namespace name 'Ultima' could not be found (are
you missing a using directive or an assembly reference?)
*sniff*
__________________
;)My C# Bookshelf (carpented by Soultaker);)

BTW: Please ask questions in the adequat forum and not on a private message! Otherwise nobody can learn from it!
Liacs is offline   Reply With Quote
Old 12-05-2006, 02:32 PM   #13 (permalink)
Forum Expert
 
Kenko's Avatar
 
Join Date: Dec 2004
Location: Land of the Poor
Posts: 1,828
Send a message via MSN to Kenko
Default

Code:
	/// <summary>
	/// Needed to copy PacketReader and add one simple method because for some very odd reason, 
	/// the original does not have ReadUnicodeStringLE(int fixedLength) (save values cannot be used because
	/// of the tab-seperator (\t)).
	/// RunUO Team, what's wrong?
	/// 
	/// Author: squishy (Dominik Seifert) 05/12/2006
	/// </summary>
Why don't you inherit PacketReader instead of copying it?
Kenko is offline   Reply With Quote
Old 12-05-2006, 03:41 PM   #14 (permalink)
Forum Expert
 
Vorspire's Avatar
 
Join Date: Jan 2005
Location: Newcastle, United Kingdom
Age: 21
Posts: 2,298
Send a message via ICQ to Vorspire Send a message via MSN to Vorspire Send a message via Skype™ to Vorspire
Default

Because, if you read everything properly, including the readme, it explains there is no overridable function to use.

As for "cannot find Ultima" - you too, need to read the readme... lol, doesn't anyone read that these days?

You need Ultima.dll from the UO SDK (Ultima Online Software Development Kit)
__________________

WWW.RPK-UO.COM - The WoW-UO Cross-Over Shard
Vorspire is offline   Reply With Quote
Old 12-05-2006, 04:09 PM   #15 (permalink)
Forum Expert
 
Liacs's Avatar
 
Join Date: Mar 2004
Location: Belgium / Germany
Age: 31
Posts: 1,036
Send a message via MSN to Liacs
Default

guess I didn't understand it! I read it! really! *blushes*

I think I will look pretty stupid, but I don't care: What is the UO SDK? (don't give me the longterm, that I read!) and where to find it?
__________________
;)My C# Bookshelf (carpented by Soultaker);)

BTW: Please ask questions in the adequat forum and not on a private message! Otherwise nobody can learn from it!

Last edited by Liacs; 12-05-2006 at 04:14 PM.
Liacs is offline   Reply With Quote
Old 12-05-2006, 04:24 PM   #16 (permalink)
Forum Novice
 
Join Date: Aug 2004
Location: :P
Age: 21
Posts: 138
Send a message via AIM to TheNorthStar
Default

Oh man, I can't believe I never thought about doing this. What a great idea, this is exactly what I've needed for like a year now. I was told this was impossible as well.

Thanks so much.
__________________
Make music online with Splice!
TheNorthStar is offline   Reply With Quote
Old 12-05-2006, 04:25 PM   #17 (permalink)
Forum Expert
 
Kenko's Avatar
 
Join Date: Dec 2004
Location: Land of the Poor
Posts: 1,828
Send a message via MSN to Kenko
Default

Quote:
Originally Posted by Admin Vorspire
Because, if you read everything properly, including the readme, it explains there is no overridable function to use.

As for "cannot find Ultima" - you too, need to read the readme... lol, doesn't anyone read that these days?

You need Ultima.dll from the UO SDK (Ultima Online Software Development Kit)
I didn't tell you to override any function, but maybe a class like this:
Code:
using System;
using System.Text;
using System.IO;

namespace Server.Network {
	/// <summary>
	/// Needed to copy PacketReader and add one simple method because for some very odd reason, 
	/// the original does not have ReadUnicodeStringLE(int fixedLength) (save values cannot be used because
	/// of the tab-seperator (\t)).
	/// RunUO Team, what's wrong?
	/// 
	/// Author: squishy (Dominik Seifert) 05/12/2006
	/// </summary>
	public class GoodPacketReader : PacketReader {
		public GoodPacketReader(byte[] data, bool fixedSize) : base(
                              data, fixedSize ) { }

		public string ReadUnicodeStringLE() {
			return ReadUnicodeStringLE(m_Size);
		}

		public string ReadUnicodeStringLE(int fixedLength) {
			int bound = m_Index + (fixedLength << 1);
			int end = bound;

			if (bound > m_Size)
				bound = m_Size;

			StringBuilder sb = new StringBuilder();

			int c;

			while ((m_Index + 1) < bound && (c = (m_Data[m_Index++] | (m_Data[m_Index++] << 8))) != 0) {
				sb.Append((char)c);
			}

			m_Index = end;

			return sb.ToString();
		}

		public string ReadUnicodeStringLESafe(int fixedLength) {
			int bound = m_Index + (fixedLength << 1);
			int end = bound;

			if (bound > m_Size)
				bound = m_Size;

			StringBuilder sb = new StringBuilder();

			int c;

			while ((m_Index + 1) < bound && (c = (m_Data[m_Index++] | (m_Data[m_Index++] << 8))) != 0) {
				if (IsSafeChar(c))
					sb.Append((char)c);
			}

			m_Index = end;

			return sb.ToString();
		}

		public string ReadUnicodeStringLESafe() {
			StringBuilder sb = new StringBuilder();

			int c;

			while ((m_Index + 1) < m_Size && (c = (m_Data[m_Index++] | (m_Data[m_Index++] << 8))) != 0) {
				if (IsSafeChar(c))
					sb.Append((char)c);
			}

			return sb.ToString();
		}
Give it a try...
Kenko is offline   Reply With Quote
Old 12-05-2006, 04:33 PM   #18 (permalink)
Forum Expert
 
Vorspire's Avatar
 
Join Date: Jan 2005
Location: Newcastle, United Kingdom
Age: 21
Posts: 2,298
Send a message via ICQ to Vorspire Send a message via MSN to Vorspire Send a message via Skype™ to Vorspire
Default

Waht would be the point? It works as it is. I am not going to modify Dominik's code, just because you want your say :/

Sorry...

If you want to do that, and test it yourself.. feel free.
__________________

WWW.RPK-UO.COM - The WoW-UO Cross-Over Shard
Vorspire is offline   Reply With Quote
Old 12-05-2006, 04:43 PM   #19 (permalink)
Forum Expert
 
Kenko's Avatar
 
Join Date: Dec 2004
Location: Land of the Poor
Posts: 1,828
Send a message via MSN to Kenko
Default

The point would be performance gains, I thought you where that guy called "Dominik", and I was just trying to make your code more steady, thank you for your love words.
Kenko is offline   Reply With Quote
Old 12-05-2006, 05:18 PM   #20 (permalink)
Forum Expert
 
Vorspire's Avatar
 
Join Date: Jan 2005
Location: Newcastle, United Kingdom
Age: 21
Posts: 2,298
Send a message via ICQ to Vorspire Send a message via MSN to Vorspire Send a message via Skype™ to Vorspire
Default

Wasn't trying to offend, but if you read it properly, it says
Quote:
You are welcome to do sufficient changes or let Vorspire know if you want me to do so.
So how can you get me mixed up with him
__________________

WWW.RPK-UO.COM - The WoW-UO Cross-Over Shard
Vorspire is offline   Reply With Quote
Old 12-05-2006, 05:21 PM   #21 (permalink)
Forum Expert
 
Pyro-Tech's Avatar
 
Join Date: Oct 2003
Location: Carbondale, IL
Age: 24
Posts: 1,805
Send a message via MSN to Pyro-Tech
Default

so...what does this actually do
__________________

Pyro-Tech is offline   Reply With Quote
Old 12-05-2006, 08:38 PM   #22 (permalink)
Forum Newbie
 
Join Date: Feb 2006
Posts: 30
Default

I have to ask almost the same question as Pyro. What can be done with it that couldn't be done before?
I looked at all the files in the script but the only thing I could come up with is that it translates the language? (probably wrong but my best guess)