Back from dissection so if anyone can shed some light on what is happening here I'd apreciate it.
This is what I culled from a mod which I think assigns dialogue to a script file via the .tp2. (I really don't know WEIDU all that well)
COPY ~myfile/bcs/copy~ ~override~
REPLACE 999994 @1
REPLACE 999995 @2
REPLACE 999997 @3
REPLACE_TEXTUALLY 999996 ~%Sdrem%~
REPLACE 999998 @4
I figured out that the @ references are coming from the setup.tra files. but how does WEIDU know to assign each of the text strings properly to the DISPLAYOVERHEAD or DISPLAYSTRINGHEAD in the appropriate bcs? Does it know it from the first line to associate all the succeeding commands to that particular .baf/bcs file?
This method of coding is mostly obsolete and discouraged now, but back before WeiDU had things like script-compiling and the ability to insert text strings in compiled scripts and dialogue actions, the way to get new strings into a script was to put a placeholder strref value in there (like 99999) and then use TP2 REPLACE to replace that value with a string. WeiDU would add that string to the .tlk (so let's say it became strref 80001 in this example), and automatically take that new strref value and replace the 99999 with whatever the new value was (80001.)
And this REPLACE_TEXTUALLY, I've never seen this before. Is this is the WEIDU documentation so I can study it some more?
Everything is in the WeiDU docs at least a little bit.
REPLACE_TEXTUALLY does basically what it says: rather than trying to compile a new text string it literally just replaces one chunk of text with another. However, I can't immediately guess what's going on here and I don't recognize the code.
Suffice it to say that you really should avoid coding like this whenever possible. Generally you can just design your BAF with things like
IF
(blah)
THEN
RESPONSE #100
DisplayStringHead(@1)
END
and compile the BAF with a TRA file attached to it, and voila, @1 gets assigned from the TRA and you have a string.