Register for your free account! | Forgot your password?

You last visited: Today at 16:27

  • 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 04/26/2012, 12:29   #31

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
Quote:
Originally Posted by _DreadNought_ View Post
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;
I may simply be ignorant but don't those things function in exactly the same way? I always thought that it was merely an aesthetic thing.
Kiyono is offline  
Old 04/26/2012, 12:35   #32
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
Yes they do, but its bad coding practice to add code where the function will still have the same result without it.
_DreadNought_ is offline  
Old 04/26/2012, 12:42   #33

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
Quote:
Originally Posted by _DreadNought_ View Post
Yes they do, but its bad coding practice to add code where the function will still have the same result without it.
I see, re-uploaded with the "else" removed.
Kiyono is offline  
Old 04/26/2012, 12:45   #34


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Quote:
Originally Posted by Kiyono View Post
I see, re-uploaded with the "else" removed.
Just so your aware, its not really bad practice to do what you did, its to the point where you should consider which is more readable as the time saved is on the NS scale, not MS.
Korvacs is offline  
Old 04/26/2012, 16:57   #35
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
Quote:
Originally Posted by Korvacs View Post
Just so your aware, its not really bad practice to do what you did, its to the point where you should consider which is more readable as the time saved is on the NS scale, not MS.
The difference in time is irrelevant in this case, the fact is you shouldn't have extra code that serves no point of being there.

It's like saying:
Code:
if (radioStations > 5)
     Volume = 100;
else if (RadioStations < 5)
     Volume = 0;
else
    Volume = 0;
the else if statement is totally useless, It's still nanoseconds saved by removing either the else or the else if, but its the same result removing one of the other, its bad practice...
_DreadNought_ is offline  
Old 04/26/2012, 18:51   #36


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
And in that case i agree with you, but in Kiyono's case even your return false isnt required as that is the last line in the method, unless of course it returns bool, but then i would prefer Kiyono's.

Having if/else rather than simply an if has no bearings on performance, and is entirely down to readability, i would not consider what Kiyono wrote to be bad practice and would challenge you to find an example where removing else return false and just having return false is considered good practice.

No offence but you dont work in the industry, so you saying its considered bad practice has no relevance to me, so unless you can find examples of it then Kiyono is free to do whichever they are most comfortable with, especially given it has no bearings on performance.
Korvacs is offline  
Old 04/26/2012, 19:24   #37


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
Removing a if/else is like removing 2-3 cycles and clocked a 2-3GHz, it represents nothing.

Between the two.
Code:
              if (path.EndsWith(".dbc"))
                    return true;
              else 
                    return false;
I would use this:
Code:
              if (path.EndsWith(".dbc"))
                    return true;
              return false;
But, the best thing would be:
Code:
return path.EndsWith(".dbc");
Actually, in the industry using or not the else is not so important. But, we shouldn't have multiple return statement. In C#, it can be less important due to the memory management. In C/C++, it is less recommended due to the complex memory management (it can cause memory leak). Also, it's harder to debug. In case of little check at the start of the function, it's not important. But, later it's not recommended. Anyway, in this case, it's not a problem to have multiple return statement, but, we can write the function in one line and possibly, make it inline in C/C++ to avoid useless call that will slow of a few cycle
CptSky is offline  
Thanks
2 Users
Old 04/26/2012, 19:25   #38
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
Quote:
Originally Posted by Korvacs View Post
And in that case i agree with you, but in Kiyono's case even your return false isnt required as that is the last line in the method, unless of course it returns bool, but then i would prefer Kiyono's.

Having if/else rather than simply an if has no bearings on performance, and is entirely down to readability, i would not consider what Kiyono wrote to be bad practice and would challenge you to find an example where removing else return false and just having return false is considered good practice.

No offence but you dont work in the industry, so you saying its considered bad practice has no relevance to me, so unless you can find examples of it then Kiyono is free to do whichever they are most comfortable with, especially given it has no bearings on performance.
I do not work in the coding industry, and I never wanted it to be, of course Kiyono is free todo what he wants.

Let's put it this way; In my opinion what he did was bad coding practice. with that its not a global fact but simply my opinion, ok?
_DreadNought_ is offline  
Old 04/26/2012, 19:33   #39


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Quote:
Originally Posted by _DreadNought_ View Post
I do not work in the coding industry, and I never wanted it to be, of course Kiyono is free todo what he wants.

Let's put it this way; In my opinion what he did was bad coding practice. with that its not a global fact but simply my opinion, ok?
Exactly, so its not considered bad coding practice at all.

And CptSky, thank you for an informative post your absolutely right about the single line return, a much more elegant solution to the problem.
Korvacs is offline  
Old 08/15/2012, 08:35   #40
 
elite*gold: 0
Join Date: Dec 2007
Posts: 127
Received Thanks: 220
Just wondering if anyone is able to make this work on 3DEffect, 3DEffectObj and 3dtexture for the newest tq patch, fiddled around for a couple hours using multiple diff variations of the CO2_CORE_DLL x64 and x86 and every time editing 3DEffect makes all the effects in-game disappear (go off-screen, you can still see trails of weapons go to the top left corner of the screen)
AlexLane10 is offline  
Old 06/27/2015, 09:47   #41
 
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
Here's an updated DBC Converter. It allows drag and drop and its a lot faster for EFFE.

Use EFFE.zip to update your copy of CpySky's CO2_CORE_DLL project.
Attached Files
File Type: zip DBC Converter.zip (224.2 KB, 63 views)
File Type: zip EFFE.zip (3.6 KB, 47 views)
-impulse- is offline  
Thanks
1 User
Old 06/29/2015, 09:42   #42
 
elite*gold: 0
Join Date: Mar 2015
Posts: 2
Received Thanks: 0
can you teach me the steps to convert please
michiko023 is offline  
Old 06/29/2015, 11:03   #43
 
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
sure.
1. open convertor
2. drag and drop dbc file over the text box of the convertor
3. click convert
4. edit file
5. drag and drop text file over the text box of the convertor
6. click convert

Done.
-impulse- is offline  
Old 06/29/2015, 11:25   #44
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
Quote:
Originally Posted by -impulse- View Post
sure.
1. open convertor
2. drag and drop dbc file over the text box of the convertor
3. click convert
4. edit file
5. drag and drop text file over the text box of the convertor
6. click convert

Done.
Spirited is offline  
Old 07/01/2015, 15:05   #45
 
priboy16's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 42
Received Thanks: 1
i didnt understand what it dose
priboy16 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 16:28.


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.