Jump to content

Home

Utility for 2DA converting(Text<->V2.b) and merging


stoffe

Recommended Posts

Last version: Click

 

In case someone else would find it useful I have uploaded a modified version of my small 2DA converter utility which now contains a new 2DA file merging function.

 

It will take two 2DA files (of the same kind) and merge changes they contain and save the combined result as a new 2DA file. It will currently detect changes to existing lines as well as new lines and columns that have been added. It will not handle files where standard lines have been deleted (since the 2DA spec. strongly discourages deleting rows in a 2DA anyway).

 

Row labels will automatically be updated to be unique, but all other data is just merged together from the files. Thus you'll still need to check/update references to the added rows, and make sure columns that should have unique values (such as the forcehostile/forcefriendly columns in spells.2da) have proper values in their new context. It's intended to save some data entry time when merging 2da's, not to solve all problems with the click of a button. :)

 

Please note: This is not a mod compatibility-fixing tool for mod users. It's a tool to help mod-makers merge together 2DA data. Use one of the mod installer utilities if you want to reduce mod compatibility problems for users.

 

From what I have tested it appears to work, though I have only tested it with a few different 2DAs and a fairly small set of changes, so it is possible that I have overlooked something. If anyone is interested you can get it here.

Link to comment
Share on other sites

Stoffe when it comes to merging fields between 2 2da's does it check versus the ones in the bif files to determine which entries to overwrite?

 

The reason I ask is how would it handle a situation where 2 mods both change the entries in something like the modeln columns and neither of the entries match the original entrie located in 2da.bif.

Link to comment
Share on other sites

when it comes to merging fields between 2 2da's does it check versus the ones in the bif files to determine which entries to overwrite?

 

The reason I ask is how would it handle a situation where 2 mods both change the entries in something like the modeln columns and neither of the entries match the original entrie located in 2da.bif.

 

Since my KEY/BIF reader class isn't finished yet it will currently ask the user for an unaltered copy of the 2da file (which you'll have to extract manually with KotorTool) in addition to the two files which are to be merged. This file will be used as a reference to determine what has changed, and as a base template for the new, merged file.

 

When the two files merged alter the exact same value/cell of one of the standard lines in the 2DA file, the changes done in the second selected file will take precedence, and a message will be posted in the progress log box where the user can see what it has done.

 

When two files that both add new lines are merged, the lines in the first selected file are first added, and are then followed by the lines from the second selected file, which will have the row labels automatically changed if they are already used by the lines added from the first file.

 

Same with merging two files which both have custom columns, those in the first file are added first, then followed by those in the second file.

 

