diff options
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/mp')
4 files changed, 76 insertions, 38 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut index 83d889dd..0eef7f00 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut @@ -302,7 +302,7 @@ void function GameStateEnter_WinnerDetermined_Threaded() SetServerVar( "roundWinningKillReplayEntHealthFrac", file.roundWinningKillReplayHealthFrac ) foreach ( entity player in GetPlayerArray() ) - thread PlayerWatchesRoundWinningKillReplay( player, doReplay, replayLength ) + thread PlayerWatchesRoundWinningKillReplay( player, replayLength ) wait ROUND_WINNING_KILL_REPLAY_SCREEN_FADE_TIME CleanUpEntitiesForRoundEnd() // fade should be done by this point, so cleanup stuff now when people won't see @@ -323,7 +323,7 @@ void function GameStateEnter_WinnerDetermined_Threaded() ScreenFadeToBlackForever( player, 4.0 ) } - wait 6.5 + wait ROUND_WINNING_KILL_REPLAY_LENGTH_OF_REPLAY CleanUpEntitiesForRoundEnd() // fade should be done by this point, so cleanup stuff now when people won't see foreach( entity player in GetPlayerArray() ) @@ -360,45 +360,39 @@ void function GameStateEnter_WinnerDetermined_Threaded() } } -void function PlayerWatchesRoundWinningKillReplay( entity player, bool doReplay, float replayLength ) +void function PlayerWatchesRoundWinningKillReplay( entity player, float replayLength ) { + // end if player dcs + player.EndSignal( "OnDestroy" ) + player.FreezeControlsOnServer() - - if ( IsRoundBased() || !ClassicMP_ShouldRunEpilogue() ) // if we're doing evac, then no fades or killreplay + ScreenFadeToBlackForever( player, ROUND_WINNING_KILL_REPLAY_SCREEN_FADE_TIME ) + wait ROUND_WINNING_KILL_REPLAY_SCREEN_FADE_TIME + + player.SetPredictionEnabled( false ) // prediction fucks with replays + + entity attacker = file.roundWinningKillReplayAttacker + player.SetKillReplayDelay( Time() - replayLength, THIRD_PERSON_KILL_REPLAY_ALWAYS ) + player.SetKillReplayInflictorEHandle( attacker.GetEncodedEHandle() ) + player.SetKillReplayVictim( file.roundWinningKillReplayVictim ) + player.SetViewIndex( attacker.GetIndexForEntity() ) + player.SetIsReplayRoundWinning( true ) + + if ( replayLength >= ROUND_WINNING_KILL_REPLAY_LENGTH_OF_REPLAY - 0.5 ) // only do fade if close to full length replay { - ScreenFadeToBlackForever( player, ROUND_WINNING_KILL_REPLAY_SCREEN_FADE_TIME ) - wait ROUND_WINNING_KILL_REPLAY_SCREEN_FADE_TIME - - if ( doReplay ) - { - player.SetPredictionEnabled( false ) // prediction fucks with replays - - entity attacker = file.roundWinningKillReplayAttacker - player.SetKillReplayDelay( Time() - replayLength, THIRD_PERSON_KILL_REPLAY_ALWAYS ) - player.SetKillReplayInflictorEHandle( attacker.GetEncodedEHandle() ) - player.SetKillReplayVictim( file.roundWinningKillReplayVictim ) - player.SetViewIndex( attacker.GetIndexForEntity() ) - player.SetIsReplayRoundWinning( true ) - - if ( replayLength >= ROUND_WINNING_KILL_REPLAY_LENGTH_OF_REPLAY - 0.5 ) // only do fade if close to full length replay - { - // this doesn't work because fades don't work on players that are in a replay, unsure how official servers do this - wait replayLength - 2.0 - ScreenFadeToBlackForever( player, 2.0 ) + // this doesn't work because fades don't work on players that are in a replay, unsure how official servers do this + wait replayLength - 2.0 + ScreenFadeToBlackForever( player, 2.0 ) - wait 2.0 - } - else - wait replayLength - } - else - wait replayLength // this will just be extra delay if no replay - - player.SetPredictionEnabled( true ) - player.ClearReplayDelay() - player.ClearViewEntity() - player.UnfreezeControlsOnServer() + wait 2.0 } + else + wait replayLength + + player.SetPredictionEnabled( true ) + player.ClearReplayDelay() + player.ClearViewEntity() + player.UnfreezeControlsOnServer() } diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_crashsite3.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_crashsite3.nut index 37b89169..f169d0c7 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_crashsite3.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_crashsite3.nut @@ -1 +1,7 @@ -//fuck
\ No newline at end of file +untyped +global function CodeCallback_MapInit + +void function CodeCallback_MapInit() +{ + ClassicMP_SetLevelIntro( ClassicMP_DefaultNoIntro_Setup, ClassicMP_DefaultNoIntro_GetLength() ) +}
\ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut index b6c8cfc2..3a46eba8 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut @@ -1,7 +1,45 @@ untyped global function CodeCallback_MapInit +struct { + bool introStartTime +} file + void function CodeCallback_MapInit() { + AddEvacNode( GetEnt( "evac_location1" ) ) + AddEvacNode( GetEnt( "evac_location2" ) ) + AddEvacNode( GetEnt( "evac_location3" ) ) + AddEvacNode( GetEnt( "evac_location4" ) ) + + SetEvacSpaceNode( GetEnt( "end_spacenode" ) ) + + // currently disabled: intro + // if ( !IsFFAGame() ) + // ClassicMP_SetLevelIntro( WargamesIntroSetup, 25.0 ) +} + +// intro stuff +void function WargamesIntroSetup() +{ + AddCallback_OnClientConnected( WargamesIntro_OnClientConnected ) + AddCallback_OnClientDisconnected( WargamesIntro_OnClientDisconnected ) + + AddCallback_GameStateEnter( eGameState.Prematch, OnPrematchStart ) +} + +void function WargamesIntro_OnClientConnected( entity player ) +{ +} + +void function WargamesIntro_OnClientDisconnected( entity player ) +{ + +} + +void function OnPrematchStart() +{ + ClassicMP_OnIntroStarted() + file.introStartTime = Time() }
\ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/spawn.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/spawn.nut index 94138561..18026f17 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/spawn.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/spawn.nut @@ -144,7 +144,7 @@ entity function FindSpawnPoint( entity player, bool isTitan, bool useStartSpawnp else spawnpoints = isTitan ? SpawnPoints_GetTitan() : SpawnPoints_GetPilot() - InitRatings( player, team ) + InitRatings( player, player.GetTeam() ) // don't think this is necessary since we call discardratings //foreach ( entity spawnpoint in spawnpoints ) |