1. Dismiss Notice
  2. GOG.com logo

    Thanks to YOUR votes, GOG.com now sells:
    - Sea Dogs - Sea Dogs: Caribbean Tales
    - Sea Dogs: City of Abandoned Ships

    Vote now to add Pirates of the Caribbean to the list!

    Dismiss Notice
  3. Under the Crossbones Podcast

    A Pirate Podcast with Interviews
    Music, Comedy and all things Pirate!

    - Episode Guide - About - Subscribe -
    - Twitter - Facebook - iTunes - Android -
    - Youtube - Fill the Coffers -

    Dismiss Notice
  4. New Horizons logo

    Quick links for PotC: New Horizons
    - Download latest version
    - Wiki - FAQ - Report bugs here
    - ModDB profile

  5. GOF logo

    Quick links for AoP2: Gentlemen of Fortune 2
    - Downloads and info
    - Historical Immersion Supermod
    - ModDB Profile

Dismiss Notice
New to the forum?
Please take a moment to read our Welcome Message and Forum Rules.

Need Help I can not supply the texture of 2048x2048 to ship_icons2

Discussion in 'Sea Dogs: City of Abandoned Ships' started by LEOPARD, Nov 12, 2017 at 5:21 PM.

  1. LEOPARD

    LEOPARD Landlubber

    Joined:
    Nov 8, 2017
    Messages:
    10
    Gender:
    Male
    Hello!
    Friends, I have not slept for a week and am trying to find a solution to my question, which I stand in for modding.
    The thing is, I'm doing a ship pack on City of Abandoned Ships. I added more than 100 ships from various mods and addons to the mod. For this, I created a texture of ship_icons1 with a size of 2048x2048.
    And everything was fine, then until I started making icons on the ships. In the sea, all the ships are drawn as they should. But my ship shows smaller copies of several icons.
    I figured out the texture of ship_icons1, but I can not figure out where the parameters for ship_icons2 are configured.
    I get here is such a picture, instead of a ship.
    [​IMG]
    But if I put the original texture 512x512, then the icon looks good.
    [​IMG]
    I ask for help! I'm tired of digging into files and looking for values. My attempts are exhausted.
     
  2. Jan Marten

    Jan Marten de ZeeRoovers Group Storm Modder

    Joined:
    Sep 27, 2008
    Messages:
    438
    Gender:
    Male
    ... look at the BattleInterface.c
    ... look there void SetShipPictureDataByShipTypeName(string sType)

    Build size and number of pictures
     
  3. LEOPARD

    LEOPARD Landlubber

    Joined:
    Nov 8, 2017
    Messages:
    10
    Gender:
    Male
    I have such parameters:
    case "tartane":
    BI_intNRetValue[0] = 0+0*32;
    BI_intNRetValue[1] = 0+0*32 + 1;
    BI_intNRetValue[2] = BI_ICONS_TEXTURE_SHIP1;
    break;

    BattleInterface.CommandTextures.list.t1.name = "battle_interface\ship_icons1.tga";
    BattleInterface.CommandTextures.list.t1.xsize = 32;
    BattleInterface.CommandTextures.list.t1.ysize = 32;

    It does not help.
     
  4. ChezJfrey

    ChezJfrey Master Mariner Storm Modder

    Joined:
    Apr 24, 2015
    Messages:
    212
    You can't find the x and y size setting for the ship icons, because they don't exist. It is a flaw in the system.

    The settings you see for the CommandTextures are used for the 'sail to' icons that use ship_icons1.tga, and as you have already found, there are settings to indicate how many rows/columns the texture contains: xsize and ysize, so that it can properly map a single icon based on an index number. Another feature of the CommandTextures is that each texture file can be set/overridden for each ship, that you can see in that function that returns the array of info about each type:

    Code:
    BI_intNRetValue[0] = 0+0*32;
    BI_intNRetValue[1] = 0+0*32 + 1;
    BI_intNRetValue[2] = BI_ICONS_TEXTURE_SHIP1;
    
    The first value is the index, second is the 'selected' highlighted version, and the third value is the texture number X supplied in the CommandTextures.list.tX.name. Here is where it gets messed up:

    The ShipIcon uses the results from that exact same function, to get the icon index, but it does not use the second, 'selected' value, and it does not use the third value, with the overridden texture number, because it does not contain any logic in the executable/engine to know about the actual texture name, only the CommandTexture object knows that t1 = ships_icons1.tga. Instead, the ShipIcon only knows about one texture, that is BattleInterface.ShipIcon.shiptexturename = "battle_interface\ship_icons2.tga.tx";

    This means that both ship_icons1 and ship_icons2 need to have the same ship types in the same index position. But here is where a problem arises. You can set list.t1.xsize and list.t1.ysize to tell about additional rows/columns. But BattleInterface.ShipIcon contains no such setting...because it is hardcoded in the executable/engine to be 8 columns. There is no way for you to change that. Also, since the texture files are limited to a square, that means a max of 8 rows. So you are stuck with a maximum of 64 different ship icons.

    Since I consider this a flaw, I have removed the hardcoded 8 rows for ShipIcon and introduced an xsize and ysize setting for ShipIcon in my version, but there is no way around this limitation in the stock version.
     
    LEOPARD likes this.
  5. LEOPARD

    LEOPARD Landlubber

    Joined:
    Nov 8, 2017
    Messages:
    10
    Gender:
    Male
    Many thanks to you for clarification!
    I just forgot when I last slept. I kept thinking that this was at the level of scripts or ini-files. ** I followed the rope and soap **
    You say that you deleted the hard-coded 8 lines. Can you tell me how to do this? Or maybe you can share your version?

    I will be very grateful to you! For I no longer have the strength to fight this. My wife will soon drive me out of the house because I'm sitting all day at the PC and do not get out of it. All because I can not solve this problem.

    Sincerely, LEOPARD!
     

Share This Page