Milva

Moderator
  1. 1.0->2.0RC1 Conversion miniFAQ----posted on Runuo by daborg

    So you decided to try to convert your scripts to the RC1 and now all those errors pop out? Here are the most common errors that you will run into, regardless if you are using custom scripts or not..

    Note this FAQ is provided as is, you must know what you are doing, or you will break more then you will fix :D

    Error :
    Code:
    The type or namespace name 'CommandEventArgs' could not be
    found (are you missing a using directive or an assembly reference?)

    Solution:
    The name space of Commands has changed
    Old namespace Server.Scripts.Commands has to be replaced by
    Code:
    using Server.Commands;

    Error :
    The type or namespace name 'Register' does not exist in the namespace 'Server.Commands' (are you missing an assembly reference?)
    the proble is caused by this line:
    Code:
    Server.Commands.Register( "yourcommand", AccessLevel.Administrator, new CommandEventHandler( yourcommand_oncommand ) );

    Solution:
    replace with
    Code:
    CommandSystem.Register( "yourcommand", AccessLevel.Administrator, new CommandEventHandler( yourcommand_oncommand ) );

    Error :
    Code:
    'Server.Mobiles.FightMode' does not contain a definition for 'Agressor'

    Solution:
    some typos were fixed in new release including this one. just replace FightMode.Agressor in your failing script with
    Code:
    FightMode.Aggressor

    Error :
    Code:
    The name 'Controled' does not exist in the current context

    Solution:
    Another typo has been fixed, replace Controled with
    Code:
    Controlled

    Error :
    Code:
    'Server.Items.YourItem.Dupe(int)': no suitable method found to override

    Solution:
    the dupe method is no longer supported, find the dupe code in your script and remove it. example dupe code:
    Code:
    public override Item Dupe( int amount )
    {
    return base.Dupe( new Ingot( amount ), amount );
    }


    Error :
    Code:
    Server.Mobiles.YourMobile.GetContextMenuEntries(Server.Mobile, System.Collections.ArrayList)': no suitable method found to override

    Solution:
    the ArrayList has been replaced with the type of List<YourType>.
    find this line in your mobile code
    Code:

    public override void GetContextMenuEntries( Mobile from, ArrayList list )

    and replace it with
    Code:
    public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )

    Error :
    I did what you told me to do and now I have a new error(s)
    Code:
    The type or namespace name 'ContextMenuEntry' could not be found (are you missing a using directive or an assembly reference?)

    Solution:
    Make sure your code contains:
    Code:
    using Server.ContextMenus;

    Error :
    I did what you told me to do and now I have a new error(s)
    Code:
    The type or namespace name 'List' could not be found (are you missing a using directive or an assembly reference?)

    Solution:
    Make sure your code contains:
    Code:
    using System.Collections.Generic
 
Back