Author Topic: Hardcoded .d to .d/.tra converter  (Read 4558 times)

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
Hardcoded .d to .d/.tra converter
« on: August 03, 2002, 10:52:17 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.                    
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Blucher

  • Guest
Hardcoded .d to .d/.tra converter
« Reply #1 on: August 03, 2002, 04:01:13 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!                    

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
Hardcoded .d to .d/.tra converter
« Reply #2 on: August 03, 2002, 05:23:02 PM »
Quote
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.)
                   
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline weimer

  • Moderator
  • Planewalker
  • *****
  • Posts: 2222
  • Gender: Male
    • WeiDU and Weimer Mods
Hardcoded .d to .d/.tra converter
« Reply #3 on: August 05, 2002, 11:45:17 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.                    

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
Hardcoded .d to .d/.tra converter
« Reply #4 on: August 06, 2002, 12:44:10 AM »
--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.
                   
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline weimer

  • Moderator
  • Planewalker
  • *****
  • Posts: 2222
  • Gender: Male
    • WeiDU and Weimer Mods
Hardcoded .d to .d/.tra converter
« Reply #5 on: August 06, 2002, 12:56:02 AM »
Quote
--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.

                   

Offline weimer

  • Moderator
  • Planewalker
  • *****
  • Posts: 2222
  • Gender: Male
    • WeiDU and Weimer Mods
Hardcoded .d to .d/.tra converter
« Reply #6 on: August 06, 2002, 01:00:57 AM »
v64 available now has in-order output and "--traify# X". Let me know.                    

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
Hardcoded .d to .d/.tra converter
« Reply #7 on: August 06, 2002, 01:30:07 AM »
Quote
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?                    
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline weimer

  • Moderator
  • Planewalker
  • *****
  • Posts: 2222
  • Gender: Male
    • WeiDU and Weimer Mods
Hardcoded .d to .d/.tra converter
« Reply #8 on: August 06, 2002, 01:32:03 AM »
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".
                   

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
Hardcoded .d to .d/.tra converter
« Reply #9 on: August 13, 2002, 11:49:20 AM »
Any chance of introducing traify for TP2s?
                   
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline weimer

  • Moderator
  • Planewalker
  • *****
  • Posts: 2222
  • Gender: Male
    • WeiDU and Weimer Mods
Hardcoded .d to .d/.tra converter
« Reply #10 on: August 13, 2002, 01:55:17 PM »
Fine, done.                    

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
Hardcoded .d to .d/.tra converter
« Reply #11 on: August 13, 2002, 02:17:10 PM »
Thanks, testing.                    
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
Hardcoded .d to .d/.tra converter
« Reply #12 on: August 13, 2002, 03:01:03 PM »
See e-mail for bug report. (item descriptions are not being pulled in, and some redundant references are being made.)
                   
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

 

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