Well it works like this; For units, the building portrait texture normally contains the art for each individual unit button. Then, the unit portrait also has a portrait texture.
I will give more detail:
Note: I used BFME1 as a reference... But the concept is exactly the same in BFME2 and RotWK.
Let's say for example, Mordor Orcs.. The button for recruitment is held here in this texture:
And the portrait is this texture:
Now, the way the game reads them is through a line of code. The Orc button is defined in the buildingradialbuttons.ini located in data/ini/mappedimages/handcreated. The line of code is;
MappedImage BMOrcPit_Horde
Texture = BuildingRadialButtons_065.tga
TextureWidth = 256
TextureHeight = 256
Coords = Left:192 Top:64 Right:256 Bottom:128
Status = NONE
End
The Orc portrait is defined in unitportraits.ini located in data/mappedimages/aptimages. The line of code is;
MappedImage UPMordor_OrcHorde
Texture = UPMordor_OrcHorde.tga
TextureWidth = 256
TextureHeight = 256
Coords = Left:0 Top:0 Right:191 Bottom:191
Status = NONE
End
The Coordinates are used to tell the game what part of the texture to use, since by default it is a 256x256 texture, the game is only supposed to read a certain part of it. So take example the portrait, it is saying only use 191x191 of the texture, from the top left. The 0 values means don't extend past this point. So 0 left 191 right, means use only 191 pixels of the texture from the left side. Same goes for 0 top, 191 bottom. Only use the bottom 191 pixels. Which essentially in game turns the 256x256 texture into a 191x191 texture for the game to show.
You can actually put these code segments in any ini you wish, the point is this is how you define a specific texture to represent a unit button/portrait. Then you simply reference the correct MappedImage line to your desired unit and bingo, you've got new art for your unit.
See the CommandButton for MordorOrcs:
CommandButton Command_ConstructMordorOrcFighterHorde
Command = UNIT_BUILD
Object = MordorFighterHorde
Options = CANCELABLE
TextLabel = CONTROLBAR:ConstructMordorOrcFighterHorde
ButtonImage = BMOrcPit_Horde
ButtonBorderType = BUILD ; Identifier for the User as to what kind of button this is
DescriptLabel = CONTROLBAR:ToolTipBuildMordorOrcFighterHorde
Radial = Yes
InPalantir = Yes
ShowProductionCount = Yes
; UnitSpecificSound = GondorArcherVoiceBuy
End
Edited by Kwen, 27 November 2014 - 03:00 PM.