NdranC Posted August 28, 2020 Share Posted August 28, 2020 I've been running this code to change some weapon proficiencies: COPY_EXISTING ~weapprof.2da~ override COUNT_2DA_COLS cols READ_2DA_ENTRIES_NOW read_weapprof 0 FOR (col = 4; col < cols; ++col) BEGIN READ_2DA_ENTRY_FORMER read_weapprof 34 col val PATCH_IF (val == 3) BEGIN SET_2DA_ENTRY_LATER set_weapprof 34 col 4 END PATCH_IF (val == 2) BEGIN SET_2DA_ENTRY_LATER set_weapprof 34 col 3 END PATCH_IF (val == 1) BEGIN SET_2DA_ENTRY_LATER set_weapprof 34 col 2 END END FOR (row = 31; row < 34; ++row) BEGIN FOR (col = 4; col < cols; ++col) BEGIN READ_2DA_ENTRY_FORMER read_weapprof row col val PATCH_IF (val == 2) BEGIN SET_2DA_ENTRY_LATER set_weapprof row col 4 END PATCH_IF (val == 1) BEGIN SET_2DA_ENTRY_LATER set_weapprof row col 2 END END END SET_2DA_ENTRIES_NOW set_weapprof 0 BUT_ONLY This works as far as I can tell but it bugs me that the resulting file ends up with a misaligned table title text like so: 2DA V1.0 0 ID NAME_REF DESC_REF MAGE FIGHTER CLERIC LARGE_SWORD 0 8668 9589 0 5 I've tried many things to fix this, like setting the column requirement of READ_2DA_ENTRY_NOW to %cols% but it ends up the same. I'm learning to use weidu so any tips would be welcomed. Mostly concerned I'm doing something the wrong way. Quote Link to comment
argent77 Posted August 28, 2020 Share Posted August 28, 2020 Add PRETTY_PRINT_2DA after you're done modifying the 2DA file. Quote Link to comment
NdranC Posted August 28, 2020 Author Share Posted August 28, 2020 7 minutes ago, argent77 said: Add PRETTY_PRINT_2DA after you're done modifying the 2DA file. Sigh... thank you. Maybe I should re-read all of the weidu docs every so often. I was so focused on trying to ignore that row when reading/writing the 2da that I didn't consider is always going to happen. Quote Link to comment
Luke Posted July 24, 2021 Share Posted July 24, 2021 On 8/28/2020 at 10:03 PM, argent77 said: Add PRETTY_PRINT_2DA after you're done modifying the 2DA file. Somewhat related, though minor: as you may have noticed, after executing that command the various columns may end up quite a lot separated (see "SPLPROT.2DA", where "V1.0" is aligned with the "STAT" column. That's probably unnecessary since it's not a "real" column...) To sum up: I was wondering if there's a way to perform / execute what your NearInfinity calls "Align table"... Quote Link to comment
argent77 Posted July 24, 2021 Share Posted July 24, 2021 You can probably write a custom patch function that does the job for you. 2DA files are simple text files after all. Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.