Announcement

Collapse
No announcement yet.

UT2k4 HUD?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    UT2k4 HUD?

    i dont get the hud in 2k4. it worked just fine in 2k3 why did they have to mess it up...

    the problem i am having is that nothing shows up. i dont even know if its using my hud. i set the corect thing in the game type but nothing shows up... BTW this is for the hackerz TC

    so are there any tuts that work with 2k4? i found 50 tuts but they all where for 2k3 and i could not get any of them to work.

    so all i need is an example of a hud that dose somthing simple like display text or an image. anything more than that would be to complicated for me to understand just how to draw somthing.

    #2
    Check this out:

    GameInfo Class:

    ----------------------------------------------------------------------------
    class Armory_Game extends xDeathMatch;


    DefaultProperties
    {
    HUDType="DESArmory.ArmoryHUD"
    MapPrefix="ARM"
    GameName="Armory Preview"
    DefaultPlayerClassName="DESArmory.ArmorPawn"
    }
    -----------------------------------------------------------------------------

    //HUDType="DESArmory.ArmoryHUD" - this is most important right now

    And HUD class:
    ------------------------------------------------------------------------------
    class ArmoryHUD extends HudCDeathmatch;

    var font verdana;

    function DrawEnemyName(Canvas C)
    {
    local actor HitActor;
    local vector HitLocation,HitNormal,ViewPos;
    local class<DesArmor> ArmorClass;


    if(verdana==none)
    verdana=font(dynamicloadobject("2k4fonts.Verdana14 ", class'Font'));

    if ( PlayerOwner.bBehindView || bNoEnemyNames || (PawnOwner.Controller == None) )
    return;
    ViewPos = PawnOwner.Location + PawnOwner.BaseEyeHeight * vect(0,0,1);

    foreach Owner.TraceActors(class'Actor',HitActor,HitLocatio n,HitNormal,ViewPos+1200*vector(PawnOwner.Controll er.Rotation),ViewPos)
    {
    if(HitActor == PawnOwner)
    continue;

    if ( (Pawn(HitActor) != None) && (Pawn(HitActor).PlayerReplicationInfo != None)
    && ( (PawnOwner.PlayerReplicationInfo.Team == None) || (PawnOwner.PlayerReplicationInfo.Team != Pawn(HitActor).PlayerReplicationInfo.Team)) )
    {
    if ( (NamedPlayer != Pawn(HitActor).PlayerReplicationInfo) || (Level.TimeSeconds - NameTime > 0.5) )
    {
    DisplayEnemyName(C, Pawn(HitActor).PlayerReplicationInfo);
    NameTime = Level.TimeSeconds;
    }
    NamedPlayer = Pawn(HitActor).PlayerReplicationInfo;
    break;
    }
    if(Des_Armor_Pickup(HitActor)!=none && class<DesArmor>(Des_Armor_Pickup(HitActor).Invento ryType)!=none)
    {
    ArmorClass=class<DesArmor>(Des_Armor_Pickup(HitAct or).InventoryType);
    C.Font=verdana;
    C.SetDrawColor(255,0,0,255);
    C.DrawTextJustified(ArmorClass.default.itemname,1, c.ClipX/2-c.ClipX/10,C.clipY/2-C.clipY/20,c.ClipX/2+c.ClipX/10,C.clipY/2+C.clipY/20);
    C.DrawTextJustified("Durability: "$ArmorClass.default.Charge,1,c.ClipX/2-c.ClipX/10,C.clipY/2,c.ClipX/2+c.ClipX/10,C.clipY/2+C.clipY/10);
    C.DrawTextJustified("Defense: "$ArmorClass.default.ArmorAbsorption$"%",1,c.C lipX/2-c.ClipX/10,C.clipY/2+C.clipY/10,c.ClipX/2+c.ClipX/10,C.clipY/2+C.clipY/5);


    break;
    }
    }
    }
    -----------------------------------------------------------------------------------
    The only upgrade is that if player sees an Armor, HUD draws all info about it. Simple....

    Comment


      #3
      I used the hud tutorial in the wiki. worked fine for me.

      Comment


        #4
        Bigcheeese what HUD did you extend?

        Comment


          #5
          HudBace...

          and that dint work.

          Comment


            #6
            bSpecialHUD=True


            That got me for a while.

            Comment

            Working...
            X