Author Topic: question about weapons.tbl files.  (Read 1933 times)

0 Members and 1 Guest are viewing this topic.

Offline bfobar

  • 28
question about weapons.tbl files.
I was looking up information on how they work in the wiki and have a question it didn't answer. For most player weapons, the string lines that look like:

XSTR("Blah blah",1234)

they have different numbers after the blah blah. In the wiki and in newer mods, it looks like weapons strings now all have -1 at the end. My question is, what are the numbers for? Just curious.

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: question about weapons.tbl files.
EDIT: Sorry not strings.tbl... Numbers refer to tstrings.tbl, but i'm not sure of their function
« Last Edit: February 22, 2006, 04:53:14 pm by Wanderer »
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: question about weapons.tbl files.
It's for translations.  XSTR() is just a macro/function that says: "Blah blah" is a string I want to show, and 1234 is the translation reference for it.  If the reference is -1 then it juse uses the "Blah blah" string itself.  If it's 0 or greater then it looks in tstrings.tbl for that reference number for the language currently in use and uses that string instead. 

So basically all that XSTR("Blah blah", 1234) is doing is telling the game to look in tstrings.tbl and grab the translated line numbered 1234.  The "Blah blah" in such a case is ignored and it will use what is in the table, the text in the XSTR() line being just for your reference.  It can get somewhat confusing if reference line 1234 in the table is actually "Hello, my name is Inigo Montoya.  You killed my father.  Prepare to die." since that's what it would actually show in the game rather than the "Blah blah" which you might otherwise expect.

When you have XSTR("Blah blah", -1) though it's not going to look in the table and instead just give you the text in the XSTR() line, "Blah blah" in this case.  That wouldn't help people who don't speak English though.

 

Offline bfobar

  • 28
Re: question about weapons.tbl files.
I am ENLIGHTENED!

*queue angelic choir.*

Thanks taylor.  :cool:

 

Offline Taristin

  • Snipes
  • 213
  • BlueScalie
    • Skelkwank Shipyards
Re: question about weapons.tbl files.
Now... what is the point of doing things that way? Why overcomplicate things to that extent? Is it because of the table size limit?
Freelance Modeler | Amateur Artist

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: question about weapons.tbl files.
Why overcomplicate things to that extent?
It's a rather uncomplicated method to support multiple languages actually.  To change the text/translation for a string you only have to deal with one file and that makes it really easy to transfer around to people as well.  If you want to add support for a new language then you don't have to go through every single tbl, just tstrings.tbl, and make the needed translations.

In the case of a MOD you could just have a tstrings.tbl with all of the English text and pass that one file off to a German/Spanish/French/Polish speaker and tell them to translate all of the lines for their language.  You get the file back and then you've easily gotten support for another language in your MOD.  Most people don't/won't do this but it's an option and isn't a difficult thing to do.  The person doing the translations doesn't even need the game, just the one tbl and that's it.

  

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: question about weapons.tbl files.
Doesn't all that only apply with version 1.2 of FS2 or newer?
-C

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: question about weapons.tbl files.
It should apply to every version of retail FS2 and every version of FS2_Open.  The only real exception is for Polish language support which was a special FS2 release (as far as I can tell) and added to general FS2 in the icculus.org version a couple of years ago.  I can't really remember if I ever added the Polish support to FS2_Open, but I did make a diff for it at one point.  If I forgot to ever commit it then I will next time I remember to do so, or when someone requests it, which ever comes first.

I think that retail FS2 supported French and English without having to do anything special, but retail German support required a special build.  German support in FS2_Open will work with any build though (that was one of the first code contributions I made here).  There were also several special language versions for retail made but I don't have a list of those.  I seem to remember somewhere a Spanish language patch though I can't find it now and can't remember where that came from.  If I ever track that down then I'll add it too.  Or, if there are any Spanish speakers using FS2_Open then maybe they can pitch in for the translation and we'll just do it from scratch.  I can handle the code changes easily enough but the strings.tbl and tstrings.tbl files need the extra translations from someone who is much better at Spanish than I am.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: question about weapons.tbl files.
they have different numbers after the blah blah. In the wiki and in newer mods, it looks like weapons strings now all have -1 at the end.

The numbers for a lot of things were only added in FS2 1.2 If you look at the tables for 1.0 they have -1 all over the place.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline bfobar

  • 28
Re: question about weapons.tbl files.
I'm bad. When taylor was mentioning a spanish language version, all I could think was the sathanas jumping in and seeing the Psamtik screaming "NO ME GUSTA!" like the little guy in the truck that gets washed away when the Panama Canal breaks in the movie Team America.