Results 1 to 19 of 19
  1. #1
    MSgt. Shooter Person
    Join Date
    Apr 2012
    Location
    Kiev, Ukraine
    Posts
    482

    Default Not working HUD (yep, another one)

    Can't understand, why my HUD isn't displayed, while i'm playing. I made my HUD by simple copypasting major part of code from original GFxMinimapHud and UTGFxHudWrapper. But in the end, i just haven't any HUD on screen. HUD is quite simple, i made only Health info. Here are sources
    GameInfo
    Code:
    class TestGame extends UTGame;
    
    defaultproperties
    {
        PlayerControllerClass=class'TestGame.TestPlayerController'
    }
    PlayerController
    Code:
    class TestPlayerController extends UTPlayerController;
    
    simulated function PostBeginPlay()
    {
        super.PostBeginPlay();
    }
    
    reliable client function ClientSetHUD(class<HUD> newHUDType)
    {
        if(myHUD != none)
            myHUD.Destroy();
        myHUD = spawn(class'TestHUD', self);
    }
    
    defaultproperties
    {
    }
    Actual HUD Class (wrapper)
    Code:
    class TestHUD extends UTHUDBase;
    
    var MyGFxHUD HudMovie;
    
    singular event Destroyed()
    {
    	RemoveMovies();
    
    	Super.Destroyed();
    }
    
    function RemoveMovies()
    {
    	if ( HUDMovie != None )
    	{
    		HUDMovie.Close(true);
    		HUDMovie = None;
    	}
    }
    
    simulated function PostBeginPlay()
    {
    	super.PostBeginPlay();
    
    	CreateHUDMovie();
    }
    
    function CreateHUDMovie()
    {
    	HudMovie = new class'MyGFxHUD';
    	HudMovie.SetTimingMode(TM_Real);
    	HudMovie.Init(class'Engine'.static.GetEngine().GamePlayers[HudMovie.LocalPlayerOwnerIndex]);
    }
    
    event PostRender()
    {
        super.PostRender();
        
        if (HudMovie != none)
    	HudMovie.TickHud(0);
    }
    
    defaultproperties
    {
    }
    HUD Movie Class
    Code:
    class MyGFxHUD extends GFxMoviePlayer;
    
    var GFxObject HealthTF;
    
    var float LastHealth;
    
    function Init(optional LocalPlayer player)
    {
        super.Init(player);
        
        Start();
        Advance(0);
        
        LastHealth = -110;
        
        HealthTF = GetVariableObject("_root.health_mc.health_txt");
    }
    
    function TickHud(float DeltaTime)
    {
        local UTPawn UTP;
        local PlayerController PC;
        
        PC = GetPC();
    
        UTP = UTPawn(PC.Pawn);
        if (UTP == none)
            return;
        
        if (LastHealth != UTP.Health)
        {
            HealthTF.SetText(UTP.Health);
            LastHealth = UTP.Health;
        }
    }
    
    defaultproperties
    {
        bDisplayWithHudOff=FALSE
        MovieInfo=SwfMovie'TestGameFlash.test_hud'
        bEnableGammaCorrection=false
    }
    And launch log

    Code:
    Log: Log file open, 05/13/12 21:38:59
    Init: WinSock: version 1.1 (2.2), MaxSocks=32767, MaxUdp=65467
    DevConfig: GConfig::LoadFile associated file:  ..\..\UDKGame\Config\UDKCompat.ini
    DevConfig: GConfig::Find has loaded file:  ..\..\Engine\Config\ConsoleVariables.ini
    Init: Version: 9656
    Init: Epic Internal: 0
    Init: Compiled (32-bit): Mar 20 2012 19:27:46
    Init: Changelist: 1202061
    Init: Command line: Test?GoalScore=0?TimeLimit=0?Game=TestGame.TestGame  -log
    Init: Base directory: D:\GameDev\UDK\Binaries\Win32\
    [0000.40] Init: Computer: LENTINANT-
    [0000.40] Init: User: lentinant
    [0000.40] Init: CPU Page size=4096, Processors=2
    [0000.40] Init: High frequency timer resolution =1.790537 MHz
    [0000.40] Init: Memory total: Physical=3.0GB (3GB approx) Pagefile=6.0GB Virtual=2.7GB
    [0000.58] Log: Steam Client API initialized 1
    [0001.80] Log: Steam Game Server API initialized 1
    [0001.83] Init: WinSock: I am lentinant- (192.168.134.175:0)
    [0001.83] Init: Presizing for 0 objects not considered by GC, pre-allocating 0 bytes.
    [0001.84] Init: Object subsystem initialized
    [0001.97] Init: OS stats:
    [0001.97] Init: 	Windows 7 Service Pack 1
    [0001.97] Init: 	RemoteDesktop=0
    [0001.97] Init: Memory stats:
    [0001.97] Init: 	Physical: 3070MB
    [0001.97] Init: 	Virtual: 2799MB
    [0001.97] Init: 	PageFile: 6139MB
    [0001.97] Init: CPU stats:
    [0001.97] Init: 	MeasuredPerformanceTime: 258.104 (stored result)
    [0001.97] Init: 	Hyperthreaded: 0
    [0001.97] Init: 	NumProcessorsPerCPU: 1
    [0001.97] Init: 	NumLogicalProcessors: 2
    [0001.97] Init: 	NumPhysicalProcessors: 2
    [0001.97] Init: 	MaxSpeed: 1833
    [0001.97] Init: 	CurrentSpeed: 1833
    [0001.97] Init: 	CoresPerProcessor: 2
    [0001.97] Init: 	IsOnBattery: 0
    [0001.97] Init: 	BatteryLevel: 100
    [0001.97] Init: 	Manufacturer: Intel
    [0001.97] Init: 	CPUName: Unknown INTEL CPU
    [0001.97] Init: 	L1CacheSize: 32
    [0001.97] Init: 	L2CacheSize: -1
    [0001.97] Init: 	Architecture: x86
    [0001.97] Init: GPU stats:
    [0001.97] Init: 	VendorID: 000010DE
    [0001.97] Init: 	DeviceID: 00000425
    [0001.97] Init: 	DriverVersion: 8.17.12.9610
    [0001.97] Init: 	DeviceName: NVIDIA GeForce 8600M GS   
    [0001.97] Init: 	DriverName: nvd3dum.dll
    [0001.97] Init: 	PixelShaderVersion: 3
    [0001.97] Init: 	VertexShaderVersion: 3
    [0001.97] Init: 	VRAMQuantity: 512
    [0001.97] Init: 	DedicatedVRAM: 497
    [0001.97] Init: 	AdapterCount: 1
    [0001.97] Init: 	SupportsHardwareTnL: 1
    [0001.98] Init: Machine  detected compatibility level: Composite: 3. CPU: 5. GPU: 3.
    [0001.98] Init: Previous detected compatibility level: Composite: 3. CPU: 5. GPU: 3.
    [0002.02] Log: Shader platform (RHI): PC-D3D-SM3
    [0003.37] Log: PhysX GPU Support: DISABLED
    [0003.38] Init: Initializing FaceFX...
    [0003.38] Init: FaceFX 1.7.4 initialized.
    [0003.40] Init: XAudio2 using '8=0<8:8 (Realtek High Definition Audio)' : 2 channels at 48 kHz using 32 bits per sample (channel mask 0x3)
    [0008.08] Init: Finished loading startup packages in 4.34 seconds
    [0008.10] Log: 70589 objects as part of root set at end of initial load.
    [0008.10] Log: 0 out of 0 bytes used by permanent object pool.
    [0008.10] Log: Initializing Engine...
    [0008.22] Init: UEngine initialized
    [0008.26] Init: XAudio2Device initialized.
    [0008.35] Init: Client initialized
    [0009.73] Log: Initializing Steamworks
    [0009.74] Log: Logged in as 'lentinant'
    [0009.98] Log: LoadMap: Test?Name=Player?Team=255?GoalScore=0?TimeLimit=0?Game=TestGame.TestGame
    [0010.34] Log: Game class is 'TestGame'
    [0010.48] Log: Primary PhysX scene will be in software.
    [0010.48] Log: Creating Primary PhysX Scene.
    [0010.49] Log: Bringing World Test.TheWorld up for play (0) at 2012.05.13-21.39.10
    [0010.53] DevPhysics: Error (1) in file ..\..\Physics\src\NpActor.cpp, line 246: Actor::setAngularDamping: Actor must be dynamic!
    [0010.53] DevPhysics: Error (1) in file ..\..\Physics\src\NpActor.cpp, line 225: Actor::setLinearDamping: Actor must be dynamic!
    [0010.54] Log: Bringing up level for play took: 0.108150
    [0010.58] Warning: Warning, Failed to load 'SwfMovie ?INT?Scaleform.IME.MoviePath?': Failed to find object 'SwfMovie ?INT?Scaleform.IME.MoviePath?'
    [0010.58] Log: GFx attempted to load missing object [?INT?Scaleform.IME.MoviePath?]
    [0010.58] Log: ########### Finished loading level: 0.596203 seconds
    [0010.58] Init: Game engine initialized
    [0010.58] Log: Initializing Engine Completed
    [0016.01] Log: >>>>>>>>>>>>>> Initial startup: 16.01s <<<<<<<<<<<<<<<
    [0016.06] Error: Can't start an online game that hasn't been created
    [0016.06] ScriptLog: START MATCH
    [0017.41] Warning: Warning, Failed to load 'SwfMovie ?INT?Scaleform.IME.MoviePath?': Failed to find object 'SwfMovie ?INT?Scaleform.IME.MoviePath?'
    [0017.41] Log: GFx attempted to load missing object [?INT?Scaleform.IME.MoviePath?]
    [0020.37] ScriptLog: UTPlayerController::QuitToMainMenu() - Online cleanup failed, finishing quit.
    [0020.37] ScriptLog: ------ QUIT TO MAIN MENU --------
    [0020.37] Log: Failed; returning to Entry
    [0020.42] Log: LoadMap: UDKFrontEndMap?closed?Name=Player?Team=255
    [0020.42] Log: --- LOADING MOVIE START ---
    [0020.52] ScriptWarning: Invalid user index (255) specified for ClearReadProfileSettingsCompleteDelegate()
    	OnlineSubsystemSteamworks Transient.OnlineSubsystemSteamworks_0
    	Function OnlineSubsystemSteamworks.OnlineSubsystemSteamworks:ClearReadProfileSettingsCompleteDelegate:00FE
    [0020.52] Log: UPhysicsAssetInstance::InitInstance : No RBPhysScene: UTPawn_1
    [0020.57] Log: Game class is 'UTEntryGame'
    [0020.59] Log: Primary PhysX scene will be in software.
    [0020.59] Log: Creating Primary PhysX Scene.
    [0020.59] Log: Bringing World UDKFrontEndMap.TheWorld up for play (0) at 2012.05.13-21.39.20
    [0020.59] Log: Bringing up level for play took: 0.022275
    [0020.62] Error: StopLocalVoiceProcessing: Ignoring stop request for non-owning user
    [0020.62] Log: ########### Finished loading level: 0.196370 seconds
    [0020.67] Warning: Warning, Failed to load 'SwfMovie ?INT?Scaleform.IME.MoviePath?': Failed to find object 'SwfMovie ?INT?Scaleform.IME.MoviePath?'
    [0020.67] Log: GFx attempted to load missing object [?INT?Scaleform.IME.MoviePath?]
    [0021.21] Log: --- LOADING MOVIE TIME: 786 ms ---
    [0023.43] Log: Closing by request
    [0023.44] Log: appRequestExit(0)
    [0023.57] ScriptWarning: Accessed None 'AccessControl'
    	UTEntryGame UDKFrontEndMap.TheWorld:PersistentLevel.UTEntryGame_0
    	Function Engine.GameInfo:PreExit:000A
    [0023.58] ScriptWarning: Invalid user index (255) specified for ClearReadProfileSettingsCompleteDelegate()
    	OnlineSubsystemSteamworks Transient.OnlineSubsystemSteamworks_0
    	Function OnlineSubsystemSteamworks.OnlineSubsystemSteamworks:ClearReadProfileSettingsCompleteDelegate:00FE
    [0023.58] Exit: Preparing to exit.
    [0023.75] Exit: Game engine shut down
    [0023.89] Exit: Windows client shut down
    [0023.89] Exit: XAudio2 Device shut down.
    [0023.96] Exit: Object subsystem successfully closed.
    [0024.00] Log: Shutting down FaceFX...
    [0024.00] Log: FaceFX shutdown.
    [0024.05] Exit: Exiting.
    [0024.06] Log: Log file closed, 05/13/12 21:39:23
    I hope, you will notice if i missed something in code.
    Such a shame there are no spoiler tag here

  2. #2
    MSgt. Shooter Person
    Join Date
    Sep 2010
    Location
    Australia
    Posts
    148

    Default

    You haven't told it to use your HUD in your TestGame gameinfo.

    In the default properties add this:
    Code:
    HUDType=class'TestGame.TestHUD'
    bUseClassicHUD=true
    » Team Friendship (UDK 4P co-op) "Like" our Facebook Page for dev-blog updates
    » Audio Tours Australia - MP3 walking tours of Australia

  3. #3
    MSgt. Shooter Person
    Join Date
    Apr 2012
    Location
    Kiev, Ukraine
    Posts
    482

    Default

    It didn't solved the problem. Nothing else wrong? Mb, this?
    Code:
    [0020.67] Warning: Warning, Failed to load 'SwfMovie ?INT?Scaleform.IME.MoviePath?': Failed to find object 'SwfMovie ?INT?Scaleform.IME.MoviePath?'
    [0020.67] Log: GFx attempted to load missing object [?INT?Scaleform.IME.MoviePath?]
    Also, according to log messages, which i added to code to check HUD, it spawned correctly with code i posted. It seems trouble is in loading swf file.
    Last edited by lentinant; 05-14-2012 at 09:20 AM.

  4. #4
    MSgt. Shooter Person
    Join Date
    Apr 2012
    Location
    Kiev, Ukraine
    Posts
    482

    Default

    Ok, than one more question. Are there any requisitions for imported swf file, so it can be used for HUD (package location etc)?

  5. #5
    MSgt. Shooter Person
    Join Date
    Apr 2012
    Location
    Kiev, Ukraine
    Posts
    482

    Default

    Bump. Anyone? Can some1 send me simple source of working custom HUD?

  6. #6
    MSgt. Shooter Person
    Join Date
    Apr 2012
    Location
    Kiev, Ukraine
    Posts
    482

    Default

    Bump one more time. Btw, forgot to mention, i am using 2012-03 UDK version, mb, some code is just not compatible?

  7. #7

    Default

    Is your map using the proper game type (TestGame)? If not, then you won't see the HUD. Be sure to save the map with a prefix like TG- (including the hyphen). Then in DefaultGame.ini add:

    +DefaultMapPrefixes=(Prefix="TG",bUsesCommonPackag e=FALSE,GameType="GameSourceFolderName.TestGame")

    Of course, replace GameSourceFolderName with the actual directory name of your game's dev folder.

    Also, did you add your game's source directory to the list of packages for Unreal to compile?

    Add something like this:

    +ModEditPackages=GameSourceFolderName

    To the DefaultEngine.ini file, under [UnrealEd.EditorEngine]

  8. #8
    MSgt. Shooter Person
    Join Date
    Apr 2012
    Location
    Kiev, Ukraine
    Posts
    482

    Default

    Quote Originally Posted by Matt Doyle View Post
    Is your map using the proper game type (TestGame)? If not, then you won't see the HUD. Be sure to save the map with a prefix like TG- (including the hyphen). Then in DefaultGame.ini add:

    +DefaultMapPrefixes=(Prefix="TG",bUsesCommonPackag e=FALSE,GameType="GameSourceFolderName.TestGame")
    I'm launching game with this bat (Test is map name)
    Code:
    D:\GameDev\UDK\Binaries\Win32\UDK.exe  Test?GoalScore=0?TimeLimit=0?Game=TestGame.TestGame  -log
    So, i think, Game Info is set correctly. Besides, i've added some log commands to trace correct Game Info spawn, so, i am confident game info is correct (and same with hud class)

    Quote Originally Posted by Matt Doyle View Post
    Of course, replace GameSourceFolderName with the actual directory name of your game's dev folder.

    Also, did you add your game's source directory to the list of packages for Unreal to compile?

    Add something like this:

    +ModEditPackages=GameSourceFolderName

    To the DefaultEngine.ini file, under [UnrealEd.EditorEngine]
    Already done, i know essentials of US programming. The only thing is i'm using +EditPackages instead of +ModEditPackages
    Last edited by lentinant; 05-16-2012 at 04:43 PM.

  9. #9

    Default

    Hmm. Your code looks ok. No idea why it isn't working for you then. Could be something wrong with your Flash file perhaps. I would advise creating a very simple Flash file, with a blue box on the stage, and attempting to get that to display.

  10. #10
    MSgt. Shooter Person
    Join Date
    Apr 2012
    Location
    Kiev, Ukraine
    Posts
    482

    Default

    Then question about swf import. The way to file must be MovieInfo=SwfMovie'PackageName.HudFileName', and it doesn't matter where package is saved (ofc, inside Content folder)?

  11. #11

    Default

    Save your packages in the content folder, but usually in a sub folder below that. But Unreal will know where it is at, so it shouldn't be an issue. Another thing to try is to use the Kismet OpenGFxMovie to try to display the HUD on the screen. If that works, then it is something wrong with your code most likely. If that doesn't work, then it's probably in your actual Flash file where the problem exists.

  12. #12
    MSgt. Shooter Person
    Join Date
    Apr 2012
    Location
    Kiev, Ukraine
    Posts
    482

    Default

    Quote Originally Posted by Matt Doyle View Post
    Save your packages in the content folder, but usually in a sub folder below that. But Unreal will know where it is at, so it shouldn't be an issue. Another thing to try is to use the Kismet OpenGFxMovie to try to display the HUD on the screen. If that works, then it is something wrong with your code most likely. If that doesn't work, then it's probably in your actual Flash file where the problem exists.
    With Kismet it works correctly.

  13. #13
    MSgt. Shooter Person
    Join Date
    May 2012
    Posts
    98

    Default

    bump same issue here i can't get my HUD to display and i tried all the same things mentioned did anyone ever fix it?

  14. #14
    MSgt. Shooter Person
    Join Date
    Apr 2012
    Location
    Kiev, Ukraine
    Posts
    482

    Default

    BTW, i've looked into UTGame class, and HUD class is not determined here. Line of code in def props
    Code:
    HUDType=class'UTGame.UTHUD'
    And that's not wrapper, it's "grandfather" of it (wrapper extends UTHUDBase, which extends UTHUD), and wrapper is determined in PlayerController.

  15. #15
    MSgt. Shooter Person
    Join Date
    Apr 2012
    Location
    Kiev, Ukraine
    Posts
    482

    Default

    Ok, i've added SwitchHud exec function to my PlayerController
    Code:
    exec function SwitchHud()
    {
    	local class<HUD> NewHUDClass;
    
    	`log("SWITCHEROO THE HUD "$WorldInfo.GRI.GameClass);
    	NewHUDClass = WorldInfo.GRI.GameClass.Default.HUDType;
    	if ( TestHUD(myHUD) == None )
    	{
    		NewHUDClass = class'TestHUD';
    	}
    	ClientSetHud(NewHUDClass);
    }
    And that's what log gives me when i use it
    Code:
    [0018.80] ScriptLog: SWITCHEROO THE HUD TestGame
    [0018.81] Warning: Warning, Failed to load 'SwfMovie ?INT?Scaleform.IME.MoviePath?': Failed to find object 'SwfMovie ?INT?Scaleform.IME.MoviePath?'
    [0018.81] Log: GFx attempted to load missing object [?INT?Scaleform.IME.MoviePath?]
    So, what that means, guys?

  16. #16
    MSgt. Shooter Person
    Join Date
    Apr 2012
    Location
    Kiev, Ukraine
    Posts
    482

    Default

    Got it working. Dunno how. Installed May UDK version, made simple source code using this example, and it works. Also, made INT file for my TestGame, but not sure if it caused my problem. Next step - making my own interface SWF))

  17. #17
    MSgt. Shooter Person
    Join Date
    Mar 2012
    Location
    Poland
    Posts
    50

    Default

    heh, im also getting troubles with adding custom gfx HUD, got everything hooked in GameInfo,
    but from the logs during player spawn i saw that:
    1. spawning player
    2. hud post begin play
    3. spawning hudmovie class, spawned succesfully
    4. console warning that "OnlineSub" property in PlayerController function "ClientSetOnlineStatus" is null
    5. after this warning, my HUDMovie is being destoryed by RemoveMovies(); call


    i was basing on UThudwrapper class

    Code:
    function RemoveMovies()
    {
    	if ( HUDMovie != None )        //  <-- this if statement was destroying my movie
    	{
    		HUDMovie.Close(true);  
    		HUDMovie = None;
    	}
    	if (InventoryMovie != None)
    	{
    		InventoryMovie.Close(true);  
    		InventoryMovie = None;     
    	}
    	Super.RemoveMovies();
    }
    but why this evil function got fired?
    Last edited by milerk; 06-15-2012 at 11:21 AM.

  18. #18
    MSgt. Shooter Person
    Join Date
    Apr 2012
    Location
    Kiev, Ukraine
    Posts
    482

    Default

    milerk, my PlayerController doesn't determine nothing else, it just extends UTPlayerController.
    Code:
    class TestPlayerController extends UTPlayerController;
    
    defaultproperties
    {
    }
    Another sources are not dealing with that func either.

    Code:
    class TestGame extends UTGame;
    
    defaultproperties
    {
        PlayerControllerClass=class'TestPlayerController'
        HUDType=class'TestGame.TestHudWrapper'
        bUseClassicHUD=true
    }
    Code:
    class TestHudWrapper extends UTHUDBase;
    
    var TestHud HudMovie;
    
    var class<TestHud> HUDClass;
    
    simulated function PostBeginPlay()
    {
        super.PostBeginPlay();
        CreateHUDMovie();
    }
    
    function CreateHUDMovie()
    {
        HudMovie = new HUDClass;
        HudMovie.SetTimingMode(TM_Real);
        HudMovie.Init(class'Engine'.static.GetEngine().GamePlayers[HudMovie.LocalPlayerOwnerIndex]);
    }
    
    event PostRender()
    {
        super.PostRender();
        
        if(HudMovie!=none)
        {
            HudMovie.TickHud(0);
        }
    }
    
    defaultproperties
    {
        HUDClass = class'TestHud'
    }
    Mb, it's problem of game info? What gametype are you extending?
    Last edited by lentinant; 06-15-2012 at 04:23 AM.

  19. #19
    MSgt. Shooter Person
    Join Date
    Mar 2012
    Location
    Poland
    Posts
    50

    Default

    i also downloaded newest UDK, created very basic gfxHud and it started working to me somehow,
    probably extending UTGame fixed my problem, thanks ;]


 

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.