Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 20:43

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

Advertisement



Input string was not in correct format.

Discussion on Input string was not in correct format. within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
scottdavey's Avatar
 
elite*gold: 0
Join Date: Dec 2006
Posts: 684
Received Thanks: 238
Input string was not in correct format.

I have fully converted LOTF to ini, as you can see it works pretty much ok from the screenshot:



But I get this error/warning that is to do with my LoadMobSpawns function:


Code:
public static void LoadMobSpawns()
        {
            if (File.Exists(System.Windows.Forms.Application.StartupPath + @"\Objects\MobSpawns.txt"))
            {
                TextReader TR = new StreamReader(System.Windows.Forms.Application.StartupPath + @"\Objects\MobSpawns.txt");
                string Items = TR.ReadToEnd();
                TR.Close();
                Items = Items.Replace("\r", "");
                string[] AllItems = Items.Split('\n');
                MobSpawns = new uint[AllItems.Length][];
                int i = 0;
                foreach (string _item in AllItems)
                {
                    string _item_ = _item.Trim();
                    if (_item_.Length >= 2)
                    {
                        if (_item_.IndexOf("//", 0, 2) != 0)
                        {
                            string[] SpawnInfo = _item_.Split(' ');
                            uint SpawnID = uint.Parse(SpawnInfo[0]);
                            uint SpawnWhatID = uint.Parse(SpawnInfo[1]);
                            uint SpawnNr = uint.Parse(SpawnInfo[2]);
                            uint XStart = uint.Parse(SpawnInfo[3]);
                            uint YStart = uint.Parse(SpawnInfo[4]);
                            uint XEnd = uint.Parse(SpawnInfo[5]);
                            uint YEnd = uint.Parse(SpawnInfo[6]);
                            uint Map = uint.Parse(SpawnInfo[7]);
                            MobSpawns[i] = new uint[8] { SpawnID, SpawnWhatID, SpawnNr, XStart, YStart, XEnd, YEnd, Map };
                            i++;
                        }
                    }
                }
                Console.WriteLine(i + " Mob Spawns successfully loaded.");
            }
            else
            {
                Console.WriteLine("MobSpawns file is missing, no MobSpawns where loaded!");
            }
        }
The error line:

Code:
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]));
I have used the same method for 4 other types of loading, portals, etc the funny thing is the monsters still load ingame, I have to use this method as I coded a php script to dump the lotf db to ini.

Any ideas? I have attached the file for you to review.
Attached Files
File Type: txt MobSpawns.txt (4.4 KB, 6 views)
scottdavey is offline  
Old 05/13/2010, 08:39   #2
 
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
Code:
public static void LoadMobSpawns()
        {
            if (File.Exists(System.Windows.Forms.Application.StartupPath + @"\Objects\MobSpawns.txt"))
            {
                TextReader TR = new StreamReader(System.Windows.Forms.Application.StartupPath + @"\Objects\MobSpawns.txt");
                string Items = TR.ReadToEnd();
                TR.Close();
                Items = Items.Replace("\r", "");
                string[] AllItems = Items.Split('\n');
                MobSpawns = new uint[AllItems.Length][];
                int i = 0;
                foreach (string _item in AllItems)
                {
                    string _item_ = _item.Trim();
                    if (_item_.Length >= 2)
                    {
                        if (_item_.IndexOf("//", 0, 2) != 0)
                        {try{
                            string[] SpawnInfo = _item_.Split(' ');
                            uint SpawnID = uint.Parse(SpawnInfo[0]);
                            uint SpawnWhatID = uint.Parse(SpawnInfo[1]);
                            uint SpawnNr = uint.Parse(SpawnInfo[2]);
                            uint XStart = uint.Parse(SpawnInfo[3]);
                            uint YStart = uint.Parse(SpawnInfo[4]);
                            uint XEnd = uint.Parse(SpawnInfo[5]);
                            uint YEnd = uint.Parse(SpawnInfo[6]);
                            uint Map = uint.Parse(SpawnInfo[7]);
                            MobSpawns[i] = new uint[8] { SpawnID, SpawnWhatID, SpawnNr, XStart, YStart, XEnd, YEnd, Map };
                            i++;
}
catch
{
Console.WriteLine(_item);
}
                        }
                    }
                }
                Console.WriteLine(i + " Mob Spawns successfully loaded.");
            }
            else
            {
                Console.WriteLine("MobSpawns file is missing, no MobSpawns where loaded!");
            }
        }
See what lines gives you error with this code.
-impulse- is offline  
Old 05/13/2010, 08:59   #3
 
scottdavey's Avatar
 
elite*gold: 0
Join Date: Dec 2006
Posts: 684
Received Thanks: 238
Same error, doesn't write any line.

Strange..
scottdavey is offline  
Old 05/13/2010, 11:20   #4


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
There error is being caused by one of your short.Parse() attempts, go back and check that everything your parsing can be parsed, and check that your .ini file is layed out correctly.
Korvacs is offline  
Old 05/13/2010, 11:40   #5
 
