Jump to content

Trafying a Mod, Part 2: BGII and BGII:EE


cmorgan

Recommended Posts

UNDER CONSTRUCTION

SCRATCHSPACE - STILL NOT READABLE

 

Traifying your mod makes it possible for many different languages to get your content integrated into their game. But it comes with some interesting challenges.

 

BASICS

 

In your .tp2,

LANGUAGE

is set first. It provides a default set of materials that you declare. This is the foundation, read before anything else.

 

LANGUAGE can "hardcode" a list of .tras to pull from, so if something isn't found in .tra B, WeiDU will try to pull it from .tra A.

 

BGII vs BGII:EE

 

Isaya and Wisp have been working out some issues dealing with different dialog.tlks in different places, getting weidu to understand what a modder wants to add to, but one thing that has really not shown up before now in the english speaker modder community is the differences between languages and how they are encoded.

 

BGII = Windows-1252 aka cp1252

 

BGII:EE = UTF-8 (no BOM)

 

While you may *think* the page you are reading right now over the inter-webby-thingie actually exists, it is an interpretation of bytes. Encoding is telling your local browser what the heck they mean. So special characters encoded one way get displayed as something completely different in another setting.

 

[ display example of "ascii gone wild" here ]

 

Luckily, there are several ways of getting around this problem. One way is to convert all of your .tra files at install [REFERENCE ISAYA'S POST AND WORK HERE]

 

I have chosen to do a variant on what RR does [iNSERT EXAMPLE HERE]

 

 

and until there is a more stable solution, I am simply saving the master .tra file as two separate files.

 

[sHOW HOW TO CHANGE ENCODING ON .D HERE]

 

For these two .tras to get into the game and fight it out with each other,

 

1. Declare LANGUAGE with a "hardcoded" default (so the .tp2 can fall back on it) for that particular language

2. Override the default language in the ALWAYS block.

 

With two .tras, one in windows-1252 and the other in UTF-9 (no BOM)

ALWAYS
ACTION_IF GAME_IS ~bg2ee~ BEGIN
	OUTER_SPRINT tra_version ~c-aranw_utf8nb~
	LOAD_TRA ~aranw\tra\english\c-aranw_utf8nb.tra~
	LOAD_TRA ~aranw\tra\%LANGUAGE%\c-aranw_utf8nb.tra~
END ELSE BEGIN
	OUTER_SPRINT tra_version ~c-aranw_cp1252~
	LOAD_TRA ~aranw\tra\english\c-aranw_cp1252.tra~
	LOAD_TRA ~aranw\tra\%LANGUAGE%\c-aranw_cp1252.tra~
 END
END

LANGUAGE ~English~ ~English~ ~aranw\tra\english\c-aranw_cp1252.tra~

 

with entries that use USING within components, the ALWAYS block will load the wanted .tra, and we can make sure USING is looking correctly by referencing the variable set in the ALWAYS block above:

 

/* SoA dialog file */
COMPILE ~aranw/dialog/c-arandialog.d~
USING ~aranw/tra/%LANGUAGE%/%tra_version%.tra~

ACTION_IF GAME_IS ~bg2ee~ BEGIN
  COMPILE ~aranw/dialog/c-aranbg2ee_content.d~
	   USING ~aranw/tra/%LANGUAGE%/%tra_version%.tra~
END

 

[Why load tra]

 

[What order load tra]

 

[how does this change game]

 

[added special shell games, AKA kit descriptions on BG2/BGII:EE]

 

[Why MSWord and other WYSIWYG editors are not the best way of creating content]

Jedit, Notepad++, Crimson, et al - code editors and encodings and what word processing programs really do.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...