Well, sure, there is no programmatic way to handle this that can't be potentially simplified by just doing a single WRITE_BYTE command.
On the other hand, with my experience, I can tell you that one byte rarely suffices. It happens sometimes, and it's a cause for celebration when that's all it takes, but its not the norm.
The example I gave was actually the -shorter- of the strings that Sam. needed. You gotta admit torturing that 20 byte string into the WRITE_LONGs was a pain enough all by itself, no? With tons of room for human error? (which in fact happened?)
You could hand me 20 search/replace strings to do in the engine - of ANY length - and I could set them all up and actually accurate and functional inside an hour. And able to patch either the 2CD or 4CD version of
PS:T, each of which has different offsets for the same functions. I know, cause I've done it, multiple times. I don't think that's possible with the WRITE_LONG method even if you were dealing with just 10 and 20 byte strings.
What we need to do now is confirm whether there are multiple versions of bgmain.exe out there that need to be accounted for. I'm fairly sure there are. But
PS:T is my playground,
BG2 is the forte of others, and I will let someone else determine it for sure. Once that's determined, I'll show how my macro can be set up so that it identifies which version is being used and patches it correctly accordingly.
Qwinn
Edited by Qwinn, 03 June 2009 - 12:46 PM.