Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

(SOLVED)How can i unload one scaleform and load another by unrealscript?

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

    (SOLVED)How can i unload one scaleform and load another by unrealscript?

    Hi guys, what i'm trying to do is when the player win the game it'll unload the current Scaleform and draw another one.

    How can i do that?

    #2
    you need to have a class with your scaleform screen

    Code:
    class TrianglixInfoHelp extends GFxMoviePlayer;
    
    function bool Start(optional bool StartPaused = false)
    {
        super.Start();
        Advance(0);
    
        return TRUE;
    
    }
    
    function ReturnMainMenu()
    {
         close(true);
    }
    
    
    
    DefaultProperties
    {
            bEnableGammaCorrection=FALSE
    	bPauseGameWhileActive=TRUE
    	bCaptureInput=true
    	TimingMode=TM_Real
    	bAllowInput = true;
            bAllowFocus = true;
            bOnlyOwnerFocusable = true;
            bIgnoreMouseInput = false;
            SoundThemes(0)=(ThemeName=default,Theme=UISoundTheme'UDKFrontEnd.Sound.SoundTheme')
    }
    now when you want to load this scaleform screen, you need to use this code to load it up, for example from your main menu

    Code:
    class TrianglixMainMenu extends GFxMoviePlayer;
    
    var GFxMoviePlayer wShowInfoHelp;
    var SwfMovie wSwfInfoHelp;
    
    function bool Start(optional bool StartPaused = false)
    {
        super.Start();
        Advance(0);
        return TRUE;
    
    }
    
    
    function ShowInfo()
    {
         wShowInfoHelp = new class'TrianglixInfoHelp';
         wShowInfoHelp.MovieInfo=wSwfInfoHelp;
         wShowInfoHelp.Start();
    }
    
    
    DefaultProperties
    {
            bEnableGammaCorrection=FALSE
    	bPauseGameWhileActive=TRUE
    	bCaptureInput=true
    	TimingMode=TM_Real
    	bAllowInput = true;
            bAllowFocus = true;
            bOnlyOwnerFocusable = true;
            bIgnoreMouseInput = false;
            wSwfInfoHelp=SwfMovie'MyPackage2.InfoHelp.InfoHelp'
            SoundThemes(0)=(ThemeName=default,Theme=UISoundTheme'UDKFrontEnd.Sound.SoundTheme')
    }
    to close the actual scaleform screen you only need to call a function from actionscript to unrealscript to close the actual scaleform screen

    Code:
    function ReturnMainMenu()
    {
         close(true);
    }
    hope this help you ....

    Comment


      #3
      So for each swf file i need one uc file extending GFxMoviePlayer?
      that makes sense...i'll try it out, thank you!

      Comment


        #4
        PHP Code:
        var GFxMoviePlayer x;
        ...
        = new class'GFxMoviePlayer';
        x.MovieInfo SwfMovie'whatever';
        x.Start(); 
        you might even be able to replace the existing one, i've never tried.

        Comment


          #5
          Originally posted by Blade[UG] View Post
          PHP Code:
          var GFxMoviePlayer x;
          ...
          = new class'GFxMoviePlayer';
          x.MovieInfo SwfMovie'whatever';
          x.Start(); 
          you might even be able to replace the existing one, i've never tried.
          i have never tried replacing it, but i think it can be done, i will try it ....

          Comment


            #6
            Well thanks for answering

            I could close the current Scaleform, but couldn't draw the another one, what i need is when the player pass 3 laps, then, he'll pass the information to the HUDWRAPPER, close the current HUD and draw the other HUD, how can i pass this information from the GameType class to the HUDWRAPPER class?

            Comment


              #7
              i fixed it, and its working perfectly, i just declared a variable of my HUD class then used the event PostRender() declaring the value of the var, then i just put it:
              Code:
              if (WinningHUD != none)
              	{
              		WinningHUD.Init();
              	}
              then i set up the Function Init() on the hud, then i set up a local variable to compare the PlayerReplicationInfo with a local int, to see if the player completed the LAPS, then i set up an IF with this codes inside:

              Code:
              	if(RCRep.currentLap == NumLaps && RCRep.isPlayerFirst == Check)
              	{
              		super.Init (LocPlay);
              		start();
              		Advance(0.f);
              	}
              then everything worked

              Comment

              Working...
              X