The three virtues of a programmer: Laziness, Impatience, and Hubris. – Larry Wall

Legacy:CrosshairPack

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
UT2004 :: Object >> CrosshairPack (Package: Engine)

Abstract base class for client-side crosshair packs.

Structs

CrosshairItem (native)

string FriendlyName (localized) 
The name of a crosshair which will be displayed in the drop-down list of crosshairs.
Texture CrosshairTexture 
The texture used for the crosshair. Note that you can only use Texture materials, no material modifiers.

Properties

CrosshairPack group

array<CrosshairItem> Crosshair (const, protected, cache) 
The list of crosshairs in the crosshair pack. These will be exported to a cache file (.UCL) when compiling the package or running the ExportCacheCommandlet.

How To Create A CrosshairPack

  1. Create a texture package in UnrealEd or with UCC BatchImport, which contains all your new crosshairs. It's probably a good idea to stick to the same dimensions as UT2004's own crosshair textures. (see Import The Texture) (Note for UT: Do not generate mipmaps when importing crosshair textures. If you do, the crosshairs may not work on Linux clients.)
  2. Download this example project and extract it to your UT2004 Base Directory. (this ZIP archive contains a MyCrosshairPack directory)
  3. Rename the MyCrosshairPack class (i.e. the file itself and the "MyCrosshairPack" in the "class MyCrosshairPack extends CrosshairPack;" line) and its package so it reflects the name of your crosshair pack.
    Make sure the code package doesn't have the same name as the crosshair texture package, but try to keep them similar, for example MyCrosshairPack.u and MyCrosshairTextures.utx.
  4. Change MyCrosshairTextures.utx below to the name of the texture package containing your crosshair textures.
  5. Add all crosshair textures to the crosshair list in the defaultproperties section and give them unique FriendlyNames. Make sure the names aren't used by other crosshair packs or the default crosshairs, because in that case the user will see multiple crosshairs with the same name in the crosshair list.
  6. Compile the project. I suggest using UMake for this, the UMake project file is already included in the ZIP archive.
    Check the project setup before compiling and make sure the only packages listed are Core and Engine. (Uncheck all others)

Known Subclasses

  • DefaultCrosshairs – all default UT2004 crosshairs except for "Circle (3-5)"
  • ONSCrosshairs – "Circle (3), "Circle (4)" and "Circle (5)" of the default crosshairs