• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

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

LEOPARD

Landlubber
Storm Modder
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.
add8c50904f2bf19f3e3ee8f7187f7c5.png

But if I put the original texture 512x512, then the icon looks good.
4e85c954a4604a346db871a3d3f613ad.png

I ask for help! I'm tired of digging into files and looking for values. My attempts are exhausted.
 
... look at the BattleInterface.c
... look there void SetShipPictureDataByShipTypeName(string sType)

Build size and number of pictures
 
... look at the BattleInterface.c
... look there void SetShipPictureDataByShipTypeName(string sType)

Build size and number of pictures
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.
 
I figured out the texture of ship_icons1, but I can not figure out where the parameters for ship_icons2 are configured.

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.
 
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.
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!
 
Back
Top