Jump to content

Effective way of BCS patching?


SimDing0

Recommended Posts

And while I'm on my spamming spree, I could also use an effective way of BCS patching, if anyone knows one.

REPLACE_BCS_BLOCK and APPLY_BCS_PATCH are both a total joke. DECOMPILE/COMPILE is awesome, but too vague for most applications of script patching, especially with longer scripts, unless combined with a newline regexp thingy. But the WeiDU readme doesn't mention that in the regexp section.

 

To illustrate, I'm basically looking at patch this to add a trigger:

IF
THEN
   RESPONSE #100
       Blahblah()
END

But I need to avoid adding the same trigger to EVERY block in the script, which is what'd happen if I did REPLACE_TEXTUALLY on the IF.

Link to comment
We *need* support for \n, especially if we want to eliminate the empty DO ~~ actions that are causing NI to report dlg files as corrupt. I think it's time to poke Wes.

Sorry to bump this up, but apparently you can already do limited matching for \r, \n, and \f, by embedding the control character directly into the expression. I'm not sure how practical this is, nor how reliable, but it actually does work for simple stuff:

 

COPY ~README-Tactics.txt~ ~temp~
 REPLACE_TEXTUALLY ~They all?aim~ ~Hey,?now!~

I'm not sure how Windows text editors will handle this, but in BBEdit, if you open the ASCII table palette, select the desired character (\x10 or \x13), and Command-click the insert button, the control code is inserted in the document (it will either not show up, or display as an upside-down question mark if you have Show Invisibles on). I used question marks in the above code to show where the character was inserted.

 

I checked with Unix line-breaks (\n, or \x10), and it does work (the text, newline, and following text were all replaced, and the newline in the replacement string was preserved). I couldn't do CR/LF, because BBEdit will simply insert a Macintosh CR line-break instead of the actual character (although I'm pretty sure there's a way around this).

 

It's pretty hackish, but it may work as a temporary solution...

Link to comment

It takes some getting used to, but it is workable. Using the Tactics read me as an example, I made a ReplaceTextually that turned every DOS (CR/LF) line-break into some garbage text (I used a hex editor to edit it, simply because it's easier typing 0x0d 0x0a, or 0x0a, than a normal editor).

 

After saving and running the Tp2, the result for the first three lines was

                             Baldur's Gate II<!--
THIS
IS
A
PLACEHOLDER
-->                         Tactics Modification Pack<!--
THIS
IS
A
PLACEHOLDER
-->    Westley Weimer <weimer@cs.berkeley.edu><!--
THIS
IS
A
PLACEHOLDER
-->                             \/ Release 22 \/<!--

So it may be workable, if Sim can't get japheth or Wes to do it the right way.

Link to comment

Archived

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

×
×
  • Create New...