When you merge two files where one adds a column and the other adds new rows, the values for the extra rows from the other file will be set to the standard **** in the new column, since they have no values that can be merged (since the column doesn't exist in that file). The standard lines, and any custom lines set in the file with the new column, will have the values properly set for the new column.

Link to comment
Share on other sites

Thank you for that feedback Stoffe. You mentioned your key/bif reader have you downloaded the Source code for Torlacks Tools at his website? The reason I ask is it has given me bounds of insight into further understanding the file formats from a programatic perspective.

 

*I'm not using his source directly. Instead I'm using it to figure out how to build my own foundation taking a much more generic approach.*

Link to comment
Share on other sites

Thank you for that feedback Stoffe. You mentioned your key/bif reader have you downloaded the Source code for Torlacks Tools at his website? The reason I ask is it has given me bounds of insight into further understanding the file formats from a programatic perspective.

 

No, as I'm a rather poor excuse for a programmer and my knowledge C/C++ is rudimentary at best. I'd probably be more confused than helped by reading code written by a programmer of his caliber. I prefer using higher level languages (Delphi, C#...) to get something done. :)

 

And half the fun is doing things yourself. I tend to be rather good at needlessly reinventing the wheel only for the satisfaction of (hopefully) managing to do something that actually works in the end. ;)

Link to comment
Share on other sites

No, as I'm a rather poor excuse for a programmer and my knowledge C/C++ is rudimentary at best. I'd probably be more confused than helped by reading code written by a programmer of his caliber. I prefer using higher level languages (Delphi, C#...) to get something done. :)

 

Hey I'm a poor excuse as well However I can also admit when I'm in over my head. Especially since I'm trying to relearn programming and diving in feet first into Game engine development and ignoring all of the small stuff untill I need to understand it. Delphi = Pascal Which is simply a simplified C++. :D Or at least that is how I came to understand C/C++ easier.

Link to comment
Share on other sites

Can we merge two 2da files and then make it into one, then merge the already merged 2da file with another?

 

There shouldn't be any problem doing so that I can see. The Merge utility wouldn't know the difference between a file that has been created manually or one that has been joined from two other files before. It's just a 2da file as far as it's concerned. :)

Link to comment
Share on other sites

Simply put... I am in awe :worship:

 

You do realize that you've made my life 1000% easier right? ;)

 

I'm going to give this thing a good work out this weekend (I have the perfect project for this), so expect some feedback in the future :D

 

You're my newest hero stoffe, I'm your forever stalker .. err... fan :D hehehe...

Link to comment
Share on other sites

Another Wonderful Utility Tool from Stoffe~mkb~ :D :D :D

 

Absolutely wonderful Stoffe :thumbsup: I can't wait to start another project and give your new utility tool a whirl :D You never cease to amaze us with your wonderful tools and mods!!! Don't know which gaming forums you came from before joining here BUT I'm SOOOOOO glad you did :D

 

:ben:

General Kenobi

_______________________________________________________

@Darth333

Hey how abouts addin' this bad girl to the tools page for us? It would be kewl in case we ever lost the thread here to have it over on StarWarsKnights.com as well. :D

Link to comment
Share on other sites

Simply put... I am in awe :worship:

You do realize that you've made my life 1000% easier right? ;)

 

I'm going to give this thing a good work out this weekend (I have the perfect project for this), so expect some feedback in the future :D

 

You're my newest hero stoffe, I'm your forever stalker .. err... fan :D hehehe...

 

:D Thanks for the warm praise, though perhaps it would've be best to wait until you see if the utility actually works. :p If you run into any problems, let me know and I'll see if I can fix them.

 

 

@General Kenobi: Thanks! I've been mostly lurking on some forums before. I usually don't participate as much as I have here, most forums aren't this friendly. :) Let me know if things seem to work when/if you try the utility out.

Link to comment
Share on other sites

How much time I would have saved if this utility was made before *sigh*

But now I can merge many other mods easily without losing time and again: thank you Stoffe for sharing ever more useful nice things! :D

 

P.S. What a shame that I haven't continued programming with Delphi, that was also my favorite tools for making my own small program. ;)

Link to comment
Share on other sites

How much time I would have saved if this utility was made before *sigh*

But now I can merge many other mods easily without losing time and again: thank you Stoffe for sharing ever more useful nice things! :D

 

Well, nobody asked for it before (as far as I know) and I didn't need it myself until recently. :)

 

Just remember that this isn't the "Ultimate One Click Mod Compatibility Tool". It just merges custom values between the two files. Depending on what kind of files you merge you may still need to do some manual adjustments (such as the forcehostile/forcefriendly columns in spells.2da). But hopefully it will save some typing at least. :)

 

* * *

 

If a moderator read this: Since nobody has informed me of any bugs and I haven't spotted any more myself yet, perhaps this thread should be moved to the Tools forum instead for archival? :stick:

Link to comment
Share on other sites

If a moderator read this: Since nobody has informed me of any bugs and I haven't spotted any more myself yet, perhaps this thread should be moved to the Tools forum instead for archival? :stick:

Done & Done! :D

 

Wasn't sure if you wanted to leave the title as is.. but I think you can fix that now in here ;)

 

The tool is working absolutely fabulously. I'm still on the project I was using it for, so hopefully I can give you some better feedback later.. but so far, nothing "negative" to report :)

Link to comment
Share on other sites

  • 7 months later...
  • 4 months later...
Erm, what exactly does unaltered standard copy of 2da mean? I'm trying to merge USM and greatsabers. Which would be the unaltered standard copy?

 

It means a clean copy of the 2DA file from the game data that has not been modified by any mods. You can extract it from 2da.bif with KotorTool. The utility needs this file to be able to determine which fields have been modified by either of the two modded 2DA files you want to merge.

Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...
  • 2 years later...

^^^ Did you use the vanilla .2da from your vanilla game files, by extracting the .2da you want to merge from 2da.bif?

 

This is essential... If you did this step, then I am not sure what your issue might be, although I would suspect that you are running Vista or Win7 OS... Could be a rights/privileges thing, make sure that when doing anything KoTOR related on a Vista/7 rig, that you do the same steps for modding things that you did to properly install your game.

Link to comment
Share on other sites

  • 7 months later...

Changing the default font size to 125% in Windows 7 seems to cause problems for ChangeEdit. I've encountered similar problems with other programs before, but with ChangeEdit certain vital buttons are not shown at all and resizing the window in any manner doesn't fix it. Of course, switching back to 100% or even 150% if your eyes can stand it resolves the problem. I just figured I'd post here in case anyone else encounters the same issue and doesn't realize this, and also on the off chance that stoffe decides to address it at some future point, in a rare moment of free time. :)

Link to comment
Share on other sites

  • 2 years later...
Last version: Click

 

In case someone else would find it useful I have uploaded a modified version of my small 2DA converter utility which now contains a new 2DA file merging function.

 

It will take two 2DA files (of the same kind) and merge changes they contain and save the combined result as a new 2DA file. It will currently detect changes to existing lines as well as new lines and columns that have been added. It will not handle files where standard lines have been deleted (since the 2DA spec. strongly discourages deleting rows in a 2DA anyway).

 

Row labels will automatically be updated to be unique, but all other data is just merged together from the files. Thus you'll still need to check/update references to the added rows, and make sure columns that should have unique values (such as the forcehostile/forcefriendly columns in spells.2da) have proper values in their new context. It's intended to save some data entry time when merging 2da's, not to solve all problems with the click of a button. :)

 

Please note: This is not a mod compatibility-fixing tool for mod users. It's a tool to help mod-makers merge together 2DA data. Use one of the mod installer utilities if you want to reduce mod compatibility problems for users.

 

From what I have tested it appears to work, though I have only tested it with a few different 2DAs and a fairly small set of changes, so it is possible that I have overlooked something. If anyone is interested you can get it here.

 

As great as this is, it is no longer available. Do you think there is a way you could put in on a new site so that people can download it again.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...