// // CPT operator / SondeerGame // This source file is (c) by Deltares. // - October 2014 // //============================================================================= // GeoGameInfo // // Game start for normal gameplay // // ------------------------------------------------------------ // Created by Rui Guimaraes // © 2006, Geodelft // // Date Id Modification // 2006-03-20 gui Class created /// jln - 25-09-2008 New playerstart detection. //============================================================================= class GeoGameInfo extends GameInfo; #exec OBJ LOAD FILE=Environmentsounds.uax /// Used for hack: var name nTempName; //============================================================================= // Description: Mostly copied from GameInfo's PostLogin function // Called after a successful login. This is the first place // it is safe to call replicated functions on the PlayerPawn. // // Date Id Modification // 2006-03-20 gui Created //============================================================================= event PostLogin( PlayerController NewPlayer ) { local class HudClass; local class ScoreboardClass; local String SongName; local GeoLevelDetails GLD; //local DScriptedTrigger sT; local GeoPlayerController geoPC; log("=========== PostLogin in GeoGameInfo ========================"); geoPC = GeoPlayerController(NewPlayer); // 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); /// Check if the debug info tips have been enabled: /* if (bool(Localize ("DebugInfo", "ShowTips", "GeoSimulator")) == true) { Log("Creating interaction"); NewPlayer.Player.InteractionMaster.AddInteraction("GeoWorld.DebugInfoTips", NewPlayer.Player); } */ } GLD = new class'GeoLevelDetails'; if(GLD.IsRaining) { //sT = Spawn(class'DScriptedTrigger'); //sT.Actions.insert(0, 4); //sT.Actions[0] = new class'ACTION_WaitForTimer'; //ACTION_WaitForTimer(sT.Actions[0]).PauseTime = 1.00 ; //sT.Actions[1] = new class'ACTION_PlayLocalSound'; //ACTION_PlayLocalSound(sT.Actions[1]).Sound = Sound'EnvironmentSounds.Water.regen3'; //sT.Actions[2] = new class'ACTION_WaitForTimer'; //ACTION_WaitForTimer(sT.Actions[2]).PauseTime = 49.00 ; //sT.Actions[3] = new class'ACTION_GotoAction'; //ACTION_GotoAction(sT.Actions[3]).ActionNumber = 0 ; } } /// Kind of a hack to be able to create dynamic names for the various triggers. function name GetName(string NameString) { SetPropertyText("nTempName", NameString); return nTempName; } /// We use the "start tag" from the SondeerGame.int file to find an appropriate starting point. function NavigationPoint FindPlayerStart( Controller Player, optional byte InTeam, optional string incomingName ) { local PlayerStart N, BestStart; local name StartTag; StartTag = GetName(Localize("Game", "starttag", "sondeergame")); Log("Configured playerstart tag is: " @ StartTag); if (Len(StartTag) > 0) { foreach AllActors( class 'PlayerStart', N, StartTag ) { BestStart = N; break; } } else { /// Return first one: foreach AllActors( class 'PlayerStart', N ) { BestStart = N; break; } } /// Not found anything? Pick the first one we can find: Last try. if (BestStart == None) { foreach AllActors( class 'PlayerStart', N ) { BestStart = N; break; } } Log("Found PlayerStart: " @ BestStart @ " - " @ BestStart.Tag); return BestStart; } //============================================================================= // Description: PostNetBeginPlay; Should it be PostBeginPlay or PostNetBeginPlay? // // Date Id Modification // 2006-03-20 gui Created //============================================================================= event PostNetBeginPlay() { Super.PostNetBeginPlay(); SetWeather(); } //============================================================================= // Description: Start weather actors according to tags // // Date Id Modification // 2006-04-20 gui Created //============================================================================= function bool SetWeather() { local class NewClass; local GeoLevelDetails GLD; local int RainType; local Actor A; GLD = new class'GeoLevelDetails'; if(GLD.IsRaining) { RainType=Rand(2); switch(RainType) { case 0: NewClass = class( DynamicLoadObject( "GeoWorld.LightRainEmitter", class'Class' ) ); break; case 1: NewClass = class( DynamicLoadObject( "GeoWorld.HeavyRainEmitter", class'Class' ) ); break; } Spawn(NewClass); } foreach AllActors( class 'Actor', A, 'RainyActor') { A.bHidden=!(GLD.IsRaining); } foreach AllActors( class 'Actor', A, 'RainySpecial') { A.bHidden=!(GLD.IsRaining); } return true; } //============================================================================= // Description: // // Date Id Modification // 2006-04-13 gui Created //============================================================================= defaultproperties { bDelayedStart=false PlayerControllerClassName="GeoSimulator.GeoPlayerController" PlayerControllerClass=None HUDType="GeoSimulator.GeoHUD" //ScoreBoardType="GeoSimulator.GeoScoreboard" DefaultPlayerName="SondeerMeester" GameName="SondeerGame" }