Generic HUD Element for Collectibles

#HUD

Adds a UI that tracks the amount of a set collectible.

HOW TO SET IT UP

Download the .uc and change whatever is needed (there are comments on the script to guide you through) Compile the code Then, to add it to the player, create a "Open HUD" input on your kismet (should be under Action -> Input) Select the class of this custom hud and put a player variable as the target. If you want to see if it works, create a "Level Loaded" event, and connect to "Open HUD" As soon as you start the level, you should see your new UI. :)

Hat_GenericCollectibleHUD.uc

[RAW] [Download]

class Hat_GenericCollectibleHUD extends Hat_HUDElementTimeObjects;  //don't forget to change the name of your class!
 
defaultproperties
{
    Tex_TimeObjects = //PUT YOUR ICON HERE (must be Texture2D)
    Position = (X=0.4, Y=0.088); // Position on screen
    HUDScale = 0.7; //Scale of the HUD Element itself
    IconScale = 1.0; //Scale of the Icon
}
 
function int GetValue(HUD H)
{
    local Pawn p;
    local int value;
 
    p = GetPawn(H, true);
    if (p == None) return 0;
    if (!p.IsA('Hat_PLayer')) return 0;
    value = Hat_PlayerController(p.Controller).GetLoadout().GetCollectibleAmount(PUT YOUR COLLECTIBLE HERE); //change it to your collectible's class (must be as "class'yourclasshere'")
    if (!Hat_Player(p).IsClient()) value += TransientAmount;
    return value;
}