Go Back   RunUO - Ultima Online Emulation > RunUO > Modification Suggestions

Modification Suggestions This is where you can suggest a modifcation to RunUO!

Reply
 
Thread Tools Display Modes
Old 05-15-2006, 09:06 PM   #1 (permalink)
Moderate
 
David's Avatar
 
Join Date: Nov 2002
Location: USA
Posts: 6,598
Default Derived PlayerMobile

Another wish list item; a class derived from PlayerMobile for scriptors to use so we can all leave PlayerMobile untouched. OK, granted this is not just a couple of lines of code and if it's not already in it most likely will not be. But it sure would be a nice surprise to find it in 2.0.
__________________
David Forum Moderator
The RunUO.com Forum Moderator Team

Forum Rules and Guidelines
RunUO Forum Search Engine
Download RunUO 2.0 RC2
David is offline   Reply With Quote
Old 05-15-2006, 09:32 PM   #2 (permalink)
Forum Expert
 
Join Date: Oct 2004
Location: New York
Age: 27
Posts: 688
Default

This is easy, but I do see your point into having a standard one, so people could swap scripts back and forth, and work without everyone having different "sub-player mobiles"

in charcreation do this:
Code:
		private static Mobile CreateMobile( Account a )
		{
			if ( a.Count >= a.Limit )
				return null;

			for ( int i = 0; i < a.Length; ++i )
			{
				if ( a[i] == null )
					return (a[i] = new SlyPlayerMobile());
			}

			return null;
		}
and then I've made the SlyPlayerMobile have all my custom additions, such as a race, class, religion, quest tracking, and leveling systems all in one file. It really does make it a lot easier than having to work with the PlayerMobile. Although my custom playermobile is already 769 lines long(and growing!) , so its getting harder to work with :\
X-SirSly-X is offline   Reply With Quote
Old 05-15-2006, 10:03 PM   #3 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

PlayerMobile is already a child class, of the Mobile class, which was done awhile ago. The problem with the above idea is the fact, there are several issues with a conversion script because of some issues within the PlayerMobile.

Plus the fact even if this is done, if there is an issue in the child class, it still will cause problems. So really in the end its easier to deal with PlayerMobile then it is to deal with yet another child class.
Phantom is offline   Reply With Quote
Old 05-15-2006, 10:06 PM   #4 (permalink)
Moderate
 
David's Avatar
 
Join Date: Nov 2002
Location: USA
Posts: 6,598
Default

Yes I have been a proponent of derived PlayerMobiles since the early betas. Back when we had to update every couple of weeks it was a really big deal. Even now I simply feel that it is the "right" was to add custom scripts to your players.
__________________
David Forum Moderator
The RunUO.com Forum Moderator Team

Forum Rules and Guidelines
RunUO Forum Search Engine
Download RunUO 2.0 RC2
David is offline   Reply With Quote
Old 05-15-2006, 10:15 PM   #5 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

Quote:
Originally Posted by David
Yes I have been a proponent of derived PlayerMobiles since the early betas. Back when we had to update every couple of weeks it was a really big deal. Even now I simply feel that it is the "right" was to add custom scripts to your players.
The problem is no matter what, if there is a problem with the code, its not going to allow the server to load and will want to delete the server's characters. As a programmer I would rather have one file, that I can look at and know the history, then look at a file that I know nothing about.
Phantom is offline   Reply With Quote
Old 05-15-2006, 10:27 PM   #6 (permalink)
Moderate
 
David's Avatar
 
Join Date: Nov 2002
Location: USA
Posts: 6,598
Default

Quote:
Originally Posted by Phantom
PlayerMobile is already a child class, of the Mobile class, which was done awhile ago. The problem with the above idea is the fact, there are several issues with a conversion script because of some issues within the PlayerMobile.

Plus the fact even if this is done, if there is an issue in the child class, it still will cause problems. So really in the end its easier to deal with PlayerMobile then it is to deal with yet another child class.
LoL - PlayerMobile is a child class... obviously.

A conversion script would need to be provided, but it would only have to account for the standard PlayerMobile. Anyone who has edited the PlayerMobile will have to do it again in 2.0, so they can just tweak the conversion script instead. Or they can continue to use the PlayerMobile script. I have used a derived PlayerMobile for years and have never had a problem with distro scripts referring to PlayerMobile while mine refer to BritanniaMobile.

Lets see, if there is an issue with a script it will cause problems... again obviously. The idea here is that scripts actually be tested before they are submitted or put on a production shard.

And finally how is working with a 2865 line distro script easier than working with a short script script that contains only what you have added to it? I have multiple custom features added to my Players but my PlayerMobile has been the default distro script since beta 26 or so.

It is called PolyMorphism and is used throughout RunUO. It is not hard at all.
__________________
David Forum Moderator
The RunUO.com Forum Moderator Team

Forum Rules and Guidelines
RunUO Forum Search Engine
Download RunUO 2.0 RC2
David is offline   Reply With Quote
Old 05-15-2006, 10:56 PM   #7 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

Quote:
And finally how is working with a 2865 line distro script easier than working with a short script script that contains only what you have added to it? I have multiple custom features added to my Players but my PlayerMobile has been the default distro script since beta 26 or so.
Because I can tell people whats wrong with PlayerMobile, since I have followed the script since the introduction of it. So I can just by looking at the code, notice a problem, but with a new class it would make it tough.

Inregards to testing code, most people will never do this, which is evident by all the problems people have.

