Welcome to the TWC Wiki! You are not logged in. Please log in to the Wiki to vote in polls, change skin preferences, or edit pages. See HERE for details of how to LOG IN.

Rome.LNT

From TWC Wiki
Revision as of 14:43, 16 February 2009 by Nero666 (talk | contribs)
Jump to navigationJump to search

WIP article currently based on research on RTW/BI only, please add information on M2TW and remove this note


The data\menu\rome.lnt file specifies all menus and screens accessible after the game has started up. Basically everything you see when you're not commandeering your units on the battlefield, or managing your empire on the campaign map, is defined here. For various reasons you might want to change the look of some (or all) menus, most probably in larger mods, but perhaps also for personal use. The purpose of this guide is to give you a short introduction to the file, enabling you to understand exactly what it does and what you can do with it.

The file is an xml-like structured file. First, a set of so-called 'regions' is defined, followed by 'UI objects', after which a 'layout' part consisting of several 'lpage' parts is defined. For a better understanding of the file, the guide will be written in reverse, starting with the 'layout' part of the rome.lnt file.

The first few lines, until <lpage>main_menu, contain various settings which shouldn't be altered.

 <layout>
   <layout_width>1024</layout_width>
   <layout_height>768</layout_height>
   <piece_types_fname>rome_pieces.txt</piece_types_fname>
   <piece_texts_fname>menu_text_descr.txt</piece_texts_fname>
   <texture_path>guides</texture_path>
   <texture_path>textures</texture_path>
   <lpage>main_menu
   ...
   </lpage>
   <lpage>new_game
   ...
   </lpage>
   ...
   <lpage>background
   </lpage>
   <lpage>imperial_campaign
   ...
   </lpage>
   <lpage>...
   ...
   </lpage>
   ...
 </layout>

Next, the 'lpage' parts appear, which are both large and numerous. Each 'lpage' contains one menu page. As shown in the next piece of code, an lpage contains many 'UI piece' parts, each being an object on the current menu page.

There are several parameters for every 'UI piece', for most of these the function is quite logical, like x, y, width and height. Important is that there aren't two UI pieces on the same lpage having the same name written behind <UI piece>. The 'identifier' name can be linked to from data\menu\rome_pieces.txt. The function of that file isn't part of this tutorial. The 'menu_id' is a link to another 'lpage' object, in other words a link to a new menu page. The text behind the 'UI text' piece is the entry into data\text\menu_english.txt. I don't believe there are many fonts that can be chosen. Aligning of the text can be left/center/right. New UI texts can be defined in menu_english similar to how they're made in Vanilla. Subsequently they can be used in the rome.lnt file. The 'tool_tip_id' part is again an entry into data\text\menu_english.txt. Tooltips can be made to appear somewhere in your screen when the mouse is moved over the UI piece. The 'object_id' is an 'UI object' defined at the top of the file. Most of the time this is an image like an arrow or a gold bar. More about this next.

 <lpage>main_menu
   <UI piece>main_menu_rome_logo
     <identifier>UIP_EMPTY_ART</identifier>
     <Parameters>
       <x>266</x>
       <y>30</y>
       <width>489</width>
       <height>168</height>
     </Parameters>
     <object_id>rome_logo_main_menu</object_id>
   </UI piece>
   <UI piece>main_menu_singleplayer
     <identifier>UIP_MENU_BUTTON</identifier>
     <Parameters>
       <x>255</x>
       <y>256</y>
       <width>513</width>
       <height>38</height>
       <menu_id>new_game</menu_id>
       <UI text>UI_MAIN_MENU_SINGLE_PLAYER
         <font_id>arial_split_CAF</font_id>
         <align>centre</align>
       </UI text>
       <tool_tip_id>UI_MAIN_MENU_SINGLE_PLAYER_INFO</tool_tip_id>
     </Parameters>
     <object_id>empty_push_button</object_id>
   </UI piece>
   <UI piece>main_menu_continue
     <identifier>UIP_MAIN_CONTINUE</identifier>
     <Parameters>
       <x>255</x>
       <y>320</y>
       <width>513</width>
       <height>38</height>
       <UI text>UI_MAIN_MENU_CONTINUE
         <font_id>arial_split_CAF</font_id>
         <align>centre</align>
       </UI text>
       <tool_tip_id>UI_MAIN_MENU_CONTINUE_INFO</tool_tip_id>
     </Parameters>
     <object_id>empty_push_button</object_id>
   </UI piece>
 	<UI piece>
 	...
 	</UI piece>
 </lpage>

Now more about UI object. These are predefined before the 'layout' part of the file. Most of the time, they're used to make arrows, lines and other art appear on the page. The 'type' can be push_button, toggle_button or art. Here we're using a toggle_button, as they have the most options to describe. The 'UI region' text can be enabled, highlighted, selected, checked or art. When art is used as type, obviously you shouldn't use the other four UI region names, just art. When push_button is used, there is no 'checked' UI region. In the UI region, the 'page' defines the file in data\menu\ that contains the image you want to show. The 'region' piece is predefined before the current 'UI object' and contains parameters that define which area of the image file should be shown.

 <UI object>defender
   <type>toggle_button</type>
   <UI region>enabled
     <page>textures\FE_texture1.tga</page>
     <region>defender_enemy_not_selected</region>
   </UI region>
   <UI region>highlighted
     <page>textures\FE_texture1.tga</page>
     <region>defender_enemy_selected</region>
   </UI region>
   <UI region>selected
     <page>textures\FE_texture1.tga</page>
     <region>defender_enemy_selected_select</region>
   </UI region>
   <UI region>checked
     <page>textures\FE_texture1.tga</page>
     <region>defender_enemy_selected_roll</region>
   </UI region>
 </UI object>

The regions are defined before the UI objects, as mentioned before. Its functionality is explained by the image below.

 <region>defender_enemy_not_selected
   <left>131</left>
   <top>465</top>
   <right>154</right>
   <bottom>497</bottom>
 </region>

(Could someone upload this file to the wiki and paste it here? Didn't work for me)

romelntguide1pq9.jpg

YOU can help us improve this Wiki! ~ Look for ways to help and editing advice. ~ If you need further advice, please post here.