Jump to content


Hardcoded .d to .d/.tra converter


  • Please log in to reply
12 replies to this topic

#1 -jcompton-

-jcompton-
  • Guest

Posted 03 August 2002 - 07:52 AM

Put this in the queue for WeiDU 63 (in other words, don't go making it in the next hour just because I'm asking, but when it's time to open up the code again...)

We discussed an ability to take a "hard-coded" .d file and break a .TRA file out of it. As a reminder, when you can do this, it would be great.

We've got a German translation of Kelsey-SOA in progress, and they're working on the .TRA-enabled bits at the moment, but it'll be great to be able to break up our non-.TRA files for their consideration. That will also help us get a Spanish translation moving.

#2 -Blucher-

-Blucher-
  • Guest

Posted 03 August 2002 - 01:01 PM

What is this Jason. I must've missed that conversation. Your new hard-coded .d to .d/.tra converter technology frightens me. I'm just a caveman!

#3 -jcompton-

-jcompton-
  • Guest

Posted 03 August 2002 - 02:23 PM

What is this Jason. I must've missed that conversation. Your new hard-coded .d to .d/.tra converter technology frightens me. I'm just a caveman!

As I recall, it was a serendipitous offer from Wes, something that I'd secretly hoped we could have someday but never thought to ask about...

I know you know this stuff, GB, but for our home audience I'll give the long explanation:

You can put strings into the game in two different ways. You can do

SAY ~This is a string.~

in your .d, or you can do

SAY @1

and then build a .tra file with

@1= ~This is a string.~

and then, if you want a French version, you do

@1 = ~C'est un string.~ (or whatever)

...

But let's say you're building a mod and, for whatever reason, you built some of all of your .d with the hard-coded system, and then you got an offer to do a translation. You could sit there by hand and break all of the references out into a .tra... or you can remind Wes to put in an --extract-tra function so that

SAY ~This is a string.~

will be processed and WeiDU will spit out a new .d that says

SAY @1

and a new .tra that says

@1 = ~This is a string.~



(Bottom line, is that because we were busting a lot of stuff out of IDU, and because Kelsey took SO DAMN LONG, we only did about half of it in .tra format. But now there are German and Spanish translation offers on the table, so this would be great to have. We have three primary .d files in Kelsey-SOA: one for banter/LOVETALKs, one for his basic J/P dialogues and his quest, and one with all of his interjections. Only the banter/LT .d has a .tra.)

#4 weimer

weimer
  • Member
  • 1569 posts

Posted 05 August 2002 - 08:45 PM

WeiDU 63 (available now) has this feature. To test it, try something like:

weidu --text bodhi.dlg
weidu --traify bodhi.d --dout new.d

Let me know if it works on Kelsey.

#5 -jcompton-

-jcompton-
  • Guest

Posted 05 August 2002 - 09:44 PM

--traify works crazy fast, and appears to work correctly.

Question: There's no obvious rhyme or reason to the order in which .tra refs appear, compared to the original order in the .d. Is it easily explained, just to satisfy my curiosity?

Potential future feature request from somebody or other: I could see someone, for whatever reason, wanting to specify the starting .tra value, or wanting to be able to finish TRAifying a file they'd already been TRAing by hand. A quick experiment shows that --traify won't look in the old .tra for any references that might already exist (so it's "only" good for 100% hard-coded .d's).

So if you want to say "I call all-time tough titty" on that, this is a good opportunity to do so. At the very least, a little explanation will help me write the docs.

#6 weimer

weimer
  • Member
  • 1569 posts

Posted 05 August 2002 - 09:56 PM

--traify works crazy fast, and appears to work correctly.

Question: There's no obvious rhyme or reason to the order in which .tra refs appear, compared to the original order in the .d. Is it easily explained, just to satisfy my curiosity?

Potential future feature request from somebody or other: I could see someone, for whatever reason, wanting to specify the starting .tra value, or wanting to be able to finish TRAifying a file they'd already been TRAing by hand. A quick experiment shows that --traify won't look in the old .tra for any references that might already exist (so it's "only" good for 100% hard-coded .d's).

So if you want to say "I call all-time tough titty" on that, this is a good opportunity to do so. At the very least, a little explanation will help me write the docs.

Oh, right, in order. That would probably make it easier for your translators. Next version will put 'em in order of appearance.

Starting offset? Fine.

#7 weimer

weimer
  • Member
  • 1569 posts

Posted 05 August 2002 - 10:00 PM

v64 available now has in-order output and "--traify# X". Let me know.

#8 -jcompton-

-jcompton-
  • Guest

Posted 05 August 2002 - 10:30 PM

Oh, right, in order. That would probably make it easier for your translators. Next version will put 'em in order of appearance.

But my curiosity still lingers...how was WeiDU picking the order before?

#9 weimer

weimer
  • Member
  • 1569 posts

Posted 05 August 2002 - 10:32 PM

The previous order was a linear scan of a hash-table that was keyed on the text of the strings.

Thus the order was effectively "at random".

#10 -jcompton-

-jcompton-
  • Guest

Posted 13 August 2002 - 08:49 AM

Any chance of introducing traify for TP2s?

#11 weimer

weimer
  • Member
  • 1569 posts

Posted 13 August 2002 - 10:55 AM

Fine, done.

#12 -jcompton-

-jcompton-
  • Guest

Posted 13 August 2002 - 11:17 AM

Thanks, testing.

#13 -jcompton-

-jcompton-
  • Guest

Posted 13 August 2002 - 12:01 PM

See e-mail for bug report. (item descriptions are not being pulled in, and some redundant references are being made.)