Register for your free account! | Forgot your password?

You last visited: Today at 20:42

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

Advertisement



[Release]DBC Converter

Discussion on [Release]DBC Converter within the CO2 Weapon, Armor, Effects & Interface edits forum part of the CO2 Guides & Templates category.

Reply
 
Old 02/23/2012, 11:26   #16

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
Quote:
Originally Posted by JobvdH View Post
I hope you'll succeed!
If you succeed this will be a great progress to 5165+ item editing!
Don't expect anything though, the chance of me doing anything half decent at programming is as high as doomsday happening this year.
Kiyono is offline  
Thanks
1 User
Old 02/23/2012, 11:50   #17
 
JobvdH's Avatar
 
elite*gold: 0
Join Date: Nov 2010
Posts: 371
Received Thanks: 120
Ah alright, perhaps CrpSky might want to help you?
If he won't, you atleast tried it
JobvdH is offline  
Old 02/23/2012, 18:15   #18


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
I fixed the errors, plus I added the 3DEffect support.
CptSky is offline  
Thanks
2 Users
Old 02/23/2012, 18:30   #19
 
JobvdH's Avatar
 
elite*gold: 0
Join Date: Nov 2010
Posts: 371
Received Thanks: 120
Quote:
Originally Posted by CptSky View Post
I fixed the errors, plus I added the 3DEffect support.
Great job!
JobvdH is offline  
Old 02/23/2012, 18:33   #20

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
Quote:
Originally Posted by CptSky View Post
I fixed the errors, plus I added the 3DEffect support.
Also added 3deffect support, can't test since I'm on my notebook but it should work.
Kiyono is offline  
Old 02/23/2012, 19:01   #21
 
2slam's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 586
Received Thanks: 336
we are getting so close
2slam is offline  
Old 03/13/2012, 10:24   #22

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
And it should support all .dbc files now.
//edit Moved to the editing section as it seems more suitable.
Kiyono is offline  
Old 04/25/2012, 23:22   #23
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
What about converting the .txt back to .dbc? Or is that not required, abit of a nub with this ****.
_DreadNought_ is offline  
Old 04/25/2012, 23:30   #24


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
Quote:
Originally Posted by _DreadNought_ View Post
What about converting the .txt back to .dbc? Or is that not required, abit of a nub with this ****.
It should support both conversions as my DLL support them...
CptSky is offline  
Old 04/25/2012, 23:44   #25
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
Ah yeah it did, it just wasn't very clear...

However when trying to convert 3DEffectObj.dbc I am unable to do it, this exception is as follows(in spoiler)..

_DreadNought_ is offline  
Old 04/26/2012, 00:11   #26


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
Quote:
Originally Posted by _DreadNought_ View Post
Ah yeah it did, it just wasn't very clear...

However when trying to convert 3DEffectObj.dbc I am unable to do it, this exception is as follows(in spoiler)..
The app should use the RSDB [32bits] class and not the EFFE class for this file.
CptSky is offline  
Old 04/26/2012, 00:35   #27
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
Here is the fixed class:
Code:
using System;
using System.Windows.Forms;
using System.IO;