Its up to the coder to write a script, that is easy to use, and won't cause problems in the future.
Phantom is offline   Reply With Quote
Old 05-16-2006, 09:15 AM   #8 (permalink)
Forum Expert
 
arul's Avatar
 
Join Date: Jan 2005
Location: Hic sunt leones ...
Age: 21
Posts: 1,280
Send a message via MSN to arul
Default

Quote:
Originally Posted by Phantom
The problem is no matter what, if there is a problem with the code, its not going to allow the server to load and will want to delete the server's characters. As a programmer I would rather have one file, that I can look at and know the history, then look at a file that I know nothing about.
Programmers at the first place are trying to ease their work as much as possible.
Say one has a PlayerMobile class with bunch of modifications, when new official version of the file is released ( for example 2.0 comes out ) one has to do a lot of annoying merging a comparsions.
Another has "Player" class and all custom modifications are made to this class, then he has no problems when new version of file is available.

Good idea David.
__________________
Angels are falling the very last time, down they're burning in hate and decline, unfaithful and violent we're breaking the spell, we're god, we're scissor, in heaven and hell!
arul is offline   Reply With Quote
Old 05-16-2006, 04:14 PM   #9 (permalink)
Master of the Internet
 
Anti-Basic's Avatar
 
Join Date: Dec 2005
Age: 20
Posts: 12,927
Default

David, I love you now. *hugs*
__________________
Quote:
Originally Posted by madmadmax3 View Post
I didn't insult anyone dumpass
Anti-Basic is offline   Reply With Quote
Old 05-16-2006, 05:05 PM   #10 (permalink)
Forum Expert
 
Join Date: Oct 2002
Posts: 1,125
Default

Copying a file containing your own custom derived PlayerMobile class would be just as easy as copying it over one in the distribution, I would think. Well - except for modifying CharacterCreation.cs to create it. That's simple enough already really?
Aenima is offline   Reply With Quote
Old 05-16-2006, 06:04 PM   #11 (permalink)
Master of the Internet
 
Joeku's Avatar
 
Join Date: Feb 2005
Location: ShatteredSosaria.com
Posts: 9,251
Default

Quote:
Originally Posted by David
LoL - PlayerMobile is a child class... obviously.

A conversion script would need to be provided, but it would only have to account for the standard PlayerMobile. Anyone who has edited the PlayerMobile will have to do it again in 2.0, so they can just tweak the conversion script instead. Or they can continue to use the PlayerMobile script. I have used a derived PlayerMobile for years and have never had a problem with distro scripts referring to PlayerMobile while mine refer to BritanniaMobile.

Lets see, if there is an issue with a script it will cause problems... again obviously. The idea here is that scripts actually be tested before they are submitted or put on a production shard.

And finally how is working with a 2865 line distro script easier than working with a short script script that contains only what you have added to it? I have multiple custom features added to my Players but my PlayerMobile has been the default distro script since beta 26 or so.

It is called PolyMorphism and is used throughout RunUO. It is not hard at all.
I suggested the same exact thing, but for the Mobile and Item classes. It would be great for the PlayerMobile and perhaps even BaseCreature classes, too.

***EDIT***
Here's my old thread: Base classes...

Last edited by Joeku; 05-16-2006 at 06:06 PM.
Joeku is offline   Reply With Quote
Old 05-17-2006, 06:19 AM   #12 (permalink)
Forum Expert
 
Join Date: Jan 2004
Location: England
Age: 20
Posts: 442
Default

This is a great idea, same with the Item and Mobile classes Joeku. The server I work for has a BaseItem which works great, and a new project of mine also has a BasePlayerMobile which works well.
tobyjug is offline   Reply With Quote
Old 05-20-2006, 11:52 AM   #13 (permalink)
Master of the Internet
 
Anti-Basic's Avatar
 
Join Date: Dec 2005
Age: 20
Posts: 12,927
Default

David, would making mods intended for playermobile in the derived one instead prevent playermobile wipes if you made a booboo or just be easier....you seem to be mentioning how much easier it is...and not how great it would be w/o the wipes...I'm confused
__________________
Quote:
Originally Posted by madmadmax3 View Post
I didn't insult anyone dumpass
Anti-Basic is offline   Reply With Quote
Old 05-20-2006, 11:56 AM   #14 (permalink)
RunUO Forum Moderator
 
daat99's Avatar
 
Join Date: Dec 2004
Location: Israel
Age: 27
Posts: 8,163
Send a message via ICQ to daat99 Send a message via AIM to daat99
Default

Quote:
Originally Posted by Anti-Basic
David, would making mods intended for playermobile in the derived one instead prevent playermobile wipes if you made a booboo or just be easier....you seem to be mentioning how much easier it is...and not how great it would be w/o the wipes...I'm confused
The wipes are due to ser\deser errors.
No amount of derived classes will save your shard if you don't know how to ser deser.
The only thing that it'll help is with upgrading from one RunUO version to another because you won't have to remodify the new PlayerMobile that is released.
Still if you mess up your ser\deser you will have a wipe.
__________________
I always try to help
Sometimes, I don't know how....

My Web Page
Forum Rules
-------------------------------------------------------------
Extensive OWLTR System | Token System | World Teleporters
-------------------------------------------------------------
daat99 is offline   Reply With Quote
Old 05-21-2006, 12:15 PM   #15 (permalink)
Forum Novice
 
Zotos's Avatar
 
Join Date: Jan 2005
Location: in my own world
Age: 35
Posts: 208
Default

Love the idea..
Zotos is offline   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