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
PlayerControllerCode:class TestGame extends UTGame; defaultproperties { PlayerControllerClass=class'TestGame.TestPlayerController' }
Actual HUD Class (wrapper)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 { }
HUD Movie ClassCode: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 { }
And launch logCode: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 }
I hope, you will notice if i missed something in code.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
Such a shame there are no spoiler tag here



Reply With Quote


Bookmarks