Author Topic: Traify guide: shortest ever  (Read 11037 times)

Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6253
  • Gender: Female
  • The perfect moment is now.
Traify guide: shortest ever
« on: February 01, 2013, 04:01:08 AM »
Each time I try to traify new lines for my mods, I forget how it's done. Whether I need the game or not, what to do with line numbers, where the out file should go, whether the_bigg's triaify program traifies files one by one... well, all of it, rather. And it takes me about half an hour of searching(or, rather, trying again and again) to remember. So, without further ado, How It Works For Me:

You have a file, MyFile.d, and you have a .tra file for it, MyFile.tra. The last line of MyFile.tra is @2000.

First, backup both your files.

Second, no, you don't need to have BG2 installed anywhere, at least with Weidu v231.

Place weidu.exe to any directory, place MyFile.d into the same directory, make sure that your old MyFile.tra is NOWHERE near that directory, and run

weidu --traify MyFile.d --traify# 2001 --nogame --out MyFile.tra

This way you'll get 1) MyFile.d with @tra references; 2) MyFile.tra with NEW LINES ONLY AND NO LINE BREAKS.

You'll have to open your MyFile.tra via F3 in Total Commander, CTRL-A and CTRL-C all text, paste it in a Word document to add line breaks, then copy all the text again and then add it to the bottom of your old MyFile.tra.

Behold, you have MyFile.d and MyFile.tra.

(In English only, remember - you'll have to add new lines to your language MyFile.tra's, too, if someone's already translated it, or the mod won't install in that language).

And, of course, you absolutely DON'T want all your dialogue to remain commented in .d file in your distributed package, becase it's +1,5 mb of text extra for your players to download, and some of these players do not have good connection(and may live in a small Russian village where internet's only available once a month from a friend's computer, and only a limited number of megabytes. Hello, 21st century). If you need to read a commented traified .d file, leave a separate .d file on your hard drive/cloud storage/mailbox. There's "untraify", too.

P.S. If you don't need to add any new lines, but need a plain old traify for your v1 mod, it's

weidu --traify MyFile.d --nogame --out MyFile.tra

But it would still be wise to add line breaks later. It's a lot of saved time on editing(and you WILL need to edit it later, trust me).

Offline jastey

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1524
  • Gender: Female
Re: Traify guide: shortest ever
« Reply #1 on: February 01, 2013, 08:16:05 AM »
Neat. I always have to look up the code again.

To get the line breaks, I simply open the file with Wordpad (Windows), save it, and then I can open it in my simple editor and it has all the line breaks.

And a note: traifying doesn't work if you are using Crossplatform code (OUTER_SPRINT), so either write your file for one platform first and then do a mass-replace, or write directly using tra-@ lines!

Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6253
  • Gender: Female
  • The perfect moment is now.
Re: Traify guide: shortest ever
« Reply #2 on: April 13, 2013, 05:49:16 AM »
Because the first post of mine probably wasn't good enough for the first-time traifying, I'll add the following:

Traifying the mod from the beginning: all you need is a Weidu.exe and A COPY(you NEED a backup) of your dialogue file in the same directory.
Just run
weidu --traify MyFile.d --nogame --out MyFile.tra

That's all!

For each file, yes, but it's as simple as that. Finally, for your setup file,
weidu --traify Setup-MyMod.tp2 --nogame --out MyMod.tra

Later, you need to create English folder for your new tra files, and place your new d files into Dialogue folder.
And place this in your .tp2:
AUTO_TRA ~MyMod/%s~
LANGUAGE ~English~ ~English~ ~MyMod/English/Setup-MyMod.tra~

Some people use the whole Translations/English/ subfolder, but it's really a pain afterwards. You can create Translations/English, if you want, though. Just use this in your tp2:
LANGUAGE ~English~ ~English~ ~MyMod/Translations/English/Setup-MyMod.tra~

There're more complex cases, like compiling a AAAA.d file which uses lines from BBBB.tra. In this case, write this in your tp2:
COMPILE ~MyMod/Dialogue/AAAA.d~ USING ~MyMod/%s/BBBB.tra~

 

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)?: