Jump to content
Sign In to follow this  
RippleJet

LTEXT Files - Definition and Tutorial

10 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

LTEXT Files - Definition and Tutorial

How to add LText files with Reader

By RippleJet

For understanding this it is assumed that you have at least limited modding experience and that you have acquainted yourself with iLive's Reader.

Definition

The following definition for LTEXT files was given by karybdis:

LText or Language Text files are a UNICODE text format used by Simcity 4 to give language specific text simply and quickly for use in any part of the world. UNICODE of course makes this much easier since the vast numbers of characters can't always be written in standard text. LText files cover everything from NEWS to Building and Prop names to tool names in the game. They are queried by Instance ID, so make sure your instance is unique when creating new ones!

More information about the LText format and their Group ID's can be found at sims2wiki.

TGI Pointers

LText files are referred to by pointers addressing the LText file's TGI (Type, Group, Instance). The Type ID of an LText file is always 0x2026960B. The Group ID and Instance ID should be randomly selected, eg. by using the TGI Generator included in iLive's Reader (in the Tools menu).

There are two ways to point to an LText file through its TGI address:

1. From an exemplar file using a Key Property. A key property contains all three elements of the address, Type ID, Group ID and Instance ID:

User Visible Name Key

The most commonly used naming property, which points to an LText file containing the name of a building or prop, or even foundations, disasters, terrain, graphs, etc.

Item Description Key

Another commonly used property, which points to an LText file containing the description seen when hovering with the mouse over the item in a menu. An Item Desciption Key can be used in building exemplars for all ploppable buildings and other menu items.

Name Key

A property similar to the User Visible Name Key, but used only in Ordinance Exemplars.

Description Key

A property similar to the Item Description Key, but used only in Ordinance Exemplars.

Label (Crime)

A property similar to the User Visible Name Key, but used only in Crime Exemplars.

My Sim: Name res key

A property similar to the User Visible Name Key, but used only for personal names of sims.

2. From a query using a Resource Field. A resource field contains only the Group ID and the Instance ID of the address:

captionres

GZWinText and GZWinBtn legacies in queries may contain a resource field called captionres, which is used for displaying text (a caption) in a query or within a button.

tipres

GZWinBtn legacies in queries may also contain a resource field called tipres, which is used for text (a tip) shown when hovering with the cursor above a button in a query.

LText (Language Text) files is the way Maxis provides descriptions and names of buildings and props in the game. LText files offer several benefits compared to the use of string properties (Item Description, Item Name or Exemplar Name) or string fields in queries (caption or tiptext). LText files allow the inclusion of special characters, line breaks, LUA tokens and an easy way to include multilingual support, thanks to the Unicode format. Note however, that the Reader does not include support for editing full unicode text.(such as certain Polish and all Far Eastern characters).

Tutorial - Adding an LText file in Reader

If you want to create your own LText files for a User Visible Name Key or an Item Description, I recommend using iLive's LEProp. With LEProp the addition of the LText is automatic and there is no need for editing TGI addresses. See T Wrecks' post further down for a quick guidance.

However, if you want to add LText files for any Key Property belonging to an exemplar file not being a building (props, ordinances, vehicles, etc.), or for a Resource Field in a query, I recommend using iLive's Reader. Eg. props may contain a User Visible Name Key, but the prop's SC4Desc file can not be edited in LEProp. This tutorial shows how to add an LText file for the Item Description Key, with the same result as if it would have been added in LEProp. The same procedure can be followed for adding other LText files.

In the example below I've used a building batted by Bobbo662, the Pizza Hut. Thank you Bobbo662, for letting me use this building as an example!

The building is a ploppable building, contained in a SC4Lot file called Pizza Hut-n_92ac0394.SC4Lot. This file can be called a container file (the file you would see in Windows Explorer). The picture below shows this container file opened in the Reader. To the left there is a list of files contained in the container file and to the right you will see the content of the selected file. In the picture below, the Exemplar file for the building is selected (the second property, Exemplar Type, says "Buildings"). When an exemplar file is selected, all properties contained in the Exemplar are shown to the right. The property highlighted is the Exemplar Name, having the value "Pizza Hut", which in this case is the name of the building shown in the game.

pizzahutexemplarname800oe8.jpg

The first thing we will do is to add the property Item Description Key. Right-click anywhere among the properties of the building exemplar and select Add Property. A property window as shown below will pop up. First locate the Property called Item Description Key from the scroll down list (1). Secondly, add 0,0,0 in the Values as text field (2). Press the Apply button to the right (3) and finally the Apply button at the bottom (4) to add an Item Description Key pointing to the address 0x00000000,0x00000000,0x00000000.

pizzahutadditemdescriptek7.jpg

