RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

EchoEcho's Race/Class system

Lokai

Knight
withinsin;690121 said:
When a player tries to use the race stone it throws out this exception...then crashes the server:

Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Gumps.RaceGump..ctor(Mobile from)
at Server.Items.RaceStone.OnDoubleClick(Mobile from)
at Server.Mobile.Use(Item item)
at Server.Network.PacketHandlers.UseReq(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)
________________________________________________________________

Any Ideas as to how I can remedy this?

Did you type [RCBegin to create the chest of items and initialize the system before typing [addrace?
 

withinsin

Wanderer
I didn't try to add a race...it has races already...the problem is trying to double click the stone to PICK your race...it crashes
 

Lokai

Knight
withinsin;690485 said:
I didn't try to add a race...it has races already...the problem is trying to double click the stone to PICK your race...it crashes

I suspect that you have more than one RaceControl in the world, causing a null reference.

Change this section in your RaceGump to find out:

Code:
   foreach (Item i in World.Items.Values) 
   {
    if (i is RaceControl)
    {
     r_control = i as RaceControl;
     Console.WriteLine("Found a RaceControl at {0}, {1}, {2} in {3}.", i.X, i.Y, i.Z, i.Map);
     Console.ReadLine();
    }
   }

Each time it finds one, it will print out a line, and freeze the world until you press enter in the Console.
 

Lokai

Knight
withinsin;690784 said:
didn't work

WHAT DIDN'T WORK???

Please be specific. The code I gave you was for the purpose of trapping the error. Are you saying that it crashed without ever printing anything to the Console? If so, then I say to you that it DID work, 100% as planned.

You see, if it does print to the Console, it means you have at least one RaceControl, but if it does not, then there is your problem. You have to have one RaceControl, or the gump does not work.
 

withinsin

Wanderer
I'm sorry I wasn't more specific

Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Gumps.RaceGump..ctor(Mobile from)
at Server.Items.RaceStone.OnDoubleClick(Mobile from)
at Server.Mobile.Use(Item item)
at Server.Network.PacketHandlers.UseReq(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)



Threw out that exception again
_____________________________________________________________

And while I have your attention, I had some staff on my server go alil, AWAL if you will, and I was wondering, is there a way I can script an account for me so I can fix the damage (they deleted all accounts but their own)
 

Lokai

Knight
withinsin;690810 said:
I'm sorry I wasn't more specific

Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Gumps.RaceGump..ctor(Mobile from)
at Server.Items.RaceStone.OnDoubleClick(Mobile from)
at Server.Mobile.Use(Item item)
at Server.Network.PacketHandlers.UseReq(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)



Threw out that exception again
_____________________________________________________________

And while I have your attention, I had some staff on my server go alil, AWAL if you will, and I was wondering, is there a way I can script an account for me so I can fix the damage (they deleted all accounts but their own)

Well, as to the first issue.

Since it threw the error without prompting you in the Console, we can be sure that there are NO RaceControls in the World. That might be related to those staff members deleting accounts. Anyway, you need to re-initialize the Race system, and start over, or at least create a RaceControl. Not sure how it will react, but I know there has to be one.

As far as your staff issue, I do not know what you mean by scripting an account, but do you still have your Owner account? If not, you will be prompted to create it when the shard boots up. If so, just create your accounts from the [Admin gump.
 

Lokai

Knight
withinsin;690813 said:
It doesn't prompt me..it just boots...

Exactly my point, which means there are NO RACECONTROLS in the world, for if there had been, it WOULD have prompted you. Get it?
 

Lokai

Knight
withinsin;690815 said:
I was talkin' about the admin account situation, Sorry again for not specifying

Oh.

If it does not prompt you, then the Owner account must still exist.
 

Lokai

Knight
withinsin;690818 said:
Nope :p it was deleted hehe

Look in Accounts.xml in your Saves/Accounts folder. Edit it in Notepad++ or something. There must be an account in there with Owner accesslevel, otherwise the Server should prompt you on start up to create an Owner.
 
Top