Announcement

Collapse
No announcement yet.

Frustration is setting in

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

    Frustration is setting in

    Hi,
    I just started using UDK and was looking into customizing a HUD after watching Matt Doyles amazing informative video, Grosie's Scaleform HUD tutorial and Vicki the smiths tutorials on HUD creation using Scaleform. I wrote out the scriptsand tried everything including reading the whole thread from Grosie's post. I managed to compile everything without errors which was step 1 but now I'm at an impasse I cant seem to find anything wrong with my script based of what other peoples working scripts say. I start my level and it has the same UT standard HUD.

    If i change extends to UDKGame or GameInfo it gives me spectatorcam mode
    CNRushGameInfo.uc
    Code:
    class CNRushHUDGameInfo extends UTGame;
    
    function StartMatch(){
    	super(UTGame).StartMatch();
    }
    
    defaultproperties
    [
         Acronym="CN"
         
         PlayerControllerClass=class 'RushGFxUI.CNRushPlayerController'
         DefaultPawnClass = class 'RushGFxUI.CNRushPawn'
        
        bUseClassicHUD =True;
         HUDtype=class 'RushGFxUI.CNRushHUD'
    
         bdelayedstart=false'
         bresartlevel=false
         name="Default__CNRushHUDGameInfo"
        
    ]
    This is my CNRushHUD.uc
    Code:
    Class CNRushHUD extends UTHUD;
    
    var CNRushGFxHUD HudMovie;
    
    singular event Destroyed() {
     if (HudMovie != none) {
     HudMovie.Close(true);
     HudMovie = none;
     }
    }
    
    
    simulated function PostBeginPlay() {
     super.PostBeginPlay();
    
     HudMovie = new class'CNRushGFxHUD';
     HudMovie.SetTimingMode(TM_Real);
     HudMovie.Init();
    }
    
    event PostRender() {
     HudMovie.TickHUD();
    }
    
    DefaultProperties
    {
    }
    This is my CNRushGFxHUD.uc
    Code:
    Class CNRushGFxHUD Extends GFxMoviePlayer;
    
    var float LastHealthpc;
    
    var GFxObject HealthMC, HealthBarMC;
    var GFxObject HealthTF;
    
    function int roundNum(float NumIn) {
     local int iNum;
     local float fNum;
    
     fNum = NumIn;
     iNum = int(fNum);
     fNum -= iNum;
     if (fNum >= 0.5f) {
     return (iNum + 1);
     }
     else {
     return iNum;
     }
    }
    
    function int getpercentage(int val, int max) {
     return roundNum((float(val) / float(max)) * 100.0f);
    }
    
    function Init(optional LocalPlayer LocPlay) {
      Start();
     Advance(0.f);
    
      LastHealthpc = -1337;
    
      HealthMC = GetVariableObject("_root.healthbar_mc");
     HealthBarMC = GetVariableObject("_root.healthbar_mc.bar_mc");
     HealthTF = GetVariableObject("_root.healthbar_mc.health_txt");
    }
    
    function TickHUD() {
     local UTPawn UTP;
    
         UTP = UTPawn(GetPC().pawn);
     if (UTP == None) {
     return;
     }
    
     if (LastHealthpc != getpercentage(UTP.Health, UTP.HealthMax)) {
      LastHealthpc = getpercentage(UTP.Health, UTP.HealthMax);
      HealthBarMC.SetFloat("_xscale", (LastHealthpc > 100) ? 100.0f : LastHealthpc);
     HealthTF.SetString("text", round(LastHealthpc)$"%");
     }
    }
    
    DefaultProperties
    {
     
     bDisplayWithHudOff=False
     MovieInfo=SwfMovie'CNRushHUD.HUD.GfxHud'
     bEnableGammaCorrection = false
    }

    It almost seems as if the script doesnt fire at all. I changed the UDKGame\Config\DefaultEngine,Defaultgames to fire my Gameinfo. I can see the ppaawn cls in actors in the editor, the gametype for the level is changed to RushGFXUI for PIE and it shows up there in the world properties. Im stumped.

    #2
    Originally posted by Edwadosan View Post
    Hi,
    I just started using UDK and was looking into customizing a HUD after watching Matt Doyles amazing informative video, Grosie's Scaleform HUD tutorial and Vicki the smiths tutorials on HUD creation using Scaleform. I wrote out the scriptsand tried everything including reading the whole thread from Grosie's post. I managed to compile everything without errors which was step 1 but now I'm at an impasse I cant seem to find anything wrong with my script based of what other peoples working scripts say. I start my level and it has the same UT standard HUD.

    If i change extends to UDKGame or GameInfo it gives me spectatorcam mode
    CNRushGameInfo.uc
    Code:
    class CNRushHUDGameInfo extends UTGame;
    
    function StartMatch(){
    	super(UTGame).StartMatch();
    }
    
    defaultproperties
    [
         Acronym="CN"
         
         PlayerControllerClass=class 'RushGFxUI.CNRushPlayerController'
         DefaultPawnClass = class 'RushGFxUI.CNRushPawn'
        
        bUseClassicHUD =True;
         HUDtype=class 'RushGFxUI.CNRushHUD'
    
         bdelayedstart=false'
         bresartlevel=false
         name="Default__CNRushHUDGameInfo"
        
    ]
    This is my CNRushHUD.uc
    Code:
    Class CNRushHUD extends UTHUD;
    
    var CNRushGFxHUD HudMovie;
    
    singular event Destroyed() {
     if (HudMovie != none) {
     HudMovie.Close(true);
     HudMovie = none;
     }
    }
    
    
    simulated function PostBeginPlay() {
     super.PostBeginPlay();
    
     HudMovie = new class'CNRushGFxHUD';
     HudMovie.SetTimingMode(TM_Real);
     HudMovie.Init();
    }
    
    event PostRender() {
     HudMovie.TickHUD();
    }
    
    DefaultProperties
    {
    }
    This is my CNRushGFxHUD.uc
    Code:
    Class CNRushGFxHUD Extends GFxMoviePlayer;
    
    var float LastHealthpc;
    
    var GFxObject HealthMC, HealthBarMC;
    var GFxObject HealthTF;
    
    function int roundNum(float NumIn) {
     local int iNum;
     local float fNum;
    
     fNum = NumIn;
     iNum = int(fNum);
     fNum -= iNum;
     if (fNum >= 0.5f) {
     return (iNum + 1);
     }
     else {
     return iNum;
     }
    }
    
    function int getpercentage(int val, int max) {
     return roundNum((float(val) / float(max)) * 100.0f);
    }
    
    function Init(optional LocalPlayer LocPlay) {
      Start();
     Advance(0.f);
    
      LastHealthpc = -1337;
    
      HealthMC = GetVariableObject("_root.healthbar_mc");
     HealthBarMC = GetVariableObject("_root.healthbar_mc.bar_mc");
     HealthTF = GetVariableObject("_root.healthbar_mc.health_txt");
    }
    
    function TickHUD() {
     local UTPawn UTP;
    
         UTP = UTPawn(GetPC().pawn);
     if (UTP == None) {
     return;
     }
    
     if (LastHealthpc != getpercentage(UTP.Health, UTP.HealthMax)) {
      LastHealthpc = getpercentage(UTP.Health, UTP.HealthMax);
      HealthBarMC.SetFloat("_xscale", (LastHealthpc > 100) ? 100.0f : LastHealthpc);
     HealthTF.SetString("text", round(LastHealthpc)$"%");
     }
    }
    
    DefaultProperties
    {
     
     bDisplayWithHudOff=False
     MovieInfo=SwfMovie'CNRushHUD.HUD.GfxHud'
     bEnableGammaCorrection = false
    }

    It almost seems as if the script doesnt fire at all. I changed the UDKGame\Config\DefaultEngine,Defaultgames to fire my Gameinfo. I can see the ppaawn cls in actors in the editor, the gametype for the level is changed to RushGFXUI for PIE and it shows up there in the world properties. Im stumped.
    Try to extend from UTHudBase instead of UTHud, just an idea as everything looks pretty identical to my code.

    I also use bUseClassicHUD=true; in defaultproperties of gameinfo file

    Comment


      #3
      Along with what Charleon said about extending UTHudBase, you might want to ensure this stuff is true:

      Code:
      Add to [UnrealEd.EditorEngine] in DefaultEngine.ini: +ModEditPackages=YourGameDirectoryName
      Add to [Engine.GameInfo] in DefaultGame.ini:
          DefaultGame=YourGameDirectoryName.CNRushHUDGameInfo
          DefaultServerGame=YourGameDirectoryName.CNRushHUDGameInfo
          PlayerControllerClassName=YourGameDirectoryName.YourPlayerController
          +DefaultMapPrefixes=(Prefix="XX",bUsesCommonPackage=FALSE,GameType="YourGameDirectoryName.CNRushHUDGameInfo")
      Replace XX with whatever prefix you want to use. And be sure to save your map with that prefix like so: XX-MyMap.uc

      Comment


        #4
        I tried

        Thanks Matt and Carleon for all your help I changed it to UTHUDBase in my CNRushHUD.uc. no changed

        this is my defualtgame.ini
        [Engine.GameInfo]
        DefaultGame=RushGFxUI.CNRushHUDGameInfo
        DefaultServerGame=RushGFxUI.CNRushHUDGameInfo
        PlayerControllerClassName=RushGFxUI.CNRushPlayerCo ntroller
        GameDifficulty=+1.0
        MaxPlayers=32
        DefaultGameType="RushGFxUI.CNRushHUDGameInfo";
        +DefaultMapPrefixes=(Prefix="DM",bUsesCommonPackag e=FALSE,GameType="UTGame.UTDeathmatch")
        +DefaultMapPrefixes=(Prefix="CTF",bUsesCommonPacka ge=FALSE,GameType="UTGameContent.UTCTFGame_Content ")
        +DefaultMapPrefixes=(Prefix="VCTF",bUsesCommonPack age=FALSE,GameType="UTGameContent.UTVehicleCTFGame _Content")
        +DefaultMapPrefixes=(Prefix="CN",bUsescommonpackag e=FALSE,Gametype="RushGFxUI.CNRushHUDGameInfo")
        [/CODE]and my defualtengine.ini
        Code:
        [UnrealEd.EditorEngine]
        +EditPackages=UTGame
        +EditPackages=UTGameContent
        +EditPackages=RushGFxUI
        i had also addeded
        Code:
        [URL]
        MapExt=udk
        Map=CN-Prologue.udk
        LocalMap=CN-Prologue.udk
        TransitionMap=EnvyEntry.udk
        EXEName=UTGame.exe
        DebugEXEName=DEBUG-UTGame.exe
        so my map would automatically open when i ran udkgame instead could this be causing a problem?
        i started it with -log
        it says
        "scriptwarning:accessing non 'mapinfo'
        gfxminimap transient.gfxminimaphud_1:gfxminimap_1
        function utgame.gfxminimap:init00f2
        error can't start an online game that hasn't been created
        scriptlog:Start Match
        Gfxminimap transient.GFxMinimapHud_1:GFxMinimap_1
        Function UTGame.GFxMinimap:Updatedata0015"

        Comment


          #5
          Does your HUD make use of the minimap? I don't see it. Yet UDK is complaining about it being missing. Is something in your code calling on the minimap somewhere?

          Comment


            #6
            not to my knowledge unless i somehow found a way to include it.

            Comment


              #7
              Originally posted by Matt Doyle View Post
              Does your HUD make use of the minimap? I don't see it. Yet UDK is complaining about it being missing. Is something in your code calling on the minimap somewhere?
              If not, might it be right to assume that his system could still use the UDKHUD?

              The best tip I could give at this point is to go over everything from the start and see if you've missed some step, the only thing I could see other than that is: Are you sure that HUDtype=class 'RushGFxUI.CNRushHUD' is the correct path, I've had silly problems with these kind of things before because of the case sensitivity and stuff

              Also try the following: make a shortcut to your UDK Game (not editor), then in the target, do this:
              "..\..\Binaries\Win32\UDK.exe" MapName?game=RushGFxUI.CNRushHUDGameInfo -vadebug -nomoviestartup -windowed -resx=1024 -resy=768

              do substitute MapName with the name of the map you want to play. start the shortcut and see if you get results. The reason is that sometimes the editor itself doesn't really take note of all the settings you've changed, and by firing up the game separately you might get the desired results

              Comment

              Working...
              X