Register for your free account! | Forgot your password?

You last visited: Today at 04:30

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



entities.cs problem

Discussion on entities.cs problem within the CO2 Programming forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
snipetime's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 67
Received Thanks: 23
Question entities.cs problem

hi, i have a problem with entities.cs when i start my server it loads everyting almost all mobs i have but when he is on SpawnALLMobs it give an error at line:217
error=System.NullReferenceException: Object reference not set to an instance of an object.
line:218 is DataBase.Mobs = null;
now you know where to look just above line:218
this is what i have:


public static void SpawnAllMobs()
{
try
{
int MobsSpawned = 0;
int MobSpawnsToSpawn = DataBase.MobSpawns.Length;

for (int j = 0; j < MobSpawnsToSpawn; j++)
{
uint[] ThisSpawn = DataBase.MobSpawns[j];
string[] ThisMob = null;

foreach (string[] FindId in DataBase.Mobs)
{
if (FindId[0] == Convert.ToString(ThisSpawn[1]))
{
ThisMob = FindId;
}
}

for (int n = 0; n < Convert.ToInt32(ThisSpawn[2]); n++)
{
uint UID = (uint)General.Rand.Next(400000, 500000);
short spawn_x = (short)General.Rand.Next(Convert.ToInt16(ThisSpawn[3]), Convert.ToInt16(ThisSpawn[5]));
short spawn_y = (short)General.Rand.Next(Convert.ToInt16(ThisSpawn[4]), Convert.ToInt16(ThisSpawn[6]));
while (AllMobs.Contains(UID))
{
UID = (uint)General.Rand.Next(400000, 500000);
}
SingleMob Mob = new SingleMob(spawn_x, spawn_y, Convert.ToInt16(ThisSpawn[7]), uint.Parse(ThisMob[3]), uint.Parse(ThisMob[3]), short.Parse(ThisMob[6]), short.Parse(ThisMob[7]), UID, ThisMob[2], int.Parse(ThisMob[1]), short.Parse(ThisMob[4]), (byte)General.Rand.Next(8), byte.Parse(ThisMob[5]));


AllMobs.Add(UID, Mob);

MobsSpawned++; ;
}
}
DataBase.Mobs = null;
DataBase.MobSpawns = null;
General.WriteLine("Spawned " + MobsSpawned + " mobs.");
}
catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
}
}


i know its my first post but this is my first problem :-p
snipetime is offline  
Old 10/13/2008, 06:25   #2
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 912
What error do you get?
kinshi88 is offline  
Old 10/13/2008, 10:41   #3
 
snipetime's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 67
Received Thanks: 23
Quote:
Originally Posted by kinshi88 View Post
What error do you get?
error=System.NullReferenceException: Object reference not set to an instance of an object.
snipetime is offline  
Reply


Similar Threads Similar Threads
[Problem] Problem with server starting - cannot find quest index for PaxHeader
12/22/2009 - Metin2 Private Server - 1 Replies
Hello! I have this same problem as here when i'm starting my server: http://www.elitepvpers.com/forum/metin2-pserver-di scussions-questions/307143-metin2-serverfiles-ques t-index-fehler.html But I didn't know the answer.. how to repair this? Greetings
a little help. :P entities line 213..(lotf/Pazeco)
08/05/2009 - CO2 Private Server - 3 Replies
http://img39.imageshack.us/img39/1624/help103.jpg http://img9.imageshack.us/img9/8007/help022.jpg can anyone help me with this..



All times are GMT +2. The time now is 04:30.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.