Posted by: Magus_BGforge
« on: April 22, 2017, 11:38:01 AM »thank you fro clarification
1. But weidu already has all the information about which files were loaded by LANGUAGE, and if they have been converted, right? In that case, I don't see the purpose of having reload_array variable in the first place, it only opens a human error possibility.WeiDU in the nebulous sense can re-arrive at which specific TRA files were loaded by LANGUAGE. The actions-n-patches code hasn't got the first clue. The trarefs just exist, and if they don't, that's an error. I can make reload_array obsolete, but it's a rather niche use-case and the long plan has kind of not been to rely on HANDLE_CHARSETS forever (but it certainly looks like it's going to be a long while).
3. What's the best practice for handling TRA currently, then? Supposing that I have multiple languages, multiple scripts and dialogs, and custom weidu prompts?Text that's destined for TLK should be put in a separate file from text that is used during the installation, so the files may be independently encoded. Apart from that, I think it's mostly personal preference. Yeah, I'd say a different TRA file for each D. More generally, I would advocate wise use of local scoping to avoid conflicts. For example, any time you might be tempted to use different integer ranges to avoid tra-space conflicts, you might instead want to use different files and, say, WITH_TRA.
Should TRA be split per dialog and loaded on COMPILE with AUTO_TRA? Setup and weidu prompts into no-convert separate files? And the rest of in-game text put into common "text.tra"?
AUTO_TRA ~%MOD_FOLDER%/tra/%s~
ALWAYS
ACTION_IF ENGINE_IS ~bgee bg2ee iwdee eet~ BEGIN
ACTION_DEFINE_ARRAY charsetsNoConvertArray BEGIN setup weidu END
ACTION_DEFINE_ARRAY charsetsReloadArray BEGIN text END
LAF ~HANDLE_CHARSETS~
INT_VAR
infer_charsets = 1
STR_VAR
tra_path = ~%MOD_FOLDER%/tra~
iconv_path = ~%MOD_FOLDER%/tools/iconv~
noconvert_array = charsetsNoConvertArray
reload_array = charsetsReloadArray
END
END
END
LANGUAGE ~English~ ~english~ ~%MOD_FOLDER%/tra/english/text.tra~ ~%MOD_FOLDER%/tra/english/setup.tra~ ~%MOD_FOLDER%/tra/english/weidu.tra~
LANGUAGE ~Deutsch~ ~german~ ~%MOD_FOLDER%/tra/german/text.tra~ ~%MOD_FOLDER%/tra/german/setup.tra~ ~%MOD_FOLDER%/tra/german/weidu.tra~