namespace DBC_Converter
{
     public partial class Form1 : Form
     {
          public Form1()
          {
               InitializeComponent();
          }
          private void button1_Click(object sender, EventArgs e)
          {
               var result = openFileDialog1.ShowDialog();
               if (result == DialogResult.OK)
               {
                    textBox1.Text = openFileDialog1.FileName.ToLower();
               }
          }
          private void button3_Click(object sender, EventArgs e)
          {
               if (File.Exists(textBox1.Text))
               {
                   switch (Header(textBox1.Text))
                   {
                       case "EFFE":
                           {
                               var dbc = new CO2_CORE_DLL.IO.DBC.EFFE();
                               if (IsDbc(textBox1.Text))
                               {
                                   dbc.LoadFromDat(textBox1.Text);
                                   dbc.SaveToTxt(ExtDbc(true));
                               }
                               else
                               {
                                   dbc.LoadFromTxt(textBox1.Text);
                                   dbc.SaveToDat(ExtDbc(false));
                               }
                               Done();
                               break;
                           }
                       case "RSDB32":
                           {
                               var dbc = new CO2_CORE_DLL.IO.DBC.RSDB_SMALL();
                               if (IsDbc(textBox1.Text))
                               {
                                   dbc.LoadFromDat(textBox1.Text);
                                   dbc.SaveToTxt(ExtDbc(true));
                               }
                               else
                               {
                                   dbc.LoadFromTxt(textBox1.Text);
                                   dbc.SaveToDat(ExtDbc(false));
                               }
                               Done();
                               break;
                           }
                       case "RSDB64":
                           {
                               var dbc = new CO2_CORE_DLL.IO.DBC.RSDB_BIG();
                               if (IsDbc(textBox1.Text))
                               {
                                   dbc.LoadFromDat(textBox1.Text);
                                   dbc.SaveToTxt(ExtDbc(true));
                               }
                               else
                               {
                                   dbc.LoadFromTxt(textBox1.Text);
                                   dbc.SaveToDat(ExtDbc(false));
                               }
                               Done();
                               break;
                           }
                       case "SIMO":
                           {
                               var dbc = new CO2_CORE_DLL.IO.DBC.SIMO();
                               if (IsDbc(textBox1.Text))
                               {
                                   dbc.LoadFromDat(textBox1.Text);
                                   dbc.SaveToTxt(ExtDbc(true));
                               }
                               else
                               {
                                   dbc.LoadFromTxt(textBox1.Text);
                                   dbc.SaveToDat(ExtDbc(false));
                               }
                               Done();
                               break;
                           }
                       case "MESH":
                           {
                               var dbc = new CO2_CORE_DLL.IO.DBC.MESH();
                               if (IsDbc(textBox1.Text))
                               {
                                   dbc.LoadFromDat(textBox1.Text);
                                   dbc.SaveToTxt(ExtDbc(true));
                               }
                               else
                               {
                                   dbc.LoadFromTxt(textBox1.Text);
                                   dbc.SaveToDat(ExtDbc(false));
                               }
                               Done();
                               break;
                           }
                       case "EMOI":
                           {
                               var dbc = new CO2_CORE_DLL.IO.DBC.EMOI();
                               if (IsDbc(textBox1.Text))
                               {
                                   dbc.LoadFromDat(textBox1.Text);
                                   dbc.SaveToTxt(ExtDbc(true));
                               }
                               else
                               {
                                   dbc.LoadFromTxt(textBox1.Text);
                                   dbc.SaveToDat(ExtDbc(false));
                               }
                               Done();
                               break;
                           }
                       case "MATR":
                           {
                               var dbc = new CO2_CORE_DLL.IO.DBC.MATR();
                               if (IsDbc(textBox1.Text))
                               {
                                   dbc.LoadFromDat(textBox1.Text);
                                   dbc.SaveToTxt(ExtDbc(true));
                               }
                               else
                               {
                                   dbc.LoadFromTxt(textBox1.Text);
                                   dbc.SaveToDat(ExtDbc(false));
                               }
                               Done();
                               break;
                           }
                       case "ROPT":
                           {
                               var dbc = new CO2_CORE_DLL.IO.DBC.ROPT();
                               if (IsDbc(textBox1.Text))
                               {
                                   dbc.LoadFromDat(textBox1.Text);
                                   dbc.SaveToTxt(ExtDbc(true));
                               }
                               else
                               {
                                   dbc.LoadFromTxt(textBox1.Text);
                                   dbc.SaveToDat(ExtDbc(false));
                               }
                               Done();
                               break;
                           }
                       default:
                           {
                               MessageBox.Show("The DBC file is not recognized.");
                               break;
                           }
                   }
               }
               else
               {
                    MessageBox.Show("You either forgot to select a file or somehow selected a non-existing one.");
               }
          }
          
          private void button2_Click(object sender, EventArgs e)
          {
               MessageBox.Show("So you probably clicked here because of the program not working.\nYou probably did something weird, try again.");
          }

          private void button4_Click(object sender, EventArgs e)
          {
               MessageBox.Show("Credits:\nCptSky for his .dll, program wouldn't have existed without him.\nMe for putting together this for the lazy ones.\nGoogle for random stuff.");
          }
          public bool IsDbc(string path)
          {
              if (path.EndsWith(".dbc"))
                    return true;
              return false;
          }

         public string ExtDbc(bool extension)
         {
             if(extension)
                    return textBox1.Text.Replace(".dbc", ".txt");
             return textBox1.Text.Replace(".txt", ".dbc");
         }

