Out of left field, I'm having problems with Camdawg's REMOVE_LINES function.
I use this a lot to append stuff to .2da files. While the APPEND action makes sure that the row count is correct, I often need to append things in a patch. Which means using APPEND_FILE. This is nice, in that I can edit the thing being appended by editing the external text file, instead of having to find the string in my .tp2 code. But it's also clunkier because Weidu doesn't manage line breaks. So I tend to do something like:
COPY_EXISTING ~the_clab.2da~ ~override~
LPM remove_blank_lines
APPEND_FILE ~might_and_guile/bardsong/clab_text.txt~
The remove_lines macro makes sure the .2da file has no blank line at the end; then my text files begin with a line break, and have the text to be appended on the 2nd line. Clunky, but it has been effective so far.
Until now. Now I'm occasionally seeing this:
ERROR: illegal 1-byte read from offset 9493 of 9493-byte file d5_bard.2da
ERROR: [d5_bard.2da] -> [override] Patching Failed (COPY) (Failure("d5_bard.2da: read out of bounds"))
I can't figure out what is causing it. The only way I've found to eliminate the (install-stopping) error is to eliminate the remove_lines order. But then some of the files end up with extra blank rows, which may (??) be problematic.
I'm at a loss. If anyone has a chance to take a look, you can grab v3.2 of my mod from here and try to install component 210. The .tpa for that component is in /might_and_guile/components (the remove_lines stuff is toward the bottom), and the text files being appended are in /might_and_guile/bardsong.
https://github.com/subtledoctor/Might_and_Guile