THE BATTLEFIELD: 1942
HUD Updated September 25, 2003 HUD means "Heads Up Display", and are the elements overlaid on the screen above the 3D content. The textures for the various 2D images that are overlaid on the screen are in Menu.rfa in the menu\Texture directory and its subdirectories. Most of the images are in the DDS format, some in the TGA (Targa) format. Often in a .con file a ".tga" suffix file will be specified, but in fact a DDS file (with a .dds suffix) will be used. In general, paths specified in the text .con files are relative to menu\Texture directory. All textures must be a power of 2 along each edge.
I highly recommend using the free Irfanview program (also get the plugins package for this program) to browse these image directories. Open Irfanview and hit the "T" key and you can see thumbnails of the images in directories. The Menu.rfa's directories break down as follows:Menu.rfa Structure The Menu.rfa file contains files concerned with aspects of the game menus and the heads-up displays that appear during the game.
There are two types of files in Menu.rfa: menu control, and textures. The main root directory contains the menu control and sound script files, the Texture directory and its subdirectories contain all the menu textures.
The menu control files seem to be in a semi-binary format called "MemeFile 2.0.", which is used to control the menus. MDT TOOL???
The menu\Texture directory contains some miscellaneous images, such as the binoculars and sniper scope view, minimap repair and medical attention icons, flags, etc. It also contains many subdirectories, the purpose of most of which is fairly obvious:
ObjectTemplate.SetSoldierStandingIcon "Soldier/icon_*_soldier_standing.dds" ObjectTemplate.SetSoldierCrouchIcon "Soldier/icon_*_soldier_crouching.dds" ObjectTemplate.SetSoldierProneIcon "Soldier/icon_*_soldier_lying.dds"These set the standing/crouching/lying icons on the in-game HUD to show a soldier's status.
ObjectTemplate.setMinimapIcon "flag_*.tga" ObjectTemplate.setControlPointIcon "conp_*.tga" ObjectTemplate.setTicketIcon "flag_ticket_*.tga"These all have to do with the minimap. SetMinimapIcon is used for vehicles (see below), but this setting is ignored for soldiers (the image Minimap\minimap_icon_soldier_16x16.dds is always used). SetControlPointIcon defines what flag icon is used when this soldier's side controls a flag. SetTicketIcon is for the little flag next to the ticket counter on the minimap.
ObjectTemplate.setTeamFlagIcon "Icon_flag_*.tga"This is used with the soldier spawn page. It sets the team flag in the upper left corner when you select your class (i.e. above all the classes).
Here are the properties set in all kit files that are relevant to the HUD:
ObjectTemplate.SetHealthBarIcon "Ingame/Healthbar_empty_*_64x64.tga" ObjectTemplate.SetHealthBarFullIcon "Ingame/Healthbar_full_*_64x64.tga"A commonly used technique in the HUD is to have two icons for each gauge, one showing the gauge empty and one showing it full. The actual value of the property is then used to display part of one icon and part of the other on the HUD, so showing any state between the two.
ObjectTemplate.AddWeaponIcon "Weapon/Icon_*.tga"When a weapon is selected (via keys 1-6 or the mousewheel), the weapons a soldier can choose from are displayed at the bottom of the HUD. The weapon icon displayed for each weapon choice is set in the corresponding soldier kit file, which contains a series of AddWeaponIcon property settings which specify the weapon icons to be displayed.
ObjectTemplate.setKitIcon 0 "kits/Icon_*_selected.tga"This associates the class icon on the soldier spawn screen with the soldier kit file.
ObjectTemplate.setHudAmmoType ATTypeNameSetHudAmmoType sets the type of ammo that is to be displayed. The ATTypeName value specifies the format. This type is also used by vehicles' HUD displays. Here are the values and what they mean:
ObjectTemplate.setAmmoBar "Ingame/*_empty_32x64.dds" ObjectTemplate.setAmmoBarFill "Ingame/*_full_32x64.dds" ObjectTemplate.setAmmoBarSize #SetAmmoBar and SetAmmoBarFill are used to show how full the ammo clip is, using images of the clip itself. The setAmmoBarSize is the height of the useful area of the ammo bar. All textures have to be a power of 2 along their edges, and all ammo bars are 32 or 64 pixels wide, but the useful height varies.
If SetHudAmmoType is set to any of the ATIcon* types, then this property is set:
ObjectTemplate.setAmmoIcon "Ammo/Icon_*.tga"This property defines the (unchanging) image of the type of ammo used.
ObjectTemplate.SetScopeIcon "*.tga"This property is used to set the image for the sniperscope and binoculars views.
ObjectTemplate.setVehicleIcon "Vehicle/Icon_*.tga" ObjectTemplate.setVehicleIconPos x/yThis HUD icon shows what sort of weapon you are currently inside. The position you are manning is overlaid on this icon, and is measured in pixels from the upper left-hand corner of the icon.
ObjectTemplate.setNumberOfWeaponIcons # ObjectTemplate.setPrimaryAmmoIcon "Ammo/Icon_*.tga" ObjectTemplate.setPrimaryAmmoBar ABTypeName ObjectTemplate.setSecondaryAmmoIcon "Ammo/Icon_*.tga" ObjectTemplate.setSecondaryAmmoBar ABTypeNameThese all have to do with the ammunition/overheating status display for each weapon, the primary (left mouse fire) and secondary (right mouse), if any. SetNumberOfWeaponIcons specifies the number of weapons that have a display on the HUD, a value from 0 to 2. SetPrimaryAmmoBar sets the type of display needed for the weapon, similar to how handweapons use this value. Note that the defined names are different, though, starting with AB instead of AT. Here are the values used for vehicle weapons:
ObjectTemplate.setHasTurretIcon 1If setHasTurretIcon is 1, then a turret and tank direction indicator is drawn, in the bottom center of the HUD.
ObjectTemplate.setMinimapIcon "Minimap/minimap_icon_*.tga"How this vehicle is represented on the minimap.
Go to Step by Step Tools, Step by Step Scripting, Advanced Step by Step Scripting, or Video Tutorials