Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix for conversion to UTF8 process failing after the previous update #21

Merged
merged 1 commit into from

2 participants

@Isaya

Hi cmorgan,

Here is a fix for the UTF8 conversion process. The problem was I switched to STRING_EQUAL_CASE because STING_COMPARE_CASE is marked as legacy, without inverting the expected result as required by WeiDU (I missed the warning in the documentation). This made the Windows test fail but it worked on my computer as git installs a Linux shell that was used when conv_tra.sh was called.

I also included English in the set of languages as there are characters in some dialogs (such as fiancée in lovetalks) that will crash the game.
I checked intallation in French and English and, thanks to an additional trace, I'm sure it uses the proper script now.

Please excuse me for the error in the previous version.

@cmorganbg cmorganbg merged commit 2f2190d into cmorganbg:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 3 deletions.
  1. +6 −3 bg1npc.tp2
View
9 bg1npc.tp2
@@ -31,12 +31,13 @@ ACTION_IF FILE_EXISTS_IN_GAME ~neera.dlg~ THEN BEGIN
// BG:EE tra conversion
// Character encoding for BG II for various languages: ensure the name matches the menu choices
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%~ = 0) THEN BEGIN
+ ACTION_IF ("%LANGUAGE%" STRING_EQUAL_CASE ~%lang%~ = 1) THEN BEGIN
OUTER_SPRINT initialencoding ~%encoding%~
END
END
@@ -48,12 +49,14 @@ ACTION_IF FILE_EXISTS_IN_GAME ~neera.dlg~ THEN BEGIN
// 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~ = 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~ = 0) OR ("%WEIDU_OS%" STRING_EQUAL_CASE ~UNIX~ = 0) THEN BEGIN
+ 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
// Isaya: all tra files have to be renamed from .tra_utf8 to .tra!
Something went wrong with that request. Please try again.