Fixing The Loading Movie For Multiplayer Clients   Leave a comment

Video Version

Subject: Fixing The Loading Movie For Multiplayer Clients
Skill Level: Beginner
Run-Time: 21 minutes
Author: Michael Allar
Notes: When you host a mutliplayer game with the current code, clients will join but they will get stuck at a loading screen endlessly. This fixes that. Also introduces GameReplicationInfo.

Streaming:     720×480 1920×1080

Download:     Low-Res (70MB) Hi-Res (95MB)

Written Version

Subject: HTWeapon: Part 3 – Creating a Dynamic Muzzle Flash Light
Skill Level: Beginner
Author: Michael Allar
Notes: When you host a mutliplayer game with the current code, clients will join but they will get stuck at a loading screen endlessly. This fixes that. Also introduces GameReplicationInfo.

HTPlayerController

/*******************************************************************************
 HTPlayerController

 Creation date: 14/01/2010 14:31
 Copyright (c) 2010, Michael Allar

*******************************************************************************/

class HTPlayerController extends UDKPlayerController
 config(UDKGame);

event InitInputSystem()
{
 Super.InitInputSystem();

 if (WorldInfo.NetMode != NM_DedicatedServer)
 {
 CharacterProcessingComplete();
 }
}

/** called when the GRI finishes processing custom character meshes */
function CharacterProcessingComplete()
{
 local string LastMovie;

 LastMovie = class'Engine'.Static.GetLastMovieName();

 if(InStr(LastMovie, "UT_loadmovie") != -1)
 {
 // stop the loading movie that was up during precaching
 class'Engine'.static.StopMovie(true);
 }
}

defaultproperties
{
}

HTGameReplicationInfo

/*******************************************************************************
 HTGameReplicationInfo

 Creation date: 26/03/2010 00:22
 Copyright (c) 2010, Allar

*******************************************************************************/

class HTGameReplicationInfo extends GameReplicationInfo;

simulated function PostBeginPlay()
{
 Super.PostBeginPlay();

 if (WorldInfo.NetMode != NM_DedicatedServer)
 {
 SetTimer(1.0, false, 'CharacterProcessingComplete');
 }
}

//Signal that all player controllers character processing is complete
simulated function CharacterProcessingComplete()
{
 local HTPlayerController HTPC;

 foreach LocalPlayerControllers(class'HTPlayerController', HTPC)
 {
 HTPC.CharacterProcessingComplete();
 }
}

UDKGame/TheHuntGame

defaultproperties

{

//Some stuff

GameReplicationInfoClass=class'UDKGame.HTGameReplicationInfo'

//More stuff

}

Download Project Source Code Here

Posted March 26, 2010 by Allar in Unreal

Tagged with , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>