After this we need to add an LText file. This is best done by copying an existing LText file from elsehwere. If you know a lot with a pleasing description and want ot use that as a template, just open up that lot in Reader. Otherwise, the best source for an LText file is the file simcitylocal.dat, which contains localized (translated) versions of all LText files used in the game. In order to access this file, click Simcity DAT in the left panel (1), and select the last container file found in there (2). Click Fill the List if you see that button to the right in the Reader, and you will see a long list of LText files. Any of these files will do as a template. In the example below the first LText file is selected. Now, press Ctrl-C, or right-click and select Copy File(s), to copy this file.

pizzahutcopyltextfile80rw6.jpg

Now, return to your file by clicking Loaded DAT in the left panel (1). If needed, select your container file (2). Now, click on the spot where you want the LText file to appear. In the example shown in the window below I have selected the Building Exemplar (3). If you now press Ctrl-V, or right-click and select Paste File(s), your recently copied LText file will appear after the selected Building Exemplar. Note that the address (Type, Group and Instance) is unchanged from the file copied in simcitylocal.dat (4).

pizzahutpasteltextfile8la8.jpg

This address of the LText file must be changed, otherwise your copy will only replace the original file contained in simcitylocal.dat. The address of the LText file must be a unique, randomly selected one. You can use the TGI Generator found under the Tools menu to generate random group and instance ID's.

However, since the address for the building exemplar itself has been randomly generated, the recommended practice for the Item Description Key is to use the same Group ID and Instance ID for the LText file containing the description as for the Building Exemplar. This is the way an LText file created in LEProp is addressed too. If you're creating an LText file for other purposes, you would have to make sure you are not giving the LText file the same address as any existing LText files.

The procedure explained below, is my way (not the only way) of changing the address of the LText file. First select the building exemplar (marked below with the X). Right-click and select Copy Entry ID (or select it from the Sub Files menu as shown below). This copies all three elements of the address (Type ID, Group ID and Instance ID).

pizzahutcopyentryid800cp0.jpg

Now, select the LText file (marked below with the X). Right-click and select Paste Entry ID (or select it from the Sub Files menu as shown below). This will cause the LText file to get an identical address as the Building Exemplar (you might have to click the LText file in order to see the changes). Don't stop reading here, because you will screw up the lot if you have two files with the same address.

pizzahutpasteentryid800ea2.jpg

Since we only wanted the Group ID and Instance ID to be the same as for the Building Exemplar, we need to edit the Type ID. As you already know, the Type ID for LText files should always be 0x2026960B. This is a number you will soon remember, if you start adding LText files to buildings.

In order to edit the Type ID of the LText file, first make sure the file is selected (1). Then select TGI Editor from the Tools menu on top, which will open up the window shown below. Now, change the XXXXXXXX in the Type field into 2026960B (2). Then select the file you wish to edit (3). At this stage you need to be careful. Note, that the files are identified only by their address and that they are listed in reverse order compared to the list of files seen on the left. The DIR file is not included at all (you cannot change the address of that). When you're certain you've got the correct file selected, press Apply (4) and close the TGI Editor (5).

pizzahuttgieditor800rw1.jpg

Verify that you did indeed change the address of the LText file and not the Building Exemplar. If something went wrong at this stage, I would recommend exiting Reader without saving and restarting from the beginning.

Now it is time to edit the content (1) of the LText file (X). This can be done in the right-hand side window of Reader. However, it is probably easier to make the editing in Notepad and then paste the content into Reader's editor window. If you want full control of the editing, you could use an editor supporting Unicode. After you're done with the editing, remember to press Apply (2), otherwise you will have to remake it...

pizzahuteditltext800fm3.jpg

Now, there is only one thing missing, and that is to change the address of the Item Description Key to point to our LText file. If you remember, the first thing we did was to add this property in the Building Exemplar. At that stage we gave it an address of 0x00000000,0x00000000,0x00000000, which means it doesn't point anywhere. We could have waited and added the Item Description Key at this stage, but since there are several building available having an Item Description Key of only zeroes, I decided to make the guidelines like this.

Now, make sure you have the Building Exemplar selected (X) and double-click on the property Item Description Key (1), which will open up the window seen below. You now need to edit the numbers in the bottom field, Values as text, to correspond exactly to the address of the LText file (underlined in red). When they correspond, click the Apply button to the right (2). This will copy the content of the Value as text field up to the Values above (3). You could also have edited these values directly, if you find that to be easier. Finish the editing by pressing the bottom-most Apply button (4).

pizzahutedititemdescripre1.jpg

After this, do remember to save your lot. You should probably have done that regularly all along too!

Test your lot in game and see that the item description shown when hovering above the icon of the building in the menu is correct.

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

You never cease to amaze me, RippleJet... you are quite an Omnibus yourself, if I may say so. 3.gif I hope you get my drift... 2.gif

In this case, however, I much prefer to use LEProp, which will achieve the same task much quicker and easier. And less intimdating for n00bs, of course.


