1.0->2.0RC1 Conversion miniFAQ
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
Error :
Solution:
The name space of Commands has changed
Old namespace Server.Scripts.Commands has to be replaced by
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:
Solution:
replace with
Error :
Solution:
some typos were fixed in new release including this one. just replace FightMode.Agressor in your failing script with
Error :
Solution:
Another typo has been fixed, replace Controled with
Error :
Solution:
the dupe method is no longer supported, find the dupe code in your script and remove it. example dupe code:
Error :
Solution:
the ArrayList has been replaced with the type of List<YourType>.
find this line in your mobile code
and replace it with
Error :
I did what you told me to do and now I have a new error(s)
Solution:
Make sure your code contains:
Error :
I did what you told me to do and now I have a new error(s)
Solution:
Make sure your code contains:
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
Error :
Code:
The type or namespace name [COLOR="Red"]'CommandEventArgs' [/COLOR]could not be
found (are you missing a using directive or an assembly reference?)
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 ) );
replace with
Code:
CommandSystem.Register( "yourcommand", AccessLevel.Administrator, new CommandEventHandler( yourcommand_oncommand ) );
Error :
Code:
'Server.Mobiles.FightMode' does not contain a definition for [COLOR="red"]'Agressor'[/COLOR]
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[COLOR="red"] 'Controled' [/COLOR]does not exist in the current context
Another typo has been fixed, replace Controled with
Code:
Controlled
Error :
Code:
'Server.Items.YourItem.[COLOR="red"]Dupe(int)'[/COLOR]: no suitable method found to override
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.[COLOR="red"]GetContextMenuEntries[/COLOR](Server.Mobile, System.Collections.ArrayList)': no suitable method found to override
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 )
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 '[COLOR="red"]ContextMenuEntry[/COLOR]' could not be found (are you missing a using directive or an assembly reference?)
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 [COLOR="red"]'List' could not be found [/COLOR](are you missing a using directive or an assembly reference?)
Make sure your code contains:
Code:
using System.Collections.Generic;