View unanswered posts | View active topics It is currently Tue Mar 09, 2021 5:24 am

Reply to topic  [ 33 posts ]  Go to page Previous  1, 2, 3
 TW word translation 
Author Message
User avatar

Joined: Tue Sep 25, 2007 7:27 pm
Posts: 530
Location: Long Island
Unread post Re: TW word translation
Kaus wrote:
Using Ice9 as a example one could imagine he has a script to sweep, a script to welcome a player, a script to enforce events that can be caught by text triggers.. etc..

That is precisely how I do it. I am also lucky that I have a modded version of TWX that one of my former players wrote that allows me to launch scripts at timed intervals using the TWGS scheduler. That takes some of the load off of the server.

If you have a building game, they will come...

Proud Sysop of ICE9 TWGS
Home of Building and Non Regulated Games

Thu Jan 19, 2012 8:53 pm
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1122
Location: Augusta, GA
Unread post Re: TW word translation
Back to the word translation idea... seems like a more encompassing approach would be to enumerate all strings that TW sends, and allow an alternate string to be specified. So say there are 5000 TW strings (TWString[1] - TWString[5000]), and TWString[20] is "You have $CREDITS credits and $EMPTYHOLDS empty cargo holds." You could add a new string (TWString[5001]) with a value of "Tienes $CREDITS créditos y $EMPTYHOLDS bodegas de carga vacías.", and replace TWString[20] with a pointer to TWString[5001]. If this string were later altered, then TWString[5001] would be replaced with a pointer to its replacement.

This would probably process faster right? And would allow for complete translation of TW to other languages... though there may be easier ways to do that.

Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.

Thu Jan 19, 2012 10:09 pm
Profile WWW
Site Admin
User avatar

Joined: Sun Dec 24, 2000 3:00 am
Posts: 3150
Location: USA
Unread post Re: TW word translation
A big part of the equation for me is level of difficulty. There are nearly 5000 strings and I can't imagine touching all lines of code where these strings are used to implement the kind of string translation system you propose. Had it been used from the start, it would be perfect.

I could automate the creation of a string table by pulling all strings out of the source code and placing them into a string table, then replacing them in source code with a constant. In fact, that's what I did way back when I did the first conversion of TWv2 to TWv3. A string like 'This is a string of text for TW2002' was pulled into a string table and associated with a numeric ID, then a constant was generated in a unit with "S_THIS_IS_A_STRING_OF_TEXT_FOR_TW2002 = ID;". Then that constant replaced the string in code and you could still get a sense in code of what the string was, but the string resided in a string file. The theory was that this file could then be used to customize strings. But that never happened, because while you could change the text for many strings without effecting the formatting of the output, there are a lot of screens where formatting is more rigid. I've dealt with this in the new system by providing a word with a bracketed field width so you know a maximum width for that word. If greater than that width, it'll get truncated. If less, it'll be padded by spaces, sometimes centered, sometimes right justified, sometimes left justified, depending on the page format in question, but the format itself won't change no matter what you choose for a translation. I can do that sort of thing for a highly selective group of words, and as I expand that set of words over time, the amount of work involved won't be too burdensome. But a more complete system of translation is just too big a hurdle for me to justify.

EDIT: I should mention that the rigidity of having replaced strings in code with constants ended up being too much of a headache, so I finally reverted back to having true strings in code. It makes it so much easier for me to work with them. So the STRTABLE.D8A and .NDX (encrypted string file and index) are now obsolete.

John Pritchett
Help fund the TradeWars websites! If you open a hosting account with A2 Hosting, the service EIS uses for all of its sites, EIS will earn credits toward its hosting bill.

Fri Jan 20, 2012 1:06 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 33 posts ]  Go to page Previous  1, 2, 3

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware.