There are a few things that experienced folks could do that would help. The easiest one would be to install the entire mod on a Tutu install, and decompile all dialogs. Install the mod on a BG:EE install, and decompile all the dialogues. Run crosscheck on each pairing using any diff tool available (WinMerge, cygwin, you name it) and send the results to me.
For people who are interested in what works in the current state, getting the version linked above to install on BGEE required me to remove a few lines from the tp2, namely the ones dealing with the conv_tra.bat. Once that was done it installed smoothly and seemingly without errors.
@Shin Would you care to explain why you had to remove that part, please? Was there an error? Which one then? I tried an installation in English and there was no problem with the conversion process.
I believe this conversion may be mandatory for English too. Some texts in BG1 NPC use special characters, including é ("fiancée" in Coran and Ajantis love talks, for instance) and several word processing versions of ', ", - and ... in a single character. It is not clear which character(s) encoded in CP1252 make the game crash. Failure to convert them in UTF8 may lead your game to crash. Try creating X#SUCRIN with the console and see if the game properly displays the identified description of that item (there is a special "..." character before "Obviously").
I think I found the issue with the current conversion process.
Technically, there was a change to use STRING_EQUAL_CASE instead of STRING_COMPARE_CASE (considered obsolete) but the test result was not inverted as it should be. As a consequence, on Windows, the check for Windows was failing while the test for Linux was succeeding, hence the Linux script was run. It worked on my computer because git is installed and comes with a Linux shell that was used for that process.
Here is a new version of that part of the tp2: ACTION_DEFINE_ASSOCIATIVE_ARRAY languageencoding BEGIN
"english" => "CP1252"
"french" => "CP1252"
"spanish" => "CP1252"
END
OUTER_SPRINT initialencoding ~~
ACTION_PHP_EACH languageencoding AS lang => encoding BEGIN
ACTION_IF ("%LANGUAGE%" STRING_EQUAL_CASE ~%lang%~ = 1) THEN BEGIN
OUTER_SPRINT initialencoding ~%encoding%~
END
END
// Isaya: check for existence of BG1NPC/TRA/%LANGUAGE%/BG1NPC.tra as a marker that the mod
// has already installed at least one component, so conversion is already done, in order
// to avoid repeating for each component (as a backup of all tra files is then done in each
// subdirectory of backup)
// This is a handy trick with BG1 NPC, since BG1NPC.tra is created when the mod is installed
// and removed with the mod. But it cannot be used as a generic trick for other mods.
ACTION_IF NOT (FILE_EXISTS_IN_GAME ~bg1npc/tra/%LANGUAGE%/BG1NPC.tra~) AND
(STRING_LENGTH ~%initialencoding%~ != 0) THEN BEGIN
ACTION_IF ("%WEIDU_OS%" STRING_EQUAL_CASE ~WIN32~ = 1) THEN BEGIN
// Only convert for the language selected by passing the directory as parameter
PRINT ~Windows conversion with %initialencoding%~
AT_NOW ~bg1npc/conv_tra.bat %LANGUAGE% %initialencoding%~
END
ACTION_IF ("%WEIDU_OS%" STRING_EQUAL_CASE ~OSX~ = 1) OR ("%WEIDU_OS%" STRING_EQUAL_CASE ~UNIX~ = 1) THEN BEGIN
// Only convert for the language selected by passing the directory as parameter
PRINT ~Linux and Mac conversion with %initialencoding%~
AT_NOW ~bg1npc/conv_tra.sh %LANGUAGE% %initialencoding%~
END
I will upload the fix to Github and submit it to @cmorgan shortly.
If you still face problem with this code, please open the SETUP-BG1NPC.DEBUG file with a text editor and paste the traces (close to the beginning of the file) that look like that: Install Component [The BG1 NPC Project: Required Modifications]?
[I]nstall, or [N]ot Install or [Q]uit?
Installing [The BG1 NPC Project: Required Modifications] [v21_PRERELEASE_1]
BIFF may be in hard-drive CD-path [./lang/en_us/DATA/DIALOG.BIF]
BIFF may be in hard-drive CD-path [./cache/DATA/DIALOG.BIF]
[./DATA/DIALOG.BIF] 1322876 bytes, 1234 files, 0 tilesets
BG:EE install detected.
Windows conversion with CP1252
MOVE [bg1npc/tra/english/bg1npc_tmp.tra_utf8] [bg1npc/tra/english/bg1npc_tmp.tra]: destination exists, falling back to COPY_LARGE
Copying 1 file ... This will help identifying why the conversion is failing.
I made several test with characters encoding in dialog and item description. I confirm that special characters used in BG1 NPC in english will crash the game. I added those characters to the Imoen dialog in Beregost to check.
fiancée crème ‘ ’ “ ”
There are common in dialogs in BG1 NPC. The game freezes when the text should be displayed, although the "initial meeting" voice from Imoen that triggers anytime she starts a conversation continues to play. Conversion to UTF8 is therefore required for English language as well.
Okay, I'm a total noob at this, and haven't done [i]any[/i] previous modding of BG at all. These are the steps I've done so far:
1. Extracted the github file to C:\Program Files (x86)\Steam\SteamApps\common\Baldur's Gate Enhanced Edition\BG1NPC-master 2. Removed the lines of code as Shin advised 3. Downloaded the latest version of WeiDU (which is a tool I'm not really familiar with)
@Isaya Hm.. when creating the ring the description kind of works - it doesn't crash, but a letter between "demon lords" and "Obviously" is missing, probably the "..." you mention. Also, the icon for the item doesn't display. According to the file it uses _IRING17.BAM, but I can't find that file neither in my override nor among the bg1npc folder files. It seems like it should be in the phase2\itm folder, but it isn't.
However, I've had crashes related to certain characters happen in some past games, most often the ô symbol in the ninjatô proficiencies and items I believe - had to replace every such letter in dialog.tlk to get rid of it.
As for the install error, what would happen was that Windows would prompt me that it couldn't open the file conv_tra.sh and that I needed to select or search for a program to do so. It turned out to be a text file, but even when assigning a text editor to open it, the installation process would get an error related to unix and the "$file"_utf8 thing iirc (I am on Win7).
I think I found the issue with the current conversion process.
Technically, there was a change to use STRING_EQUAL_CASE instead of STRING_COMPARE_CASE (considered obsolete) but the test result was not inverted as it should be. As a consequence, on Windows, the check for Windows was failing while the test for Linux was succeeding, hence the Linux script was run. It worked on my computer because git is installed and comes with a Linux shell that was used for that process.
Right, that could very well be it. Was wondering why I was getting a unix error.
Okay, I'm a total noob at this, and haven't done [i]any[/i] previous modding of BG at all. These are the steps I've done so far:
1. Extracted the github file to C:\Program Files (x86)\Steam\SteamApps\common\Baldur's Gate Enhanced Edition\BG1NPC-master 2. Removed the lines of code as Shin advised 3. Downloaded the latest version of WeiDU (which is a tool I'm not really familiar with)
What do I do next?
Essentially you put weidu.exe in your main directory (where baldur.exe) is and rename it to setup-bg1npc.exe, then you run it. However, if Isaya's fix listed above makes the install work without removing lines from the tp2, that should be even better.
@Alexis Not sure.. I'm not very well-versed with the steam version, but it seems the weidu installation process doesn't really get started. I would guess that some files aren't where they're supposed to be. Do you have bg1npc.tp2 in the same directory?
I made several test with characters encoding in dialog and item description. I confirm that special characters used in BG1 NPC in english will crash the game. I added those characters to the Imoen dialog in Beregost to check.
fiancée crème ‘ ’ “ ”
There are common in dialogs in BG1 NPC. The game freezes when the text should be displayed, although the "initial meeting" voice from Imoen that triggers anytime she starts a conversation continues to play. Conversion to UTF8 is therefore required for English language as well.
They don't play well in other translations, too, which is a good reason modders should not be using word processor programs to create .d files; they tend to convert period period period into elipse (... as three dots versus ... as one character).
I will add a mass find and replace of special characters in project to the worklogs, and a recheck of _IRING17.BAM as if it is installing as that file. In my own modding, I try to use COPY_EXISTING and patch in what I want, which makes it easier as all the references are guaranteed right, but BG1NPC has a number of custom items whose BAMs and descriptions may or may not work (most were created on Tutu, and even after all these years of BGT and two full teams searching for missapplied Tutu references we occasionally hit one.
fiancée crème may be a problem, but I will ping Jastey and ask exactly how critical it is to use those.
@cmorgan If you don't mind using an UTF8 conversion for English as well (I did this in the latest update of the tp2), you can save all this search and replace work. I found fiancé/fiancée in several files, not only Ajantis. And it's Edwin that uses "a la crème" (to be perfect French, it should be "à la crème", actually). Why would you want to get rid of them, don't you like this little French influence ? ;-)
Regarding the BAM file, it's not that the file is not copied but rather icons for ground or description are refering to Tutu names. In the tp2, when X#SUCRIN.ITM is installed, there is a test on BGT to replace some BAM references in the item, IRING17 in this case. I believe this is not something that was unoticed with BGT. It looks like references used for BGT are present in BGEE (I checked for the two BAM files used by X#COAMUL and X#SUCRIN and a few others), I think they may come straight from BG1 actually. Adapting to BGEE could be a matter of replacing PATCH_IF (~%tutuorbgt%~ STRING_COMPARE_CASE ~BGT~ = 0) THEN BEGIN with PATCH_IF (~%tutuorbgt%~ STRING_COMPARE_CASE ~BGT~ = 0) OR (~%tutuorbgt%~ STRING_COMPARE_CASE ~~ = 0) THEN BEGIN There are several other cases where this test is made to patch creatures regarding scripts, for instance, or even portraits for NPC creatures created for some romance scenes or the challenge.
You're right to say that there are many details to check before BG1 NPC is released without beta status.
Regarding the BAM file, it's not that the file is not copied but rather icons for ground or description are refering to Tutu names. In the tp2, when X#SUCRIN.ITM is installed, there is a test on BGT to replace some BAM references in the item, IRING17 in this case. I believe this is not something that was unoticed with BGT.
Ah, of course.. it was just meant to refer to an already existing bam, just without the _ in the name.
You're right to say that there are many details to check before BG1 NPC is released without beta status.
I would agree in terms of official release. Still, for people like me who remain hesitant to play BG1 without the NPC project, having a somewhat workable beta where you can (barring complete game-breakers) hopefully fix most issues as you go along is tremendously preferrable to having nothing at all and thus not really being able to start a playthrough.
Regarding the BAM file, it's not that the file is not copied but rather icons for ground or description are refering to Tutu names. In the tp2, when X#SUCRIN.ITM is installed, there is a test on BGT to replace some BAM references in the item, IRING17 in this case. I believe this is not something that was unoticed with BGT.
Ah, of course.. it was just meant to refer to an already existing bam, just without the _ in the name.
You're right to say that there are many details to check before BG1 NPC is released without beta status.
I would agree in terms of official release. Still, for people like me who remain hesitant to play BG1 without the NPC project, having a somewhat workable beta where you can (barring complete game-breakers) hopefully fix most issues as you go along is tremendously preferrable to having nothing at all and thus not really being able to start a playthrough.
I'm with you man, I just wish I had your understanding of all this modding code lol. If you happen to get a mostly stable BG1 NPC up and running using these fixes and workarounds you've been talking about, post it up for the rest of us please Hopefully it doesn't go way over our heads lol
@StoneSwords Here's a tp2 with @Isaya's altered code inserted. Replace the regular one with this and attempt to install. Ideally it will get you started, but there's obviously no telling what will and won't work as you progress.
I tried all the above methods and it installs and the trigger hit but there's no actual dialogue, just a bunch of lines marked invalid. Unfortunate. Do you think this has something to do with the fact that I have the steam version? Or do I just have to wait for the official release?
For people who are interested in what works in the current state, getting the version linked above to install on BGEE required me to remove a few lines from the tp2, namely the ones dealing with the conv_tra.bat. Once that was done it installed smoothly and seemingly without errors.
...
- Player-iniated talking works on Imoen, Khalid, Jaheira and Xzar, but will cause Montaron to leave the party (along with Xzar). Doesn't work on Neera obviously.
I had this problem with Monty without BG1NPC installed. Its his HappinessLT trigger. If you look in the MONTARJ.DLG file with Near Infinity, Monty's happiness trigger for leaving the party in disgust is set for 0:
HappinessLT(Myself,0) InParty("Xzar")
This means that he will leave if your reputation is > 10. By contast, Xzar's trigger is set for -290:
HappinessLT(Myself,-290) InParty("Montaron")
So, he won't leave in disgust until a 19 reputation.
I'm guessing this is a general bug with MONTARJ.DLG in BGEE.
@AstroBryGuy Ah, interesting. I've modified the game so NPCs won't leave due to reputation, but mayhap Montaron's trigger combined with initiating dialogue still leads to it.
@AstroBryGuy Ah, interesting. I've modified the game so NPCs won't leave due to reputation, but mayhap Montaron's trigger combined with initiating dialogue still leads to it.
If you're using the "Happy Patch" from BG2 Tweaks with the "angry but don't leave" option for NPCs, the "unhappiness" scores max out at -160. This would prevent Xzar (or other NPCs) from leaving, since his break point is -290, but not Montaron, since his break point is 0.
@cmorgan If you don't mind using an UTF8 conversion for English as well (I did this in the latest update of the tp2), you can save all this search and replace work. I found fiancé/fiancée in several files, not only Ajantis. And it's Edwin that uses "a la crème" (to be perfect French, it should be "à la crème", actually). Why would you want to get rid of them, don't you like this little French influence ? ;-)
Adapting to BGEE could be a matter of replacing PATCH_IF (~%tutuorbgt%~ STRING_COMPARE_CASE ~BGT~ = 0) THEN BEGIN with PATCH_IF (~%tutuorbgt%~ STRING_COMPARE_CASE ~BGT~ = 0) OR (~%tutuorbgt%~ STRING_COMPARE_CASE ~~ = 0) THEN BEGIN There are several other cases where this test is made to patch creatures regarding scripts, for instance, or even portraits for NPC creatures created for some romance scenes or the challenge.
I am fine leaving things with Les Influences Francais mais je ne sais pas le challenges les jouers internationale doit embrace... I definitely want to run the english out as UTF-8, I just want to make sure the project is uniform for folks who will need to change encoding for localized materials. I defer to your judgement - I'll leave the accents in place!
I agree, the PATCH_IF sections all need to be altered to observe bgee|tutu|bgt , and in most cases the bgee should equal bgt. Unfortunately, not all - we need to use K'aeloree's library or revamp ours with Wisp's "one library to candle cmp vars" approach. Basically, expand what we do on Tutu/BGT to add the variants for BG:EE, most of which just means remapping the original, non-Tutu'd, non_BGT'd install.
I've installed the pre-beta NPC project (woo!). I want to find a way to quickly tell whether it's working. Does anyone know the earliest point in the game where the NPC project changes something?
@Alexis Imoen will react when you pick up the letter on Gorion's body, saying she is sorry and such.
@AstroBryGuy Aye, I edited the values here and it did the trick, the player-initiated NPC Project dialogue seems to work for Montaron as well now. Good insight there.
@jimw884 Not sure what you mean by "the trigger hit", nor what kinds of errors you are having. I don't know much about the steam version, but it's possible that it places dialog.tlk (which is usually the file that's messed up when the dialogues don't work) in another place.
Comments
EasyTuTu and bg1npc_v20
BGEE and bg1npc from link https://github.com/cmorganbg/BG1NPC
I can't use any diff tool
I tried an installation in English and there was no problem with the conversion process.
I believe this conversion may be mandatory for English too. Some texts in BG1 NPC use special characters, including é ("fiancée" in Coran and Ajantis love talks, for instance) and several word processing versions of ', ", - and ... in a single character. It is not clear which character(s) encoded in CP1252 make the game crash. Failure to convert them in UTF8 may lead your game to crash.
Try creating X#SUCRIN with the console and see if the game properly displays the identified description of that item (there is a special "..." character before "Obviously").
Technically, there was a change to use STRING_EQUAL_CASE instead of STRING_COMPARE_CASE (considered obsolete) but the test result was not inverted as it should be. As a consequence, on Windows, the check for Windows was failing while the test for Linux was succeeding, hence the Linux script was run. It worked on my computer because git is installed and comes with a Linux shell that was used for that process.
Here is a new version of that part of the tp2:
ACTION_DEFINE_ASSOCIATIVE_ARRAY languageencoding BEGIN "english" => "CP1252" "french" => "CP1252" "spanish" => "CP1252" END OUTER_SPRINT initialencoding ~~ ACTION_PHP_EACH languageencoding AS lang => encoding BEGIN ACTION_IF ("%LANGUAGE%" STRING_EQUAL_CASE ~%lang%~ = 1) THEN BEGIN OUTER_SPRINT initialencoding ~%encoding%~ END END // Isaya: check for existence of BG1NPC/TRA/%LANGUAGE%/BG1NPC.tra as a marker that the mod // has already installed at least one component, so conversion is already done, in order // to avoid repeating for each component (as a backup of all tra files is then done in each // subdirectory of backup) // This is a handy trick with BG1 NPC, since BG1NPC.tra is created when the mod is installed // and removed with the mod. But it cannot be used as a generic trick for other mods. ACTION_IF NOT (FILE_EXISTS_IN_GAME ~bg1npc/tra/%LANGUAGE%/BG1NPC.tra~) AND (STRING_LENGTH ~%initialencoding%~ != 0) THEN BEGIN ACTION_IF ("%WEIDU_OS%" STRING_EQUAL_CASE ~WIN32~ = 1) THEN BEGIN // Only convert for the language selected by passing the directory as parameter PRINT ~Windows conversion with %initialencoding%~ AT_NOW ~bg1npc/conv_tra.bat %LANGUAGE% %initialencoding%~ END ACTION_IF ("%WEIDU_OS%" STRING_EQUAL_CASE ~OSX~ = 1) OR ("%WEIDU_OS%" STRING_EQUAL_CASE ~UNIX~ = 1) THEN BEGIN // Only convert for the language selected by passing the directory as parameter PRINT ~Linux and Mac conversion with %initialencoding%~ AT_NOW ~bg1npc/conv_tra.sh %LANGUAGE% %initialencoding%~ END
I will upload the fix to Github and submit it to @cmorgan shortly.
If you still face problem with this code, please open the SETUP-BG1NPC.DEBUG file with a text editor and paste the traces (close to the beginning of the file) that look like that:
Install Component [The BG1 NPC Project: Required Modifications]? [I]nstall, or [N]ot Install or [Q]uit? Installing [The BG1 NPC Project: Required Modifications] [v21_PRERELEASE_1] BIFF may be in hard-drive CD-path [./lang/en_us/DATA/DIALOG.BIF] BIFF may be in hard-drive CD-path [./cache/DATA/DIALOG.BIF] [./DATA/DIALOG.BIF] 1322876 bytes, 1234 files, 0 tilesets BG:EE install detected. Windows conversion with CP1252 MOVE [bg1npc/tra/english/bg1npc_tmp.tra_utf8] [bg1npc/tra/english/bg1npc_tmp.tra]: destination exists, falling back to COPY_LARGE Copying 1 file ...
This will help identifying why the conversion is failing.
I made several test with characters encoding in dialog and item description. I confirm that special characters used in BG1 NPC in english will crash the game. I added those characters to the Imoen dialog in Beregost to check. There are common in dialogs in BG1 NPC. The game freezes when the text should be displayed, although the "initial meeting" voice from Imoen that triggers anytime she starts a conversation continues to play.
Conversion to UTF8 is therefore required for English language as well.
1. Extracted the github file to C:\Program Files (x86)\Steam\SteamApps\common\Baldur's Gate Enhanced Edition\BG1NPC-master
2. Removed the lines of code as Shin advised
3. Downloaded the latest version of WeiDU (which is a tool I'm not really familiar with)
What do I do next?
Also, the icon for the item doesn't display. According to the file it uses _IRING17.BAM, but I can't find that file neither in my override nor among the bg1npc folder files. It seems like it should be in the phase2\itm folder, but it isn't.
However, I've had crashes related to certain characters happen in some past games, most often the ô symbol in the ninjatô proficiencies and items I believe - had to replace every such letter in dialog.tlk to get rid of it.
As for the install error, what would happen was that Windows would prompt me that it couldn't open the file conv_tra.sh and that I needed to select or search for a program to do so. It turned out to be a text file, but even when assigning a text editor to open it, the installation process would get an error related to unix and the "$file"_utf8 thing iirc (I am on Win7).
You wait for the BG: EE compatible version to be released.
However, if Isaya's fix listed above makes the install work without removing lines from the tp2, that should be even better.
I got this message, is it an error?
Conversion to UTF8 is therefore required for English language as well.
They don't play well in other translations, too, which is a good reason modders should not be using word processor programs to create .d files; they tend to convert period period period into elipse (... as three dots versus ... as one character).
I will add a mass find and replace of special characters in project to the worklogs, and a recheck of _IRING17.BAM as if it is installing as that file. In my own modding, I try to use COPY_EXISTING and patch in what I want, which makes it easier as all the references are guaranteed right, but BG1NPC has a number of custom items whose BAMs and descriptions may or may not work (most were created on Tutu, and even after all these years of BGT and two full teams searching for missapplied Tutu references we occasionally hit one.
fiancée crème may be a problem, but I will ping Jastey and ask exactly how critical it is to use those.
I found fiancé/fiancée in several files, not only Ajantis. And it's Edwin that uses "a la crème" (to be perfect French, it should be "à la crème", actually). Why would you want to get rid of them, don't you like this little French influence ? ;-)
Regarding the BAM file, it's not that the file is not copied but rather icons for ground or description are refering to Tutu names. In the tp2, when X#SUCRIN.ITM is installed, there is a test on BGT to replace some BAM references in the item, IRING17 in this case. I believe this is not something that was unoticed with BGT.
It looks like references used for BGT are present in BGEE (I checked for the two BAM files used by X#COAMUL and X#SUCRIN and a few others), I think they may come straight from BG1 actually.
Adapting to BGEE could be a matter of replacing
PATCH_IF (~%tutuorbgt%~ STRING_COMPARE_CASE ~BGT~ = 0) THEN BEGIN
with
PATCH_IF (~%tutuorbgt%~ STRING_COMPARE_CASE ~BGT~ = 0) OR (~%tutuorbgt%~ STRING_COMPARE_CASE ~~ = 0) THEN BEGIN
There are several other cases where this test is made to patch creatures regarding scripts, for instance, or even portraits for NPC creatures created for some romance scenes or the challenge.
You're right to say that there are many details to check before BG1 NPC is released without beta status.
I would agree in terms of official release. Still, for people like me who remain hesitant to play BG1 without the NPC project, having a somewhat workable beta where you can (barring complete game-breakers) hopefully fix most issues as you go along is tremendously preferrable to having nothing at all and thus not really being able to start a playthrough.
Work harder nerds! My next playthrough awaits!
HappinessLT(Myself,0)
InParty("Xzar")
This means that he will leave if your reputation is > 10. By contast, Xzar's trigger is set for -290:
HappinessLT(Myself,-290)
InParty("Montaron")
So, he won't leave in disgust until a 19 reputation.
I'm guessing this is a general bug with MONTARJ.DLG in BGEE.
This file is based on the vanilla MONTAJ.DLG, so put it in your override folder before installing BG1NPC.
I agree, the PATCH_IF sections all need to be altered to observe bgee|tutu|bgt , and in most cases the bgee should equal bgt. Unfortunately, not all - we need to use K'aeloree's library or revamp ours with Wisp's "one library to candle cmp vars" approach. Basically, expand what we do on Tutu/BGT to add the variants for BG:EE, most of which just means remapping the original, non-Tutu'd, non_BGT'd install.
@AstroBryGuy Aye, I edited the values here and it did the trick, the player-initiated NPC Project dialogue seems to work for Montaron as well now. Good insight there.