Author Topic: Bug report - Xan's BG1 friendship path for BGEE  (Read 752 times)

Offline agb1

  • Planewalker
  • *****
  • Posts: 30
Bug report - Xan's BG1 friendship path for BGEE
« on: January 19, 2016, 08:44:28 AM »
I noticed this recently in a user's install log:

Setup-XanBG1Friend.exe --no-exit-pause --noautoupdate --language 0 --skip-at-view --quick-log --force-install-list 0 --logapp
[Setup-XanBG1Friend.exe] WeiDU version 23800
Using Language [English]

Using .\lang\en_us/dialog.tlk

Installing [Xan's friendship path for BG1] [v9bgee]

Windows conversion with CP1252
'bg1npc\iconv' is not recognized as an internal or external command,
operable program or batch file.

Copying 1 file ...
loading 1 tra file

The conv_tra.bat script in xanbg1friend folder references bg1npc\iconv instead of xanbg1friend\iconv:

:: Use a parameter to the script (%1) to specify the directory that must be converted
:: Use a parameter to the script (%2) to specify the encoding of the files to convert

:: Prevent display of DOS command lines
@echo off

if not exist xanbg1friend\%1\utf8 mkdir xanbg1friend\%1\utf8

:: Since the pattern matching in Windows considers that "fu.tra_utf8" also matches "*.tra", we have to
:: handle the file extension by ourselfves in order to avoid all those tra_utf8_utf8 etc files
:: Use %%~ni instead of %%~nxi (x is for extension) and specify the tra extension
for %%i in (xanbg1friend\%1\*.tra) do bg1npc\iconv -f %2 -t UTF-8 "xanbg1friend\%1\%%~ni.tra" > "xanbg1friend\%1\utf8\%%~ni.tra"

Rather than just fixing that script, I suggest switching to use the newer HANDLE_CHARSETS method, which would allow you to remove conv_tra.bat and conv_tra.sh.  Just replace the current ALWAYS block in xanbg1friend.tp2 with this:

ALWAYS
  ACTION_DEFINE_ASSOCIATIVE_ARRAY tra#charsets BEGIN
     "English" => "CP1252"
     "Russian" => "CP1251"
     "German" => "CP1252"
     "French" => "CP1252"
     "Italian" => "CP1252"
  END
  ACTION_DEFINE_ARRAY tra#reload BEGIN O#XanBG1 END
  LAF HANDLE_CHARSETS
    STR_VAR
       charset_table = tra#charsets
       tra_path        = EVAL ~%MOD_FOLDER%~
       iconv_path.    = EVAL ~%MOD_FOLDER%~
       reload_array  = tra#reload
  END
END

Edited to use original charsets table imstead of infer_charsets, just in case.
« Last Edit: January 22, 2016, 12:03:45 AM by agb1 »

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: