Results 1 to 3 of 3

Thread: Adding elements to menu. Possible?

  1. #1
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Adding elements to menu. Possible?

    Hi.

    I've been modding Rome.lnt to modify some of the menus.
    I'm able to eliminate or move elements of the menu, but I wonder if it is possible to add new elements.

    In my case I'm trying to include a snapshot image in the historical battles.
    In custom battles menu, we have this piece of menu:
    Code:
        <UI piece>empty_art
          <identifier>UIP_CUSTOM_TERRAIN_PIC</identifier>
          <Parameters>
            <x>704</x>
            <y>158</y>
            <width>256</width>
            <height>152</height>
          </Parameters>
          <object_id>empty_art</object_id>
        </UI piece>
    In the case of custom maps (those with their own folder, not only locations in campaign map), the image that appears in such square is snapshot.tga, inside the corresponding custom battle folder.

    When I include a snapshot.tga in a historical battle folder, and I copy the UI_piece in the historical battle page, the empty square appears but the snapshot is not shown.

    Does anybody know how to show this image?

  2. #2

    Default Re: Adding elements to menu. Possible?

    Hello MonkWarrior,

    I know FATW has managed to do this, but I will try to help, in hopes that I know the procedures.

    At the top of the file has all the images paths etc. I will direct you to
    Code:
    <texture>textures\FE_texture1.tga
    
    ...through to...
    
    </texture>
    This section has all the information related to FE_texture1.tga

    Now if you look at this part beneath that first section:
    Code:
    <texture>textures\backdrop.tga
      <path>textures</path>
      <region>backdrop
        <left>0</left>
        <top>0</top>
        <right>1024</right>
        <bottom>768</bottom>
      </region>
    </texture>
    That shows you the "backdrop". As you can see, it is just one image. That region backdrop relates to these two sections.

    Code:
    <UI object>backdrop
      <type>art</type>
      <UI region>art
        <page>textures\backdrop.tga</page>
        <region>backdrop</region>
      </UI region>
    </UI object>
    Code:
    <UI piece>backdrop
          <identifier>UIP_EMPTY_ART</identifier>
          <Parameters>
            <x>0</x>
            <y>0</y>
            <width>1024</width>
            <height>768</height>
          </Parameters>
          <object_id>backdrop</object_id>
        </UI piece>
    as you might notice, it would seem that the first code of this:

    Code:
      <region>backdrop
        <left>0</left>
        <top>0</top>
        <right>1024</right>
        <bottom>768</bottom>
      </region>
    relates to the second piece of code and this:

    Code:
        <region>backdrop</region>
    If I were to guess, the UI object is the object_id in the third piece of code.

    So, if my thoughts are correct, this is how I would set it up.

    My image will be new.tga

    Code:
    <texture>textures\backdrop.tga
      <path>textures</path>
      <region>backdrop
        <left>0</left>
        <top>0</top>
        <right>1024</right>
        <bottom>768</bottom>
      </region>
    </texture>
    I will start with that. I change the texture path, name, and the right and bottom markers. My image is 300 pixels x 300 pixels. BE wary though that the region from 0,0 to 1024, 768 is the area of the region. If it were to be 100, 500 to 1024, 768 it would only think that that area that is "highlighted" is the region. This means that the new code will look like this:

    Code:
    <texture>textures\new.tga
      <path>textures</path>
      <region>new
        <left>0</left>
        <top>0</top>
        <right>300</right>
        <bottom>300</bottom>
      </region>
    </texture>
    Code:
    <UI object>new
      <type>art</type>
      <UI region>art
        <page>textures\new.tga</page>
        <region>new</region>
      </UI region>
    </UI object>
    I changed the page, the region, and UI object names

    Code:
    <UI piece>new
          <identifier>UIP_EMPTY_ART</identifier>
          <Parameters>
            <x>600</x>
            <y>380</y>
            <width>300</width>
            <height>300</height>
          </Parameters>
          <object_id>new</object_id>
        </UI piece>
    Here I changed the names in UI piece and object_id. I want my image to start around the middle of the page, so I change the x and y coordinates. Also, the width and height will need to match the size of the image. I will change those now.



    There you go, I hope you will understand it, and I hope that it works. I am too busy ATM to test it.
    RM3

  3. #3
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: Adding elements to menu. Possible?

    Sorry, but this is not what I want to do.

    This short tutorial is to include a fix image, that is, it will be the same each time the page appears in game.

    But I want to include a "variable" image. Depending on the battle selected, it should be different.

    In vanilla RTW, when you enter the custom battle terrain selection, there is a list of terrains, and when you select a terrain, the corresponding image appears. Some of the terrains are from custom_locations.txt (they have a link to a image in data/menu) and others are from data/world/maps/custom folder. In such case, there is a file snapshot.tga inside the battle folder, and it is this image which appears.

    I haven't found any method to link this "variable" image to the UI piece. And this is what I'd like to do, but in this case with historical battles.

    If I have time, I will post some images to explain more clearly this objective.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO