Sam. Posted November 10, 2016 Share Posted November 10, 2016 Is there not a WeiDU command to simply append a line of text to the end of the file currently being patched? APPEND_OUTER is what I want, but I'm not allowed to use it to modify a file I'm already patching... I really do hate WeiDU syntax! Link to comment
Jarno Mikkola Posted November 10, 2016 Share Posted November 10, 2016 End of the file... nope, you don't want to do that... pretty sure about that... maybe the end of the description of the file you want to patch... cause those are not the same thing. Link to comment
agb1 Posted November 10, 2016 Share Posted November 10, 2016 Edit: I don't know. Jarno, can you clarify? I don't understand your post here. Link to comment
Mike1072 Posted November 10, 2016 Share Posted November 10, 2016 You can do this sort of thing with INSERT_BYTES. TEXT_SPRINT stuff_to_append ~blah blah blah~ INSERT_BYTES SOURCE_SIZE STRING_LENGTH (~%stuff_to_append%~) WRITE_ASCIIE SOURCE_SIZE ~%stuff_to_append%~ Link to comment
K4thos Posted November 10, 2016 Share Posted November 10, 2016 or you can use APPEND_FILE / APPEND_FILE_EVALUATE like this: <<<<<<<< .../append.txt blah blah blah >>>>>>>> COPY ~foo~ ~foo~ APPEND_FILE ~.../append.txt~ If you need to create the new file to append as a patch command too than you can use INNER_ACTION. COPY ~foo~ ~foo~ INNER_ACTION BEGIN <<<<<<<< .../append.txt blah blah blah >>>>>>>> END APPEND_FILE ~.../append.txt~ Link to comment
subtledoctor Posted November 10, 2016 Share Posted November 10, 2016 Ya, I use APPEND_FILE all the time, for example to add stuff to CLAB tables. It can be very convenient, depending on what exactly you are doing, because if you want to change what is appended you only need to change s short text file instead of digging through .tp2 code. Link to comment
subtledoctor Posted November 10, 2016 Share Posted November 10, 2016 Btw when appending to the end of a file, especially if it's a 2da file or similar, it's often a good idea to use Camdawg's "Remove Lines" routine right before the APPEND. https://github.com/subtledoctor/Scales_of_Balance/blob/master/scales_of_balance/lib/remove_lines.tpa Link to comment
Sam. Posted November 10, 2016 Author Share Posted November 10, 2016 Thanks all! You can do this sort of thing with INSERT_BYTES. TEXT_SPRINT stuff_to_append ~blah blah blah~ INSERT_BYTES SOURCE_SIZE STRING_LENGTH (~%stuff_to_append%~) WRITE_ASCIIE SOURCE_SIZE ~%stuff_to_append%~ WeiDU complained about the parenthesis, but in the end I was able to make this do what I wanted. Thanks again, Sam. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.