-=| You can choose a ready guide in some celestial voice ||| If you choose not to decide you still have made a choice |=-
-=| You can choose from phantom fears and kindness that can kill ||| I will choose a path that's clear - I will choose free will |=-

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    I am amazed myself...

    I tried to use LEProp for this and probably must have missed to press the Save DAT or something, since I didn't get it to create an LText file. However, trying it now, it works without any problems... maybe there's a need for a quick revision already 17.gif

    EDIT: Quick revision complete.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    LEProp has its quirks, but I like it for adding LTEXTs and importing icons. Let's say I have a finished icon lying around on my HD, and I have an idea for a name (user visible name key) and a description (user visible description key), then the steps to add these three things would be as follows due to LEProp's peculiarities:

    1) Hit "Open Dat" and select the file to be treated.

    2) Enter the name to be displayed.

    3) Hit "Save Dat".

    4) Hit "Open Dat" again and re-open the file. You should now see the name, too.

    5) Enter the description to be displayed.

    6) Hit "Save Dat".

    7) Hit "Open Dat" again and re-open the file. You should now see the name and the description you entered.

    8) Hit "Import Icon" and select the icon to be imported.

    9) Hit "Save Dat".

    10) Hit "Open Dat" and re-open your file a last time to make sure everything is where it belongs and how it's supposed to be.

    As you can see, the key is to do one step at a time, save, open the file again and do the next step.

    If you change the order, LEProp sometimes mysteriously loses the lot icon altogether, which will leave you with a garbled menu bar in game - your lot will "inherit" the icon of the lot below it, and all icons below your lot will, as a consequence, be moved up one position. This means that up from the point where your lot would appear on the list, all icons are shifted by one position, and the last building from the affected menu bar has no icon at all.


    -=| You can choose a ready guide in some celestial voice ||| If you choose not to decide you still have made a choice |=-
    -=| You can choose from phantom fears and kindness that can kill ||| I will choose a path that's clear - I will choose free will |=-

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Originally posted by: T WrecksAs you can see, the key is to do one step at a time, save, open the file again and do the next step.quote>

    Thanx T Wrecks, I guess I'll be using LEProp more than I have so far...

    If you change the order, LEProp sometimes mysteriously loses the lot icon altogether, which will leave you with a garbled menu bar in game - your lot will "inherit" the icon of the lot below it, and all icons below your lot will, as a consequence, be moved up one position. This means that up from the point where your lot would appear on the list, all icons are shifted by one position, and the last building from the affected menu bar has no icon at all.quote>

    ...which I have been correcting on several lots. Good to know the reason for it. 2.gif

    Now I only need you to tell me there's an easier way to add LText files for queries too 3.gif

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online: A long, long time ago... 
     

    Hello,

    I have been using LTEXT for some time, and I think this tutorial will help those who are new to the art of modding.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Once again, an excellent tutorial indeed! Of course, there's nothing new for me, but for the average user who is interested in modding his files, this should be very helpful. As T Wrecks pointed out, LEProp is quite useful for simple tasks, such as adding names and menu descriptions, as well as a custom icon. Sometimes, it may "lose" things like the icon, so doing one step at a time seems to be a nice workaround. But you don't have to re-open the file all the time, usually, it should work with hitting "apply" after each step. I think it's most likely that it "forgets" some of the stuff you added when you create a new LTEXT file (i. e. because the Plugin Manager only generates Item Name and Item Description properties within the Exemplar file). But if you're editing existing stuff, hitting apply should be sufficient (don't forget to save the DAT, obviously 2.gif ).

    Anyway, for adding all kinds of files, the Reader is the best and most powerful tool, and by copying files from the same type and only change the IDs, the chance of screwing up something is relatively low (just be careful to select a unique ID). SC4Tool also features a powerful LTEXT editor, and it works even better than the Reader if it comes to linebreaks and the like. The Exemplar Editor lets you edit LTEXT files in a "WYSIWYG" mode, however, I can't guarantee that it works for certain foreign characters, such as Japanese. But at least the German umlauts are working fine, I spent lots of time togehter with simrolle to ensure this. 2.gif There is only one small bug when it comes to files that have a custom sound file included; SC4Tool sometimes has a problem to save such a file properly. But in all other cases I experienced so far, the LTEXT editor works fine.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    yes definitly an Excellent tutorial.


    Check out My files by typing: Biwdc in the stex search.

    Check out My sc4 Site here:Biwdc Lot's Inc.(Sim City 4 Stuff)

    & New forums Here:http://biwdcforums.com

    Check out My Web Server Here:Biwdc Lot's Inc. Web Server,Biwdc Forums PHPBB

    Useful links:Get Your Maxis Files Here! -Mac-P.C,SC4 Devotion Maxis files! -P.C -Sim City.ea.com no longer exist so get the maxis files from the links to the left ^_^

    Share this post


    Link to post
    Share on other sites

    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account

    Sign In to follow this  

    • Recently Browsing   0 members

      No registered users viewing this page.

    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections