// September 2015 // Levee Patroller / Dijk Patrouille // This source file is (c) by Deltares. This source file is open source but only available to select users. Do not redistribute without written permission of Stichting Deltares, Delft, The Netherlands. // This header has been automatically generated. //============================================================================= // GeoGameInfoTraining used for training level // Used RTGameInfo AND ExampleGameInfo (UDN) to start // ------------------------------------------------------------ // // © 2006, Geodelft // // Date Id Modification // 2006-10-09 The Created this header // 2006-10-09 The Added failure init //============================================================================= class GeoGameInfoTraining extends GameInfo; // // Called after a successful login. This is the first place // it is safe to call replicated functions on the PlayerPawn. // // Mostly copied from GameInfo's PostLogin function // event PostLogin( PlayerController NewPlayer ) { local class HudClass; local class ScoreboardClass; local String SongName; // Log player's login. if (GameStats!=None) { GameStats.ConnectEvent(NewPlayer.PlayerReplicationInfo); GameStats.GameEvent("NameChange",NewPlayer.PlayerReplicationInfo.playername,NewPlayer.PlayerReplicationInfo); } if ( !bDelayedStart && NewPlayer.Pawn == None ) // Changed by Demiurge (Runtime) { // start match, or let player enter, immediately bRestartLevel = false; // let player spawn once in levels that must be restarted after every death bKeepSamePlayerStart = true; if ( bWaitingToStartMatch ) StartMatch(); else RestartPlayer(newPlayer); bKeepSamePlayerStart = false; bRestartLevel = Default.bRestartLevel; } // Start player's music. SongName = Level.Song; if( SongName != "" && SongName != "None" ) NewPlayer.ClientSetMusic( SongName, MTRAN_Fade ); // tell client what hud and scoreboard to use if( HUDType != "" ) HudClass = class(DynamicLoadObject(HUDType, class'Class')); if( ScoreBoardType != "" ) ScoreboardClass = class(DynamicLoadObject(ScoreBoardType, class'Class')); NewPlayer.ClientSetHUD( HudClass, ScoreboardClass ); if ( NewPlayer.Pawn != None ) NewPlayer.Pawn.ClientSetRotation(NewPlayer.Pawn.Rotation); } //============================================================================= // Date Id Modification // 2006-10-09 the Created this header //============================================================================= event PostNetBeginPlay() //Should be PostBeginPlay or PostNetBeginPlay { Super.PostNetBeginPlay(); SetFailures(); } //============================================================================= // Date Id Modification // 2006-10-09 the Created this header //============================================================================= function bool SetFailures() { // local Failure TempFailure; local LeveeTile A; local GeoLevelDetails GLD; local int i; local name TempName; local bool bIsActive; local LeveeTile TempTileFailure; local LeveeTile T; local GeoEnums.FailingMechanisms mechanism; GLD = new class'GeoLevelDetails'; Log("[GeoGameInfoTraining] SetFailures (training)"); /// Reset level data now: GLD.ResetLevelDetails(); /// Training level: GLD.CurrentLevelScenarioNumber = 0; /// Find tiles to immediatly activate: ForEach AllActors( class 'LeveeTile', T) { /// Activate directly if necessary: if (T.ConfiguredFailure != FM_None) { if (T.ConfiguredFailureState == STA_Reportable) { Log(T @ "Preconfigued as STA_Reportable"); GLD.ArrayReportableActiveFailureNames.Insert(0,1); GLD.ArrayReportableActiveFailureNames[0].FailureName = T.Name; GLD.ArrayReportableActiveFailureNames[0].MechanismType = T.ConfiguredFailure; } if (T.ConfiguredFailureState == STA_Relevant) { Log(T @ "Preconfigued as STA_Relevant"); GLD.ArrayRelevantActiveFailureNames.Insert(0,1); GLD.ArrayRelevantActiveFailureNames[0].FailureName = T.Name; GLD.ArrayRelevantActiveFailureNames[0].MechanismType = T.ConfiguredFailure; } if (T.ConfiguredFailureState == STA_Critical) { Log(T @ "Preconfigued as STA_Critical"); GLD.ArrayCriticalActiveFailureNames.Insert(0,1); GLD.ArrayCriticalActiveFailureNames[0].FailureName = T.Name; GLD.ArrayCriticalActiveFailureNames[0].MechanismType = T.ConfiguredFailure; } } } ForEach AllActors( class 'LeveeTile', A, ) { /// Only if not preconfigured bIsActive=false; TempTileFailure=(A); TempName=TempTileFailure.Name; Log("SetFailures() FailureName"$TempTileFailure.Name); for(i=0; i