class KF_StoryCheckPointVolumeSE extends KF_StoryCheckPointVolume; var array ForeignPSList; var transient bool bPSListInit; simulated function PostBeginPlay() { local KF_DialogueSpot DlgSpot; if( Level.NetMode==NM_Client ) return; /* No KFO Gametype, no Initialization */ StoryGI = KFStoryGameInfo(Level.Game); if(StoryGI == none) { return; } if(RestartFromCheckPoint != "" && RestartFromCheckPoint != CheckPointName && StoryGI != none ) { ForcedRestartCheckPoint = StoryGI.FindCheckPointNamed(RestartFromCheckPoint); } // cache all the DialogueSpots in the map - we'll need this to store the states for each one foreach DynamicActors(class 'KF_DialogueSpot', DlgSpot) { SavedDialogue.length = SavedDialogue.length + 1; SavedDialogue[SavedDialogue.length-1].DialogueActor = DlgSpot; SavedDialogue[SavedDialogue.length-1].DialogueTriggerStates.length = DlgSpot.Dialogues.length ; } } // copy-pasted from KFStoryGameInfo to allow use in non-story games function int GetTotalActivePlayers() { local int LivingCount; local Controller C; for ( C=Level.ControllerList; C!=None; C=C.NextController ) { if ((C.PlayerReplicationInfo != None) && C.bIsPlayer && !C.PlayerReplicationInfo.bOutOfLives && !C.PlayerReplicationInfo.bOnlySpectator ) { LivingCount ++ ; } } // log("TOTAL PLAYERS : "@LivingCount); return LivingCount ; } // bIncludeBots now can be enabled without bRespawnPlayers function CheckPointActivated( Pawn CheckPointInstigator, bool bForceActivate, optional bool bShowMessage) { local KF_StoryCheckPointVolume OldCheckpoint; local Controller C; /* Check for a human controlled pawn */ if( CheckPointInstigator != none && CheckPointInstigator.Controller != none ) { ActivatingPlayer = CheckPointInstigator.Controller; if(ActivatingPlayer != none && PlayerController(ActivatingPlayer) != none && ActivatingPlayer.Pawn != none ) Instigator = ActivatingPlayer.Pawn ; } if( !bForceActivate && bRequiresWholeTeam && GetNumPlayersInVolume() < GetTotalActivePlayers()) return; if(!bIsActive || bForceActivate || !bSingleActivationOnly) { // log("===============================================",'Story_Debug'); // log("CheckPointActivated! - "@CheckPointName,'Story_Debug'); bIsActive = true; if(!bPendingFullRestart) { TriggerActivationEvents(); if(bRespawnOnWipe) SaveStoryState(); } if(StoryGI != none) { OldCheckPoint = StoryGI.CurrentCheckPoint ; StoryGI.CurrentCheckPoint = self ; for ( C=Level.ControllerList; C!=None; C=C.NextController ) { if(KFPlayerController_Story(C) != none) { KFPlayerController_Story(C).CurrentCheckPoint = self; } } if(bShowMessage) { BroadcastLocalizedMessage( StoryGI.default.CheckPointMessageClass , 0, ActivatingPlayer.PlayerReplicationinfo, None, self ); } } UpdateSpawnAvailability(); ResetPlayerCheckpointStats(); if( bRespawnPlayers || bIncludeBots ) { if ( RespawnDelay > 0 ) DelayedRespawnDeadPlayers(); else RespawnTimerPop(); } if( bTeleportstragglers) { TeleportLivingPlayers(); } // if(Instigator == none) // { // log("Warning - No human instigator found when Activating "@self@". Some actors require a human instigator to trigger successfully . (Movers) "); // } if(bDebugCheckPoint) { PrintDebugText(ActivatingPlayer.PlayerReplicationInfo.PlayerName@"activated"@CheckPointName); } } } function InitPlayerStarts() { local NavigationPoint N; local PlayerStart PS; for( N=Level.NavigationPointList; N!=None; N=N.NextNavigationPoint ) { PS = PlayerStart(N); if( PS!=None ) { if(Encompasses(PS) ) PSList[PSList.Length] = PS; else ForeignPSList[ForeignPSList.Length] = PS; } } bPSListInit = true; } function DebugPlayerStarts() { local NavigationPoint N; local PlayerStart PS; ClearStayingDebugLines(); for( N=Level.NavigationPointList; N!=None; N=N.NextNavigationPoint ) { PS = PlayerStart(N); if( PS!=None ) { if(PS.bEnabled) { DrawStayingDebugLine(N.Location, N.Location + (100 * vect(0,0,1)), 0,255,0); } else { DrawStayingDebugLine(N.Location, N.Location + (100 * vect(0,0,1)), 255,0,0); } } } } function UpdateSpawnAvailability() { local int i; if ( !bPSListInit ) InitPlayerStarts(); if( PSList.Length>0 ) { for ( i=0; i 0 && C.Pawn.PhysicsVolume != self && ((C.PlayerReplicationInfo.bBot && bIncludeBots) || (!C.PlayerReplicationInfo.bBot && bRespawnPlayers)) ) { if(TeleportExclusionVolume != none) bTeleportMe = !TeleportExclusionVolume.Encompasses(C.Pawn); else bTeleportMe = TeleportStragglerDist == 0 || VSize(C.Pawn.Location - Location) >= TeleportStragglerDist; if(bTeleportMe){ for ( i=0; i