Jump to content


Photo

Traify tool


  • Please log in to reply
16 replies to this topic

#1 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 22 January 2011 - 10:51 AM

File Name: Traify tool
File Submitter: the bigg
File Submitted: 22 Jan 2011
File Updated: 02 Jan 2012
File Category: IE Modding Tools

This simple tool can be used to automate traification of a mod. It is a command-line tool and requires a copy of WeiDU, so they should be both put in your $PATH (or in your BG2 directory). Your mod should have translations packaged in mymod/tra/english, while its D, BAF etc. files can live anywhere in the mymod hierarchy (but outside of mymod/tra). Setup-mymod.tp2 should live inside mymod if you want it traified.

The program can be run in two modes.

If you want to just traify, run it like this:

traify mymod english

This will scan the mymod file hierarchy, skipping mymod/tra, and traifies every single *.d, *.baf, *.tp* it finds there, putting the traified file in its old position and the resulting tra in mymod/tra/english. Whatever.d uses whatever.tra, while *.baf and *.tp* use setup.tra. This mode also ensures that partially traified mods aren't broken (old @xxx references are preserved, and new references are appended to the bottom).

The tool can also generate .d, .baf etc. files that use local strings rather than @references. Run it like this:

traify mymod english english spanish french italian

This traifies like in the prior case, then generates, in mymod/tra/{english,spanish,french,italian}/decompiled a version of all *.d, *.baf, *.tp* files, that uses local strings rather than @references. This assumes that whatever.d has its strings in whatever.tra, while *.baf or *.tp* has its strings in setup.tra.

Moreover, you can pass additional options to WeiDU; they must be put after the primary language, followed by -- and by the target languages. Examples:

traify mymod english --traify-comment --nogame --

traify mymod english --traify-comment --nogame -- english spanish french italian

--traify-comment --nogame will be thus passed to every instance of WeiDU; the -- is just a marker.

Source code for the tool is available at GitHub. The download contains the Windows binary; users of other operating systems can grab the fully equivalent 'traify.sh' from Github.

Click here to download this file

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#2 Lava Del'Vortel

Lava Del'Vortel

    Fiction Enforcer

  • Modder
  • 2299 posts

Posted 22 January 2011 - 03:06 PM

It sounds great! :cheers:

#3 Kaeloree

Kaeloree

    Head Molder

  • Administrator
  • 9200 posts

Posted 22 January 2011 - 03:10 PM

You're awesome. Thanks!

#4 Miloch

Miloch

    Barbarian

  • Modder
  • 6579 posts

Posted 22 January 2011 - 08:43 PM

I suppose I'm missing something obvious, but how is this different from --traify, --traify-old-tra, etc.?

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#5 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 23 January 2011 - 03:48 AM

It calls --traify and friends, but automates the process if you're traifying a non-trivial number of files.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#6 Zyraen

Zyraen
  • Modder
  • 1402 posts

Posted 23 January 2011 - 04:16 AM

Awesome ! :) One issue I ran into on a past attempt at TRAIFYing my mod, and that is...

Does it require us to change the BG2 directory (ie the Dialog.TLK etc) to the BG2 directory that is specified by the Windows Registry?

kiyos.jpg____btlbn2.gif____kovaS.jpg
Love between a Law Enforcer and a Fugitive - can such a thing even happen?
SoA Release - Overview / Download Links

Zyraen's Miscellaneous Mods - Ust Natha Accelerator, item tweaks, XP caps, The Ub3r Reaver Kit, and much more...
Spellhold Gauntlet - more than just a Spellhold-Be-Gone
Hidden Kits - hidden dual-classed kits with a twist for progression


#7 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 23 January 2011 - 04:57 AM

If your BG2 path is set correctly in the registry, it can be run from anywhere you choose. Otherwise, you must run it from your BG2 game directory.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#8 Zyraen

Zyraen
  • Modder
  • 1402 posts

