Page 2 of 2 FirstFirst 12
Results 41 to 58 of 58
  1. #41
    MSgt. Shooter Person
    Join Date
    May 2010
    Posts
    268

    Default

    Is it absolutely necessary to put this command line variable in the exe target shortcut?

    ?game=MyGame


    I changed all the config files (DefaultEngine.ini, UTGame.ini, etc.) to start to default with "MyGame.MyGame" - but doesnt seem to be using my version of the game (MyGame)... since I keep seeing the default hud.

    Code:
    [Engine.GameInfo]
    DefaultGame=MyGame.MyGame
    DefaultServerGame=MyGame.MyGame
    Is it alright that my folder is called MyGame and I have a MyGame class
    so its MyGame.MyGame?

    Code:
    class MyGame extends UTDeathmatch
    config(MyGame);
    
    defaultproperties
    {
    HUDType=class'MyGame.MyHUD'
    }

    Code:
    class MyHUD extends UTHUD;
    
    function DrawGameHud()
    {
    Canvas.SetPos(Canvas.ClipX/2,Canvas.ClipY/2);
    Canvas.SetDrawColor(255,255,255,255);
    Canvas.Font = class'Engine'.static.GetMediumFont();
    Canvas.DrawTextCentered("Hello World");
    }
    
    defaultproperties
    {
    }

    Not sure what I am doing wrong - it seems so very basic - It must be missing some little thing - unless it is absolutely necessary to put the "?game=MyGame" command line in the shortcut - but I dont want to do that!

    Since that seems sloppy and wont I have to do that (create new shortcut properties) everytime I package the game?

    Thanks
    Last edited by billy7777; 05-08-2010 at 01:29 PM.

  2. #42
    MSgt. Shooter Person
    Join Date
    Feb 2010
    Posts
    183

    Default

    Quote Originally Posted by billy7777 View Post
    Is it alright that my folder is called MyGame and I have a MyGame class
    so its MyGame.MyGame?
    Hi

    I dunno if I got your word right. But no, you must have a subfolder called 'classes' within your 'MyGame' folder, and put all of your UC files there, in the 'classes' folder.

  3. #43
    MSgt. Shooter Person
    Join Date
    Feb 2010
    Posts
    44

    Default

    Ok, so I just tried this tutorial and then made some stuff of my own and just wanted to say thanks, the bar thing was just what I was looking to do anyway, and now I have a sexy, sexy HUD.

  4. #44
    Skaarj
    Join Date
    Mar 2010
    Location
    Italy
    Posts
    2

    Default

    Hello everyone and thanks to all those who seek to help those most in difficulty, I managed to run the MyHud, unfortunately, although the extends of UTHUD removes some features that I want to integrate these functions are:
    1: The written (green bottom left) that communicate who is killed and who enters into the game (I suppose this is the status of goals).
    2: The red wheel that indicates which way the shots come when one is struck
    3: The message that communicates the central doublekill multikill megakill etc. ..
    Thank you for any help

  5. #45
    Skaarj
    Join Date
    Mar 2010
    Location
    Italy
    Posts
    2

    Default

    I solved the problem for those who need it I added this code to MyHud

    Code:
    function DrawGameHud()
    {
    	local float xl, yl, ypos;
    	local float TempResScale;
    	local Pawn P;
    	local int i, len;
    	local UniqueNetId OtherPlayerNetId;
    
    	// Draw any spectator information
    	if (UTOwnerPRI != None)
    	{
    		if (UTOwnerPRI.bOnlySpectator || UTPlayerOwner.IsInState('Spectating'))
    		{
    			P = Pawn(UTPlayerOwner.ViewTarget);
    			if (P != None && P.PlayerReplicationInfo != None && P.PlayerReplicationInfo != UTOwnerPRI)
    			{
    				if (  UTPlayerOwner.bBehindView )
    				{
    				DisplayHUDMessage(SpectatorMessage @ "-" @ P.PlayerReplicationInfo.PlayerName, 0.05, 0.15);
    			}
    			}
    			else
    			{
    				DisplayHUDMessage(SpectatorMessage, 0.05, 0.15);
    			}
    		}
    		else if ( UTOwnerPRI.bIsSpectator )
    		{
    			if (UTGRI != None && UTGRI.bMatchHasBegun)
    			{
    				DisplayHUDMessage(PressFireToBegin);
    			}
    			else
    			{
    				DisplayHUDMessage(WaitingForMatch);
    			}
    
    		}
    		else if ( UTPlayerOwner.IsDead() )
    		{
    		 	DisplayHUDMessage( UTPlayerOwner.bFrozen ? DeadMessage : FireToRespawnMessage );
    		}
    	}
    
    	// Draw the Warmup if needed
    	if (UTGRI != None && UTGRI.bWarmupRound)
    	{
    		Canvas.Font = GetFontSizeIndex(2);
    		Canvas.DrawColor = WhiteColor;
    		Canvas.StrLen(WarmupString, XL, YL);
    		Canvas.SetPos((Canvas.ClipX - XL) * 0.5, Canvas.ClipY * 0.175);
    		Canvas.DrawText(WarmupString);
    	}
    
    	if ( bCrosshairOnFriendly )
    	{
    		// verify that crosshair trace might hit friendly
    		bGreenCrosshair = CheckCrosshairOnFriendly();
    		bCrosshairOnFriendly = false;
    	}
    	else
    	{
    		bGreenCrosshair = false;
    	}
    
    	if ( bShowDebugInfo )
    	{
    		Canvas.Font = GetFontSizeIndex(0);
    		Canvas.DrawColor = ConsoleColor;
    		Canvas.StrLen("X", XL, YL);
    		YPos = 0;
    		PlayerOwner.ViewTarget.DisplayDebug(self, YL, YPos);
    
    		if (ShouldDisplayDebug('AI') && (Pawn(PlayerOwner.ViewTarget) != None))
    		{
    			DrawRoute(Pawn(PlayerOwner.ViewTarget));
    		}
    		return;
    	}
    
    	if (bShowAllAI)
    	{
    		DrawAIOverlays();
    	}
    
    	if ( WorldInfo.Pauser != None )
    	{
    		Canvas.Font = GetFontSizeIndex(2);
    		Canvas.Strlen(class'UTGameViewportClient'.default.LevelActionMessages[1],xl,yl);
    		Canvas.SetDrawColor(255,255,255,255);
    		Canvas.SetPos(0.5*(Canvas.ClipX - XL), 0.44*Canvas.ClipY);
    		Canvas.DrawText(class'UTGameViewportClient'.default.LevelActionMessages[1]);
    	}
    
    	DisplayLocalMessages();
    	DisplayConsoleMessages();
    
    	Canvas.Font = GetFontSizeIndex(1);
    
    	// Check if any remote players are using VOIP
    	if ( (CharPRI == None) && (PlayerOwner.VoiceInterface != None) && (WorldInfo.NetMode != NM_Standalone)
    		&& (WorldInfo.GRI != None) )
    	{
    		len = WorldInfo.GRI.PRIArray.Length;
    		for ( i=0; i<len; i++ )
    		{
    			OtherPlayerNetId = WorldInfo.GRI.PRIArray[i].UniqueID;
    			if ( PlayerOwner.VoiceInterface.IsRemotePlayerTalking(OtherPlayerNetId)
    				&& (WorldInfo.GRI.PRIArray[i] != PlayerOwner.PlayerReplicationInfo)
    				&& (UTPlayerReplicationInfo(WorldInfo.GRI.PRIArray[i]) != None)
    				&& (PlayerOwner.GameplayVoiceMuteList.Find('Uid', OtherPlayerNetId.Uid) == INDEX_NONE) )
    			{
    				ShowPortrait(UTPlayerReplicationInfo(WorldInfo.GRI.PRIArray[i]));
    				break;
    			}
    		}
    	}
    
    
    	// Draw the character portrait
    	if ( CharPRI != None  )
    	{
    		DisplayPortrait(RenderDelta);
    	}
    
    	if ( bShowClock && !bIsSplitScreen )
    	{
       		DisplayClock();
       	}
    
    	if (bIsSplitScreen && bShowScoring)
    	{
    		DisplayScoring();
    	}
    
    	// If the player isn't dead, draw the living hud
    	if ( !UTPlayerOwner.IsDead() )
    	{
    		DrawLivingHud();
    	}
    
    	if ( bHasMap && bShowMap )
    	{
    		TempResScale = ResolutionScale;
    		if (bIsSplitScreen)
    		{
    			ResolutionScale *=2;
    		}
    		DisplayMap();
    		ResolutionScale = TempResScale;
    	}
    
    	DisplayDamage();
    
    	if (UTPlayerOwner.bIsTyping && WorldInfo.NetMode != NM_Standalone)
    	{
    		DrawMicIcon();
    	}
    
    }

  6. #46

    Default

    This doesn't work with the MAY release - Scaleform.
    It's like it does not register that you want to use your own UTHUD class.

    How to change it, so it does?

  7. #47
    MSgt. Shooter Person
    Join Date
    Mar 2010
    Posts
    48

    Default

    i have one simple question, this tutorial create a hud from a image created from any software of design, like photoshop???

  8. #48
    Veteran
    Join Date
    May 2007
    Location
    Above KillZ, Below StallZ
    Posts
    9,953

    Default

    Quote Originally Posted by nikolajp View Post
    This doesn't work with the MAY release - Scaleform.
    It's like it does not register that you want to use your own UTHUD class.

    How to change it, so it does?
    bUseClassicHud=true
    http://www.ericbla.de http://www.dungeondefenders.com http://en.wikipedia.org/wiki/Warm_Gun http://www.rekoil.com http://www.groundbranch.com

    - Please don't send me private messages asking programming questions, those would be better asked on the Programming forum here. Thanks

  9. #49
    Skaarj
    Join Date
    Jun 2010
    Location
    Florida
    Posts
    9

    Default

    Quote Originally Posted by Blade[UG] View Post
    bUseClassicHud=true
    Just as an aside, do you get bonus points for repeating the same line over and over? When looking up to do a HUD, I must have seen you say the same thing almost a dozen times in different threads. Kudos to you for keeping your cool about it lol...

  10. #50
    Veteran
    Join Date
    May 2007
    Location
    Above KillZ, Below StallZ
    Posts
    9,953

    Default

    haha.. it's something we've run into a lot, with the new hud stuff, and it apparently isn't obvious, and it's an easy one to answer
    http://www.ericbla.de http://www.dungeondefenders.com http://en.wikipedia.org/wiki/Warm_Gun http://www.rekoil.com http://www.groundbranch.com

    - Please don't send me private messages asking programming questions, those would be better asked on the Programming forum here. Thanks

  11. #51
    MSgt. Shooter Person
    Join Date
    Jan 2010
    Location
    Arizona
    Posts
    38
    Gamer IDs

    Gamertag: rickjones435

    Default

    so I aM new at this and I have followed all the steps. but I am still not seing the new Hud just the olde UTHUD for the June UDK release.

  12. #52
    MSgt. Shooter Person
    Join Date
    Sep 2010
    Posts
    117

    Default

    Hey al, been following the same tutorial, got the hud working fine =]
    Managed to tweak it to a bar 8 rectangles long.

    The problem I have is, I no longer get on screen messages from my touch triggers, and can no longer interact with the use triggers, does anyone know why this is?

    Heres my HUD code:

    Code:
    class GlitchHUD extends UTHUD;
    
    
    
     function DrawBar(String Title, float Value, float MaxValue,int X, int Y, int R, int G, int B)
    {
    
        local int PosX,NbCases,i;
    
        PosX = X; // Where we should draw the next rectangle
        NbCases = 8 * Value / MaxValue; // Number of active rectangles to draw
        i=0; // Number of rectangles already drawn
    
        /* Displays active rectangles */
        while(i < NbCases && i < 8)
        {
            Canvas.SetPos(PosX,Y);
            Canvas.SetDrawColor(R,G,B,200);
            Canvas.DrawRect(16,12);
    
            PosX += 18;
            i++;
    
        }
    
        /* Displays deactived rectangles */
        while(i < 8)
        {
            Canvas.SetPos(PosX,Y);
            Canvas.SetDrawColor(255,255,255,80);
            Canvas.DrawRect(16,12);
    
            PosX += 18;
            i++;
    
        }
    
        /* Displays a title */
        Canvas.SetPos(PosX + 4,Y);
        Canvas.SetDrawColor(R,G,B,200);
        Canvas.Font = class'Engine'.static.GetSmallFont();
        Canvas.DrawText(Title);
    
    } 
    
    function DrawGameHud()
    {
    
        if ( !PlayerOwner.IsDead() && !UTPlayerOwner.IsInState('Spectating'))
        {
            DrawBar("LIFE",PlayerOwner.Pawn.Health, PlayerOwner.Pawn.HealthMax,20,20,200,80,80);         
    		DrawBar("SHOTGUN AMMO",UTWeapon(PawnOwner.Weapon).AmmoCount, UTWeapon(PawnOwner.Weapon).MaxAmmoCount ,20,40,80,80,200);     }
    
    }
    
    
    	
    	
    	function DisplayLocalMessages()
    {
    	if (!PlayerOwner.bCinematicMode)
    	{
    		MaxHUDAreaMessageCount = bIsSplitScreen ? 1 : 2;
    		Super.DisplayLocalMessages();
    	}
    }
    
    function DisplayConsoleMessages()
    {
    	local int Idx, XPos, YPos;
    	local float XL, YL;
    
    	if (ConsoleMessages.Length == 0 || PlayerOwner.bCinematicMode)
    	{
    		return;
    	}
    
    	for (Idx = 0; Idx < ConsoleMessages.Length; Idx++)
    	{
    		if ( ConsoleMessages[Idx].Text == "" || ConsoleMessages[Idx].MessageLife < WorldInfo.TimeSeconds )
    		{
    			ConsoleMessages.Remove(Idx--,1);
    		}
    	}
    	ConsoleMessagePosX = bDisplayingPowerups ? 0.1 : 0.0;
    	XPos = (ConsoleMessagePosX * HudCanvasScale * Canvas.SizeX) + (((1.0 - HudCanvasScale) / 2.0) * Canvas.SizeX);
    	YPos = (ConsoleMessagePosY * HudCanvasScale * Canvas.SizeY) + (((1.0 - HudCanvasScale) / 2.0) * Canvas.SizeY);
    
    	Canvas.Font = GetFontSizeIndex(0);
    
    	Canvas.TextSize ("A", XL, YL);
    
    	YPos -= YL * ConsoleMessages.Length; // DP_LowerLeft
    	YPos -= YL; // Room for typing prompt
    
    	for (Idx = 0; Idx < ConsoleMessages.Length; Idx++)
    	{
    		if (ConsoleMessages[Idx].Text == "")
    		{
    			continue;
    		}
    		Canvas.StrLen( ConsoleMessages[Idx].Text, XL, YL );
    		Canvas.SetPos( XPos, YPos );
    		Canvas.DrawColor = ConsoleMessages[Idx].TextColor;
    		Canvas.DrawText( ConsoleMessages[Idx].Text, false );
    		YPos += YL;
    	}
    }
    
    defaultproperties
    {
    MessageOffset(0)=0.15
    	MessageOffset(1)=0.242
    	MessageOffset(2)=0.36
    	MessageOffset(3)=0.58
    	MessageOffset(4)=0.78
    	MessageOffset(5)=0.83
    	MessageOffset(6)=2.0
    	
    		TextRenderInfo=(bClipText=true)
    
    		
    		
    }
    Thanks

    Dodge

  13. #53
    MSgt. Shooter Person
    Join Date
    Apr 2010
    Posts
    84

    Default

    Hey Guys,

    I'm getting 2 warnings when trying to run this,

    Warning, ClassProperty Engine.GameInfo:HUDType: unresolved reference to 'class'MyFolder.MyHUD

    And the other one,

    Warning, Invalid property value in defaults: HUDType=class'MyFolder.MyHUD'

    Any idea how to fix these things?

    Thanks,
    "In my letters I like to put;

    P.S. This is what part of the alphabet would look like if Q and R were eliminated" - Mitch Hedberg

  14. #54
    Prisoner 849
    Join Date
    Jan 2010
    Posts
    901

    Default

    i'm thinking you don't have a class named MyHud in the Myfolder\Classes\ folder.

  15. #55
    MSgt. Shooter Person
    Join Date
    Apr 2010
    Posts
    84

    Default

    Quote Originally Posted by thommie View Post
    i'm thinking you don't have a class named MyHud in the Myfolder\Classes\ folder.
    I have this,

    class MyHUD extends UTHUD;
    "In my letters I like to put;

    P.S. This is what part of the alphabet would look like if Q and R were eliminated" - Mitch Hedberg

  16. #56
    Prisoner 849
    Join Date
    Jan 2010
    Posts
    901

    Default

    did you also add the MyFolder to the DefaultEngineUDK.ini file?

  17. #57
    MSgt. Shooter Person
    Join Date
    Mar 2011
    Location
    Estonia
    Posts
    52
    Gamer IDs

    PSN ID: birdhouse2468

    Default

    Error, Bad or missing expression after '!': 'UTPlayerOwner'

    What am I doing wrong?

    E: Fixed it.
    Last edited by birdhouse13579; 05-15-2011 at 08:02 AM.
    "The only true wisdom is in knowing you know nothing." - Socrates

    My deviantART

  18. #58
    Iron Guard
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    501

    Default

    The Tut is working nicely for me, also works perfectly with my canvas crosshair... now my question is, the bar is displayed at the top of the screen, I'd like to have it at the bottom...Now just setting the Y (?) value from 20 to, like 740 displays the bar right at the default PIE resolution, but now with other resolution, then it's wrong again. Probably because the Y position is just like a pixel value.

    Is there a way to have the bottom placed at the bottom of the screen? Atm it's like "Bar, go down *Value* pixels down from top!", how would you make it "Bar, go up *Value* pixels from bottom!"... like, some -Y somewhere or stuff?
    /ninjapirates/
    ---Roccy Laboratories//#1 Crossmedia 2010[Multimedia]

    I hate reference images...I never find good ones


 
Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.