Announcement

Collapse
No announcement yet.

Matinee sequence and a HUD interaction :(

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

    Matinee sequence and a HUD interaction :(

    I've just built a HUD interaction and I want to give the player control to make the HUD appear or dissapear. (BTW, this is because the Matinee sequence we're using dosen't remove the HUD when it activates....

    I know there's a variable for HUD which is bHideHud and I've tried doing a check to only draw the HUD if this variable is true, but it dosen't seem to respond. Any advice?

    #2
    I had a quick look at HUD and SceneManager and everything should work properly :
    - SceneManager::SceneStarted()
    [...]
    PlayerController(Viewer).MyHud.bHideHUD = bHideHUD;
    [...]

    and in HUD there is already check for bHideHUD
    - HUD::PostRender()

    [...]
    else if( !bHideHud )
    .
    .
    .
    DrawHud(Canvas);
    [...]

    I never had that problem, but there can be a hack for this. Simply switch myHUD in PlayerController to BlankHUD(where BlankHUD::PostRender() is totally empty), of course you need to store OLDHUD value if you want to return to previous HUD. This is very hacky way, but should do it's work.

    Comment


      #3
      But isn't the selection for the HUD made in the default properties of the gametype, not in the playercontroller class?

      Code:
      class CustomDM extends xDeathmatch;
      
      
      defaultproperties
      {
           DMHints(0)= "ALways remember that that no matter what you do, Graham will still be cooler than you."
      
           GameName="Custom Game"
           Description= "MY very own custom game"
      
           HUDType="rscHUD_v2.customHud"
      
           MapPrefix="RSC"
      
           PlayerControllerClassName="rscHUD_v2.myPlayer"
      
      }

      Comment


        #4
        HUDType is only a string with class name.
        MyHUD is place where HUD actor actually is.

        There shouldn't be problems with switching MyHUD:

        Code:
        var HUD OldHUD, BlankHUD;
        
        function clearHUD()
        {
        local PlayerControler Cont;
        Cont=....;
        
        OldHUD=Cont.myHUD;
        
        if (BlankHUD==none)
           BlankHUD=spawn(class'Package.BlankHUDClass',...);
        
        Cont.myHUD=BlankHUD; 
        //Now antyhing shouldn't be rendered
        }
        
        function restoreHUD()
        {
        Cont.myHUD=OldHUD;
        BlankHUD.destroy;
        //coming back to normal
        }
        This should help when you don't want to mess with customHUD, but if you have one, it will be even simplier.
        Add this to customHUD class:

        Code:
        var bool bDontDrawAnythingHere;
        
        function PostRender()
        {
        if (bDontDrawAnythingHere)
           return;  // now there's no way to draw anything :)
        
        super.postrender();
        }

        Comment


          #5
          I'm still testing it out, but I think I found an easier way ta deal with this.

          Use pOwner.myHUD.bHideHUD. pOwner is a subclass of xPlayer, the class I'm passing the interaction into. Basically, set a clause in the postrender of your interaction that will draw it oly if this is false.

          I've got pOwner.myHUD.bHideHUD to work with a keypress right now. I'm currently testing to see if I can get it to occur when a Matinee sequence is triggered.

          Code:
          function PostRender(Canvas C)
          {
          
          .
          .
          .
              if (pOwner.myHUD.bHideHUD != true)
              {
          
              	DrawHud();
              	DrawCursor();
              }
          .
          .
          .
          
          }
          This also seems to hide the stuff I'm drawing in the customHUD class as well, so that's awesome. I'll post if I have any problems. Thanks for the help Steel_Eagle! <------you

          Comment

          Working...
          X