Continuing now with Maltz et al. I have gathered the resources and adjusted the setup so that it all works for BGT as well. Here it is.
First, we need 5 new files to be delivered with UB which are missing on a BGT install. I uploaded them here:
http://1drv.ms/1j39O5pThose are the .cre and .d file for shop05 plus three .sto files. What these files are and where they go:
bg1ub\BGT\cre\bgshop05.cre -- This is shop05.cre extracted from BG/TotSC. Renamed for compatibility with BG2. Also changed its dialogue reference from shop05.dlg to bgshop05.dlg.
bg1ub\BGT\d\bgshop05.d -- Decompiled from shop05.dlg from BG/TotSC. Renamed for compatibility with BG2. Changed its three dialog StrRefs to new translation strings starting at @40158. See the addition to extra_tmp.tra below for the new strings.
bg1ub\BGT\sto\sto1116.sto -- Extracted from BG/TotSC. No alterations.
bg1ub\BGT\sto\tav0809.sto -- Extracted from BG/TotSC. No alterations.
bg1ub\BGT\sto\tav0810.sto -- Extracted from BG/TotSC. No alterations.
The .sto files are imported automatically thanks to COPY ~bg1ub/%tutuorbgt%/STO~ ~override~.
The .d file is imported/compiled automatically thanks to COMPILE ~bg1ub/%tutuorbgt%/D~.
The .cre file must be imported explicitly. I added the following code to the list of creature imports for BGT/Tutu at the beginning of the UB setup:
ACTION_IF ("%tutuorbgt%" STRING_EQUAL "BGT") THEN BEGIN //only BGT for now
COPY ~bg1ub/%tutuorbgt%/CRE/%tutu_scriptbg%SHOP05.CRE~ ~override~
SAY NAME1 @10179
SAY NAME2 @10179
SAY INITIAL_MEETING @10180
SAY DAMAGE @10181
SAY DYING @10182
SAY SELECT_COMMON1 @10183
SAY SELECT_COMMON2 @10184
SAY SELECT_COMMON3 @10185
END
Once this is made to work for Tutu as well, the first and last line can be removed if _shop05.cre is provided in bg1ub\Tutu\cre.
The new translation strings are added to extra_tmp.tra again, starting at @10179. See the addition to extra_tmp.tra below.
Now all the necessary resources are available in BGT. Next, the code for the Restoration component needs to be adjusted:
ACTION_IF GAME_IS ~bg1 totsc bgt~ THEN BEGIN
COPY_EXISTING ~%tutu_var%tav0810.sto~ ~override~ //Maltz' Weapon Shop
SAY NAME2 #11782 //Maltz' Weapon Shop
BUT_ONLY
COPY_EXISTING ~%tutu_var%tav0809.sto~ ~override~ //unused General Store
SAY NAME2 #11685
BUT_ONLY
COPY_EXISTING ~%SWBaldursGate_WeaponsStore2%.are~ ~override~ //Fix duplicate weapon store
PATCH_IF SOURCE_SIZE > 0x11c BEGIN
READ_LONG 0x54 actOff
FOR (READ_SHORT 0x58 numAct; numAct; numAct -= 1) BEGIN
READ_ASCII actOff + 0x80 actor
PATCH_IF (~%actor%~ STRING_EQUAL_CASE ~%tutu_scriptbg%SHOP03~ = 1) BEGIN
WRITE_EVALUATED_ASCII actOff + 0x80 ~%tutu_scriptbg%SHOP05~ #8
END
actOff += 0x110
END
END
BUT_ONLY
END
I made the following changes here: The GAME_IS check now includes BGT. tav0809.sto now gets assigned a name ("General Store" via #11685), which was actually missed by Miloch. And the changing of shop03 to shop05 didn't work because it used WRITE_ASCII instead of WRITE_EVALUATED_ASCII. Plus, I changed the variables from %tutu_var% to %tutu_scriptbg% to account for the BG prefix in BGT.
Next, I extended bg1ub\stores\cpm\ubstores.d:
REPLACE_ACTION_TEXT %tutu_var%maltz
~StartStore("\(%tutu_var%[Ss][Tt][Oo]1112\)",LastTalkedToBy(\(Myself\)?))~
~StartStore("%tutu_var%tav0810",LastTalkedToBy())~
REPLACE_ACTION_TEXT %tutu_scriptbg%shop01
~StartStore("\(%tutu_var%[Ss][Tt][Oo]1112\)",LastTalkedToBy(\(Myself\)?))~
~StartStore("%tutu_var%tav0809",LastTalkedToBy())~
REPLACE_ACTION_TEXT %tutu_scriptbg%shop05
~StartStore("\(%tutu_var%[Ss][Tt][Oo]1115\)",LastTalkedToBy(\(Myself\)?))~
~StartStore("%tutu_var%sto1116",LastTalkedToBy())~
REPLACE_ACTION_TEXT %tutu_var%alyth
~StartStore("%tutu_var%tav0721",LastTalkedToBy(\(Myself\)?))~
~StartStore("%tutu_var%tav0705",LastTalkedToBy())~
And finally, the following new translation strings are added to extra_tmp.tra:
For (bg)shop05.cre:
//#9408
@10179 = ~Storekeep~
//#4881
@10180 = ~Welcome to my humble establishment.~ [%tutu_var%STORE01]
//#12558
@10181 = ~~ [%tutu_var%STORE05]
//#12559
@10182 = ~~ [%tutu_var%STORE06]
//#4882
@10183 = ~Business has been poor, what with the iron shortage and all.~ [%tutu_var%STORE02]
//#4883
@10184 = ~The customer is always right.~ [%tutu_var%STORE03]
//#4884
@10185 = ~My prices are the best south of Waterdeep.~ [%tutu_var%STORE04]
For (bg)shop05.d:
//#15383
@40158 = ~Welcome to my shop. You are free to look about as you wish, but do try not to break anything.~
//#15384
@40159 = ~I shall proceed with due care and attention. What do you have to show me?~
//#15385
@40160 = ~You need not worry about your merchandise, as I was just leaving.~
jastey, can you make the official announcement for these translations?
Btw, as always in extra_tmp.tra, this is not really a translation job, because people only need to look up the strings in their version of BG/TotSC and copy them.
I've already done the German strings. To speed things up, I'm providing them right here:
//#9408
@10179 = ~Ladenbesitzer~
//#4881
@10180 = ~Willkommen in meinem bescheidenen Reich.~ [%tutu_var%STORE01]
//#12558
@10181 = ~~ [%tutu_var%STORE05]
//#12559
@10182 = ~~ [%tutu_var%STORE06]
//#4882
@10183 = ~Die Geschäfte laufen schlecht. Kein Wunder, bei der Eisenknappheit.~ [%tutu_var%STORE02]
//#4883
@10184 = ~Der Kunde hat immer recht.~ [%tutu_var%STORE03]
//#4884
@10185 = ~Meine Preise sind die besten südlich von Tiefwasser.~ [%tutu_var%STORE04]
//#15383
@40158 = ~Willkommen in meinem Laden. Seht Euch ruhig um, aber macht mir bitte nichts kaputt.~
//#15384
@40159 = ~Ich werde mit der entsprechenden Vorsicht und Sorgfalt vorgehen. Was könnt Ihr mir zeigen?~
//#15385
@40160 = ~Ihr braucht Euch keine Sorgen um Eure Ware zu machen. Ich wollte gerade gehen.~
That's it for BGT.