Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Removing Duplicate Entries in a 2da file

Page: 1 of 1
 Sinapus
01-05-2007, 6:50 PM
#1
Apology: I did not find too much on this subject via searching, so if this has been covered before then I apologize.

Question: if you install multiple mods via the nifty TSLPatcher and then notice that it somehow duplicated entries in two of the 2da files, how would one safely remove those entries? Do I delete the extra entries and then change the numbering of the remaining ones to line up with each other? I'm not loading any saves, my next game will be starting completely from scratch with the current settings.

Explanation: Right now, my upcrystals.2da and upgrade.2da files have duplicate entries in them, and I'm not sure how.

Observation: Most disturbing. I'm typing like HK-47 talks. I think I'll stop here before I meltdown. :eekanime:
 PrimusPilus
01-05-2007, 6:57 PM
#2
Did it add new line numbers or do you have, for example, Line 515, followed by line 515? If that's the case then you should be able to delete one of the lines no problem. If not, you may run into conflicts because, with an armour replacement MOD for example, the .uti file references to the line number in the .2da file.
 stoffe
01-05-2007, 6:58 PM
#3
Question: if you install multiple mods via the nifty TSLPatcher and then notice that it somehow duplicated entries in two of the 2da files, how would one safely remove those entries?

If those duplicate lines originate from the same mod the author has probably forgotten the installer to check for already existing lines before adding new ones.

Anyway, it depends on what 2DA file it's about. If it is indexed by line number deleting lines is usually a very bad idea, unless you delete the last line in the file. Otherwise all the lines following the one you delete will get their indexing reshuffled, and all references to those lines from elsewhere will be messed up. This is why you will see plenty of unused lines, padded lines and dummy lines still present in 2DA files like feat.2da and spells.2da; Bioware/Obsidian couldn't safely delete them without the huge amount of work involved in making sure all references elsewhere are fixed as well. Easier to just pad out unused lines with **** in all columns in those cases.

Deleting lines from 2DA files indexed by the Row Label is safe to do, on the other hand.
 Sinapus
01-05-2007, 7:16 PM
#4
Are upcrystals.2da and upgrades.2da one of those "indexed by line number" files?

Hm.

Four asterisks?
 stoffe
01-05-2007, 7:24 PM
#5
Are upcrystals.2da and upgrades.2da one of those "indexed by line number" files?

Four asterisks?

I think they are indexed by line number, but I don't know for sure since I haven't been doing a whole lot of modding where those files are involved. If the Row Label column contains sequentially increasing numbers, and there are some padded dummy lines somewhere in the line that doesn't seem to serve any purpose then it's a sure bet it's line number indexed.

(If you have the patience it's fairly easy to figure out though. Just add a new line and set the Row Label to something different than the line number, and try to use that line for something. If the game crashes or malfunctions then you picked the wrong index. :))

**** is a special default value used in 2DA files that usually means that the column has no value set.
 Sinapus
01-05-2007, 7:30 PM
#6
Well, I checked the game copies of both files and there are no padded entries in them, though both have sequentially increasing numbers in Row Label column. I first noticed this when I was upgrading an armor and found duplicate copies of an overlay and an underlay the mod provided. When I used one of the upgrades, the number of upgrades available would go down by the same number.

If I looked for the upgrade in the party inventory, it would show up only once.

(...I could also save copies of both files in question to a safe place, then remove the duplicates, renumber the rows to line up again and see what happens.)
Page: 1 of 1