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 11-30-2006, 03:59 PM   #1 (permalink)
Newbie
 
Join Date: Aug 2004
Location: Bochum, Germany
Age: 21
Posts: 56
Send a message via ICQ to Brutus5000 Send a message via Skype™ to Brutus5000
Default virtual OnChop in BaseAddon

I would like to see this function virtual by default in \Items\Addons\BaseAddon.cs:

public virtual void OnChop( Mobile from )

There are a lot of Addons that might have a function or something like this and are not always allowed to be redeeded. This would allow more control about the redeed process without any modifications in BaseAddon.cs (and I think the less you have to change for a custom script, the less mistakes people make, who also want to use this script).

Example, what gives an error with current BaseAddon.cs, but works with the virtual method:

Code:
public class UltimateMachine: BaseAddon
{
[...]

  public override void OnChop(Mobile from) 
  {
      if (m_Public)
            from.LocalOverheadMessage(MessageType.Regular, 0x33, false, NotYourOwnMessage);
      else
            base.OnChop(from);
  }

[...]
}

Last edited by Brutus5000; 12-01-2006 at 01:11 PM.
Brutus5000 is offline   Reply With Quote
Old 11-30-2006, 04:02 PM   #2 (permalink)
Master of the Internet
 
Join Date: Oct 2005
Age: 45
Posts: 6,283
Default

If that method there is an override, that means that somewhere there is a virtual one that already exists that you can use, otherwise, there would be nothing to override...
Malaperth is offline   Reply With Quote
Old 12-01-2006, 01:10 PM   #3 (permalink)
Newbie
 
Join Date: Aug 2004
Location: Bochum, Germany
Age: 21
Posts: 56
Send a message via ICQ to Brutus5000 Send a message via Skype™ to Brutus5000
Default

That's exactly what I mean.
Make the OnChop method in the BaseAddon.cs virtual. Otherwise you can not override the method in derived classes anyway.
Brutus5000 is offline   Reply With Quote
Old 12-01-2006, 01:20 PM   #4 (permalink)
Master of the Internet
 
Join Date: Oct 2005
Age: 45
Posts: 6,283
Default

You can override an override...
Malaperth is offline   Reply With Quote
Old 12-01-2006, 02:16 PM   #5 (permalink)
Newbie
 
Join Date: Aug 2004
Location: Bochum, Germany
Age: 21
Posts: 56
Send a message via ICQ to Brutus5000 Send a message via Skype™ to Brutus5000
Default

In the standard RunUO Distro (RC or SVN) the OnChop method is not virtual so you can not override it anyway.
Brutus5000 is offline   Reply With Quote
Old 12-01-2006, 02:20 PM   #6 (permalink)
Master of the Internet
 
Join Date: Oct 2005
Age: 45
Posts: 6,283
Default

Which is exactly why I answered with this:

Quote:
If that method there is an override, that means that somewhere there is a virtual one
What you posted is not part of any code in any release. And, since BaseAddon is not a core script, it is more than simple to make it virtual by yourself.
Malaperth is offline   Reply With Quote
Old 12-01-2006, 02:31 PM   #7 (permalink)
Newbie
 
Join Date: Aug 2004
Location: Bochum, Germany
Age: 21
Posts: 56
Send a message via ICQ to Brutus5000 Send a message via Skype™ to Brutus5000
Default

Sorry i misunderstood (english is not my native language). What I posted is an example of a custom script that might use it. You are right it's easy to make it virtual myself but:

A lot of people release their scripts and say copy this files to your folder an override existing files. This makes trouble if you mix up several custom scripts. That's the reason why I would like to see the BaseAddon-OnChop function virtual in the release code of RunUO. As you agree it's not a big thing. You make it on your own, but it just one word, so why don't put it into the svn?

Hope you understand why i created this topic
Maybe it's a crappy idea. So far you can delete this thread. Whatever.
Brutus5000 is offline   Reply With Quote
Old 12-04-2006, 08:09 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

Quote:
Originally Posted by Malaperth
Which is exactly why I answered with this:



What you posted is not part of any code in any release. And, since BaseAddon is not a core script, it is more than simple to make it virtual by yourself.
Quote:
Originally Posted by BaseAddon.cs Ln 53
public void OnChop( Mobile from )
That is the distro code, it isn't an overrode method in BaseAddon.cs.
Kenko 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