Download

Help with Custom Loading Screens

Hello guys,

I am having a hard time to make individual loading screens for each map. I removed bink video to use Canvas to draw a background image to cover the screen, like Mission Briefing.

I created my code based on UTGameViewport, I already removed bink video files, however Canvas Background Image is not working.

Any helps?


class AnaIrhabiViewportClient extends UTGameViewportClient;

//variables to store individual map loading screens
var Texture2D Background;

var Texture2D MAP1_BackgroundTexture;
var Texture2D MAP2_BackgroundTexture;
var Texture2D MAP3_BackgroundTexture;
var Texture2D MAP4_BackgroundTexture;
var Texture2D MAP5_BackgroundTexture;
var Texture2D MAP6_BackgroundTexture;
var Texture2D MAP7_BackgroundTexture;
var Texture2D MAP8_BackgroundTexture;
var Texture2D MAP9_BackgroundTexture;
var Texture2D MAP10_BackgroundTexture;

//function DrawTransition//////////////////////////////////////////////////
function DrawTransition(Canvas Canvas)
{
    local string MapName;
    local int Pos;

    switch(Outer.TransitionType)
    {
        case TT_Loading:

            MapName = Outer.TransitionDescription;

            /* Remove .udk from map */
            Pos = InStr(MapName,".");
            if (Pos != -1)
            {
                MapName = left(MapName, Pos);
            }

            /* Get Random Texture */
            Background = GetTextureForMap(MapName);
            break;

        case TT_Saving:
            break;

        case TT_Connecting:
            break;

        case TT_Precaching:
            break;

        case TT_Paused:
            break;
    }
}
//function DrawTransition//////////////////////////////////////////////////

//function GetTextureForMap//////////////////////////////////////////////////
function Texture2D GetTextureForMap(string MapName)
{
    switch(MapName)
    {

        case "AI-DesertIntroFinal":
            return MAP1_BackgroundTexture;
        break;

        //case "Map2":
            //return MAP2_BackgroundTextures[Rand(MAP2_BackgroundTextures.length)];
        //break;

        //case "Map3":
            //return MAP3_BackgroundTextures[Rand(MAP3_BackgroundTextures.length)];
        //break;

        default:
            //return //any default texture here;
        break;
    }
}
//function GetTextureForMap//////////////////////////////////////////////////

DefaultProperties

{

  MAP1_BackgroundTexture=Texture2D'UI_FrontEnd_Art.MapPics.mission_briefing_1'
//MAP2_BackgroundTextures[0]=Texture2D'UI_FrontEnd_Art.MapPics.mission_briefing_2'
//MAP3_BackgroundTextures[0]=Texture2D'UI_FrontEnd_Art.MapPics.mission_briefing_3'
//MAP4_BackgroundTextures[0]=Texture2D'UI_FrontEnd_Art.MapPics.mission_briefing_4'
//MAP5_BackgroundTextures[0]=Texture2D'UI_FrontEnd_Art.MapPics.mission_briefing_5'
//MAP6_BackgroundTextures[0]=Texture2D'UI_FrontEnd_Art.MapPics.mission_briefing_6'
//MAP7_BackgroundTextures[0]=Texture2D'UI_FrontEnd_Art.MapPics.mission_briefing_7'
//MAP8_BackgroundTextures[0]=Texture2D'UI_FrontEnd_Art.MapPics.mission_briefing_8'
//MAP9_BackgroundTextures[0]=Texture2D'UI_FrontEnd_Art.MapPics.mission_briefing_9'
//MAP10_BackgroundTextures[0]=Texture2D'UI_FrontEnd_Art.MapPics.mission_briefing_10'

}


I don’t see you drawing anything with canvas in your function. you get the random background… and then do nothing :rolleyes:

Oh yeah man, what a stupid :smiley: mistake!

Thanks for the attention!

Here is, I added the canvas draw texture here, however it does not show any loading screen at all, it just freezes on the last frame of the udk frontend then goes to the game itself:


    switch(Outer.TransitionType)
    {
        case TT_Loading:

            MapName = Outer.TransitionDescription;

            /* Remove .udk from map */
            Pos = InStr(MapName,".");
            if (Pos != -1)
            {
                MapName = left(MapName, Pos);
            }

            /* Draw Background Texture */
            Background = GetTextureForMap(MapName);
            Canvas.SetPos(0, 0);
            Canvas.SetDrawColor(255, 255, 255, 1);
            Canvas.DrawTexture(Background, 1280);
            break;

Other option would be able to have different bink videos for loading each map, however I don’t know how to do it.

I’m pretty sure flash (udkfrontend) will always get drawn on top of everything else, it has to be hidden or turned off manually to let anything else show.

@ciox Thanks man for the idea!!!

After thinkering about this, I was not able to do what I wanted initially, however, I found another alternative, thinking outside the box. I know UDK allows to have random loading screens (bink videos) for loading any maps, this is the default behaviour.

So I thought on an easier way of doing what I want, with some extra stuff. I decided to create many loading screen (bink videos) with some tips for my game, like teaching the player how to perform knife kills, giving some tips like shoot your enemy on the head so he will die imediately, shoot on their limbs so you can imobilize them by some seconds, and so on.

The mission briefing I will make them in flash (scaleform), with some cool animation, and simply call it via kismet once the level loads. And all the game logic with I already scripted for my first map, will be triggered after play the flash animation (mission briefing menu), or after the player presses or click on a button (like click here to begin the mission).

In the end, this approach will be much easier for me, and will allow me to do some better stuff.

Thanks!!!

Also another way woud be to have only one main loading bink video.A black color video with a tiny animated circle in the bottom left.

When the level starts, draw a canvas or a texture or even a bink video on a poly plane in front of the camera with the same loading circle and that way you will have different loading screen for each level.Add a fade out to the camera in matinee so that the black bink loading video gradually shows the new fake loading screen.

True, its fake,BUT other games do it too.They leave the fake loading screen for 5-10 or more seconds and that gives time/helps load the level and textures in the background.

Thanks man for this awesome idea!!!

No problem.The more routes for one thing, the better.