scottdavey's Avatar
 
elite*gold: 0
Join Date: Dec 2006
Posts: 684
Received Thanks: 238
Quote:
Originally Posted by Korvacs View Post
There error is being caused by one of your short.Parse() attempts, go back and check that everything your parsing can be parsed, and check that your .ini file is layed out correctly.
The text file attached was generated by a php script I created, I cannot see anything wrong with it with the naked eye, could you check it and see what you think?

Cheers
scottdavey is offline  
Old 05/13/2010, 11:47   #6


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Your looking for anything which isnt a number, or something that should be a number and for some reason isnt.

If you cant find anything that way, surround the line in question with a try catch exception, once you have done that throw a breakpoint into the catch side of the exception, once this breakpoint is triggered, you can see exactly which line of your .ini file is causing the problem, and specifically which point in the line is failing to be parsed.
Korvacs is offline  
Thanks
2 Users
Old 05/13/2010, 18:56   #7
 
scottdavey's Avatar
 
elite*gold: 0
Join Date: Dec 2006
Posts: 684
Received Thanks: 238
Quote:
Originally Posted by Korvacs View Post
Your looking for anything which isnt a number, or something that should be a number and for some reason isnt.

If you cant find anything that way, surround the line in question with a try catch exception, once you have done that throw a breakpoint into the catch side of the exception, once this breakpoint is triggered, you can see exactly which line of your .ini file is causing the problem, and specifically which point in the line is failing to be parsed.
I have no idea what you just said, I know how to try and catch but everything else you just said has just puzzled me lol, I'm still amateur at C#.

Playing with the source to improve my knowledge.
scottdavey is offline  
Old 05/13/2010, 19:17   #8
 
elite*gold: 0
Join Date: May 2010
Posts: 630
Received Thanks: 130
line 213 entities.cs
.Summer is offline  
Old 05/13/2010, 20:10   #9
 
scottdavey's Avatar
 
elite*gold: 0
Join Date: Dec 2006
Posts: 684
Received Thanks: 238


These are the only three that appear bugged, can anyone check the ini file and see if they see a problem as I can't see one..

On a side note:
2000 mobs spawn now instead of like 200.
scottdavey is offline  
Old 05/13/2010, 23:53   #10
 
scottdavey's Avatar
 
elite*gold: 0
Join Date: Dec 2006
Posts: 684
Received Thanks: 238
Fixed, impulse found the problem!

The problem was that there where two spaces in three monsters, PHP dump must have added them by accident.
scottdavey is offline  
Thanks
1 User
Old 05/14/2010, 00:02   #11
 
elite*gold: 0
Join Date: May 2010
Posts: 630
Received Thanks: 130
Good to hear is fixed now
.Summer is offline  
Reply


Similar Threads Similar Threads
[Client Modding] Unsupported input format ?!
10/19/2013 - Metin2 Private Server - 3 Replies
Hey ho com ! ich wollte eben neue rüssis usw also färben aber wenn ich mit photoshop die abspeichern will kommt immer Unsuporrted input format ich habe mal nen paar screens gemacht hoffe ich könnt mir helden =) Nicht wundern, den ssp hab ich nur schnell gefärbt :D http://roflmt.2.ag/include/images/Mt2/xD.jpg http://roflmt.2.ag/include/images/Mt2/xD1.jpg http://roflmt.2.ag/include/images/Mt2/xD2.jpg Jo, Habe das DDS Plugin insterliert, kann ja auch die dss dateien öffnen abern unja ;D...
[Client Modding] Unsupported input format ?!
05/21/2010 - Metin2 Private Server - 0 Replies
Hey ho com ! ich wollte eben neue rüssis usw also färben aber wenn ich mit photoshop die abspeichern will kommt immer Unsuporrted input format ich habe mal nen paar screens gemacht hoffe ich könnt mir helden =) Nicht wundern, den ssp hab ich nur schnell gefärbt :D http://roflmt.2.ag/include/images/Mt2/xD.jpg http://roflmt.2.ag/include/images/Mt2/xD1.jpg http://roflmt.2.ag/include/images/Mt2/xD2.jpg Jo, Habe das DDS Plugin insterliert, kann ja auch die dss dateien öffnen abern unja ;D...
[Skills ändern] Unsupported input format ?!
05/21/2010 - Metin2 Private Server - 5 Replies
huhu, habe eben jetzt als beispiel mein SSP gändert , so also in Photoshop, nun wollte ich es speichern also Speichern/warrior_4-1.dss so das prob ist wenn ich es speichern will kommt immer Unsupported input format was heist das bzw wie kann ich das überschreiben !?!?! weil es geht nicht mfg Danke :)
Pa Correct nmn toh~
08/18/2008 - RF Online - 9 Replies
Sir..pa correct nmn sa makakabasa n2.. ung sinasabi po ng iba na sa Search lng mahahanap ung mga hacks na gusto ko... san ako mag Search d2 sa forums na toh oh sa iba?? pa correct ^^



All times are GMT +1. The time now is 20:44.


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.