         public string Header(string text)
          {
              if (text.Contains("3deffectobj") || text.Contains("3dobj") || text.Contains("3dtexture") || text.Contains("sound"))
                  return "RSDB32";
              if (text.Contains("3deffect"))
                  return "EFFE";
              if (text.Contains("motion") && !text.Contains("emotionico"))
                  return "RSDB64";
              if (text.Contains("3dsimpleobj"))
                  return "SIMO";
              if (text.Contains("armet") || text.Contains("armor") || text.Contains("head") || text.Contains("misc") || text.Contains("mount") || text.Contains("weapon"))
                  return "MESH";
              if (text.Contains("emotionico"))
                  return "EMOI";
              if (text.Contains("material"))
                  return "MATR";
              if (text.Contains("rolepart"))
                  return "ROPT";
              return "NONE";
          }
          public void Done()
          {
               MessageBox.Show("Done converting.");
          }

          private void Form1_Load(object sender, EventArgs e)
          {

          }
     }
}
Tiny code changes, but that now will work with all of the .dbc files.

There was a few useless else's and if's that I have removed. That class works fine and is abit better.
_DreadNought_ is offline  
Old 04/26/2012, 09:05   #28
 
2slam's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 586
Received Thanks: 336
well it didnt work for 3deffect.dbc
2slam is offline  
Old 04/26/2012, 10:56   #29

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
Fail on my part.
Code:
if (text.Contains("3deffect"))
                  return "EFFE";
              else if (text.Contains("3deffectobj") || text.Contains("3dobj") || text.Contains("3dtexture") || text.Contains("sound"))
                  return "RSDB32";
Change it to:
Code:
if (text.Contains("3deffect") && !text.Contains("3deffectobj"))
                  return "EFFE";
              else if (text.Contains("3deffectobj") || text.Contains("3dobj") || text.Contains("3dtexture") || text.Contains("sound"))
                  return "RSDB32";
And it should work.

//edit Uploaded it.
Kiyono is offline  
Thanks
1 User
Old 04/26/2012, 12:11   #30
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
Should probably fix your minor unnecessary codes..
for ex
Code:
              if (path.EndsWith(".dbc"))
                    return true;
              else 
                    return false;
why the else?
Code:
              if (path.EndsWith(".dbc"))
                    return true;
              return false;
_DreadNought_ is offline  
Reply


Similar Threads Similar Threads
[Release] DBC Converter Source
12/13/2012 - CO2 Exploits, Hacks & Tools - 21 Replies
Right, the majority of this works, however i decided in the end that it would just be best to dump the source of the project here and people can make changes and modify it as they need to. To start off you will need some .dbc files to decode to .txt files, and then you can convert them back again. Make sure you update the Count at the top of the file if you make changes, and ensure that the layout is correct, if something is placed in the wrong place or missing, then it wont work, this is...
[Release].php SQL zu XML Converter
06/14/2012 - Metin2 PServer Guides & Strategies - 8 Replies
Hey ho, ich hab mir mal die Mühe gemacht *hust* und habe einen .php Script erstellt, mit welchem man Items & Monster ( item_proto & mob_proto ) aus der Datenbank in das XML Format umwandelt. Wozu man das braucht? Wenn ihr "locale_name" habt:
[Release]DDS-Converter
01/20/2011 - Metin2 PServer Guides & Strategies - 22 Replies
Hey ich habe heute mal mein Desktop aufgeräumt :P und da fand ich plötzlich eine komische Datei. Aufeinmal stellte sich raus das es ein DDS-Converter war. Er wandelt DDS Dateien in jpg und png dateien um. Da das für manche Client´s nützlich ist dachte ich ich stell es mal hier rein. Virustotal Screen http://img3.fotos-hochladen.net/uploads/virrustot al0t16k9zq.png Screen vom Programm http://img3.fotos-hochladen.net/uploads/programmn gw8demb.png MfG Fun-Zocker
[RELEASE] DDS converter
08/18/2009 - EO PServer Guides & Releases - 9 Replies
Well, because this is a tool, i post it here and not on another section :bandit: People were complaining they cant open or edit a dds file.. This tool, can convert the dds file to jpg,png,bmp,tga and it can convert "to" dds :handsdown:



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


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