Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: String Tables  (Read 8619 times)

0 Members and 1 Guest are viewing this topic.

obleo

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 18
  • Hail to the King baby!
    • View Profile
String Tables
« on: March 26, 2003, 01:30:18 PM »

Can someone give me a quick overview of string tables (what they are and how to use them)?  Would this be something suitable for storing dialog all in one place?

Thanks!
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:String Tables
« Reply #1 on: March 26, 2003, 01:49:01 PM »

The string tables are intended mainly for localization purposes. The idea is indeed to store all the in-game texts in one place to simplify the localization task.

The string table file uses a following format:
-one string per line
-each line contains: a string identifier, TAB character, the actual text string

for example:

Code: [Select]
molly001 <tab> Hi, I'm Molly.

Then in your scripts you'll have to use a following syntax:

Code: [Select]
actor.Talk("/molly001/Hi, I'm Molly.");

When the engine encounters a string in the above format (i.e. /some_id/some_text ) it will search the string table. If a string with the specified ID is found, it will be used instead. It means for example, you can write your scripts in english; if there's no string table, the game will run in english. If you create a german string table, the game will run in german and you don't need to change your scripts at all.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Scarpia

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 77
  • Rich kid trash web designer :-P
    • View Profile
    • junk dot dk
Re:String Tables
« Reply #2 on: March 26, 2003, 04:27:46 PM »

Hmm. I'm not sure how that makes sense.. If the sentence has been entered in the string table like this:

Code: [Select]
molly001 <tab> Hi, I'm Molly.

Then why do you repeat the same text sentence in the script:


Code: [Select]
actor.Talk("/molly001/Hi, I'm Molly.");


??


Scarpia
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:String Tables
« Reply #3 on: March 26, 2003, 04:44:32 PM »

1) to keep the script readable
2) to be able to run the game without any string table
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Jerrot

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 690
    • View Profile
Re:String Tables
« Reply #4 on: March 26, 2003, 05:09:16 PM »

hi scarpia,

Then why do you repeat the same text sentence in the script:
Code: [Select]
actor.Talk("/molly001/Hi, I'm Molly.");

I'm working a lot with template and content management systems - and I'm really happy it will work this way in WME.

Of course you could think of taking "/Hi, I'm Molly./" as the label - and if there is no string table, it could use the label as the text. But this doesn't work, I failed in doing so once. Sometimes you just have to translate the same word different into other languages and that's the problem.

Although you normally WILL have a string table when using them, I prefer this solution, it's easy, unique and readable.
« Last Edit: March 26, 2003, 05:11:29 PM by Jerrot »
Logged
Mooh!

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:String Tables
« Reply #5 on: March 26, 2003, 05:15:21 PM »

(Actually, it's not unique, it's stolen from LucasArts games ;))

Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Jerrot

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 690
    • View Profile
Re:String Tables
« Reply #6 on: March 26, 2003, 09:59:44 PM »

(Actually, it's not unique, it's stolen from LucasArts games ;))
"Stolen"...  ::) I know the string tables from LUA (and I guess you once installed "SCUMM Revisited", too...) but you could also tell me, you stole it from Excel or something, it's a table!! ;)

Oh - and btw I wrote about the string labels being unique that way... ;)
Logged
Mooh!
 

Page created in 0.055 seconds with 23 queries.