Posted 23 January 2011 - 05:06 AM

That's great news.

I once tried to use WeiDU to traify my mod, and that didn't work unless I changed my entire Installation to my registry directory, causing some major irritation. Its great to know that won't be an issue on this tool once its placed next to Dialog.TLK

kiyos.jpg____btlbn2.gif____kovaS.jpg
Love between a Law Enforcer and a Fugitive - can such a thing even happen?
SoA Release - Overview / Download Links

Zyraen's Miscellaneous Mods - Ust Natha Accelerator, item tweaks, XP caps, The Ub3r Reaver Kit, and much more...
Spellhold Gauntlet - more than just a Spellhold-Be-Gone
Hidden Kits - hidden dual-classed kits with a twist for progression


#9 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 23 January 2011 - 05:15 AM

This tool works exactly like --traify, - if WeiDU --traify had a complaint about a certain setup, then traify.exe will have such a complaint too.

WeiDU must find a game installation in one of the following locations:

all OS:
"."
".."
"../.."
"../../.."
"../../../.."
only Windows:
bg2_registry_path
bg1_registry_path
iwd1_registry_path
iwd2_registry_path
pst_registry_path
"C:\\Program Files\\Black Isle\\BGII - SoA\\"
"D:\\Program Files\\Black Isle\\BGII - SoA\\"

It tries those locations in order and stops at the first location that contains a chitin.key, and expects to find there a dialog.tlk, override folder, and a *.ini that contains correct path references to the rest of the installation. I suspect that finding a non-BG2 installation when traifying a BG2 mod (ditto for the other games) might cause issues, but have no specific desire to test this assertion.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#10 Miloch

Miloch

    Barbarian

  • Modder
  • 6579 posts

Posted 23 January 2011 - 04:42 PM

I once tried to use WeiDU to traify my mod, and that didn't work unless I changed my entire Installation to my registry directory, causing some major irritation.

The short answer to what the bigg said is just put a copy of weidu.exe in whatever game or mod folder you're traifying and run it from there (same goes for this tool I suspect). Never had any problems with that, though the syntax isn't always that intuitive.

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#11 Lisandro

Lisandro
  • Member
  • 126 posts

Posted 11 December 2011 - 03:06 PM

Can I use --traify-comment in it? For me it'd be very usefull

#12 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 11 December 2011 - 03:30 PM

If you know how to run the .sh file, it's trivial to add the option in the script. Otherwise, I'll code support for Unix-like '--' when parsing the arguments.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#13 Lisandro

Lisandro
  • Member
  • 126 posts

Posted 11 December 2011 - 05:41 PM

I have no idea how to compile this... jajajaja... :rolleyes:

I don't know what is this that I see.. :blink:

If you can do it... :crying: i'll be happy...! :woot: :Bow:

Edited by Lisandro, 11 December 2011 - 05:44 PM.


#14 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 02 January 2012 - 01:07 PM

OK, done. Check the new version and description.

Edited by the bigg, 02 January 2012 - 01:27 PM.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#15 Lisandro

Lisandro
  • Member
  • 126 posts

Posted 02 January 2012 - 06:12 PM

Thanks a lot Bigg... Really... thanks for take your time for all of us... Muchísimas gracias! :woot:

#16 Wisp

Wisp
  • Modder
  • 1353 posts

Posted 14 April 2012 - 04:45 PM

traify.sh: You (apparently) need quotes around the "*.tp*" or find errors out and you (apparently) need quotes around the "*.d" or it just processes .baf files.

#17 Kish

Kish
  • Member
  • 1265 posts

Posted 21 June 2014 - 07:10 PM

I realize this topic is kind of old, but hopefully it's okay to post to it anyway. It doesn't seem to work when the mod has more than one word in its name. Is there a way around that?


Posted Image

http://www.moveon.org/fox/
"You are what you do. Choose again, and change."
--Cordelia Naismith Vorkosigan