From b3f0e4598c5c573b0e79a8a9307966d2c07f5e4a Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Fri, 10 Dec 2021 00:04:27 +0000 Subject: potentially fix bug with roundwinningkillreplays --- .../mod/cfg/autoexec_ns_server.cfg | 2 + .../vscripts/gamemodes/_gamemode_coliseum.nut | 17 ++++--- .../mod/scripts/vscripts/mp/_base_gametype_mp.gnut | 52 +++++----------------- .../mod/scripts/vscripts/mp/_gamestate_mp.nut | 2 +- 4 files changed, 23 insertions(+), 50 deletions(-) (limited to 'Northstar.CustomServers/mod') diff --git a/Northstar.CustomServers/mod/cfg/autoexec_ns_server.cfg b/Northstar.CustomServers/mod/cfg/autoexec_ns_server.cfg index 0e55312da..dbf4e388d 100644 --- a/Northstar.CustomServers/mod/cfg/autoexec_ns_server.cfg +++ b/Northstar.CustomServers/mod/cfg/autoexec_ns_server.cfg @@ -7,3 +7,5 @@ ns_report_sp_server_to_masterserver 0 // whether this server should report itsel ns_auth_allow_insecure 0 // keep this to 0 unless you want to allow people to join without masterserver auth/persistence ns_erase_auth_info 1 // keep this to 1 unless you're testing and crashing alot, so you don't have to go through the northstar lobby to reauth ns_player_auth_port 8081 // this can be whatever, make sure it's portforwarded over tcp + +everything_unlocked 1 // unlock everything \ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_coliseum.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_coliseum.nut index 2f20d8767..e0664b1ef 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_coliseum.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_coliseum.nut @@ -5,14 +5,17 @@ global function GamemodeColiseum_CustomIntro // outro anims // winner anims are for the winner, loser anims are for the loser -// the loss number refers to the number of rounds the winner lost -const array OUTROANIMS_WINNER_0LOSS = [ "pt_coliseum_winner_gunkick", "pt_coliseum_winner_compassion", "pt_coliseum_winner_drinking" ] -const array OUTROANIMS_WINNER_1LOSS = [ "pt_coliseum_winner_respect", "pt_coliseum_winner_headlock", "pt_coliseum_winner_authority" ] -const array OUTROANIMS_WINNER_2LOSS = [ "pt_coliseum_winner_punch", "pt_coliseum_winner_kick", "pt_coliseum_winner_stomp" ] +const array< array > OUTROANIMS_WINNER = [ + [ "pt_coliseum_winner_gunkick", "pt_coliseum_winner_compassion", "pt_coliseum_winner_drinking" ], // winner lost 0 rounds + [ "pt_coliseum_winner_respect", "pt_coliseum_winner_headlock", "pt_coliseum_winner_authority" ], // winner lost 1 round + [ "pt_coliseum_winner_punch", "pt_coliseum_winner_kick", "pt_coliseum_winner_stomp" ] // winner lost 2 rounds +] -const array OUTROANIMS_LOSER_0LOSS = [ "pt_coliseum_loser_gunkick", "pt_coliseum_loser_compassion", "pt_coliseum_loser_drinking" ] -const array OUTROANIMS_LOSER_1LOSS = [ "pt_coliseum_loser_respect", "pt_coliseum_loser_headlock", "pt_coliseum_loser_authority" ] -const array OUTROANIMS_LOSER_2LOSS = [ "pt_coliseum_loser_punch", "pt_coliseum_loser_kick", "pt_coliseum_loser_stomp" ] +const array< array > OUTROANIMS_LOSER = [ + [ "pt_coliseum_loser_gunkick", "pt_coliseum_loser_compassion", "pt_coliseum_loser_drinking" ], // winner lost 0 rounds + [ "pt_coliseum_loser_respect", "pt_coliseum_loser_headlock", "pt_coliseum_loser_authority" ], // winner lost 1 round + [ "pt_coliseum_loser_punch", "pt_coliseum_loser_kick", "pt_coliseum_loser_stomp" ], // winner lost 2 rounds +] struct { bool hasShownIntroScreen diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut index fcad7d31f..6673d1743 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut @@ -218,6 +218,7 @@ void function CodeCallback_OnPlayerRespawned( entity player ) Remote_CallFunction_NonReplay( player, "ServerCallback_YouRespawned" ) player.s.respawnTime = Time() + player.SetPredictionEnabled( true ) Loadouts_TryGivePilotLoadout( player ) SetHumanRagdollImpactTable( player ) @@ -270,7 +271,6 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga if ( !IsValid( player ) ) return - player.SetPredictionEnabled( true ) player.s.inPostDeath = false }) @@ -294,26 +294,6 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga if ( shouldDoReplay ) thread TrackDestroyTimeForReplay( attacker, replayTracker ) - int damageSource = DamageInfo_GetDamageSourceIdentifier( damageInfo ) - //if ( damageSource == eDamageSourceId.fall ) - //{ - // // this is straight up just incorrect lol, based off tf1 stuff - // - // player.SetObserverModeStaticPosition( player.GetOrigin() ) - // player.SetObserverModeStaticAngles( player.GetVelocity() * -1 ) - // - // player.StartObserverMode( OBS_MODE_STATIC_LOCKED ) - // player.SetObserverTarget( null ) - //} - //else - //{ - player.StartObserverMode( OBS_MODE_DEATHCAM ) - if ( ShouldSetObserverTarget( attacker ) ) - player.SetObserverTarget( attacker ) - else - player.SetObserverTarget( null ) - //} - if ( !file.playerDeathsHidden ) Remote_CallFunction_NonReplay( player, "ServerCallback_YouDied", attacker.GetEncodedEHandle(), GetHealthFrac( attacker ), methodOfDeath ) @@ -330,10 +310,8 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga } // quick note: in cases where player.Die() is called: e.g. for round ends, player == attacker - if ( shouldDoReplay ) - { - player.SetPredictionEnabled( false ) - + if ( shouldDoReplay && KillcamsEnabled() ) // hack: double check if killcams are enabled here in case gamestate has changed this + { player.watchingKillreplayEndTime = Time() + replayLength float beforeTime = GetKillReplayBeforeTime( player, methodOfDeath ) @@ -362,7 +340,6 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga player.WaitSignal( "RespawnMe" ) // set in base_gametype: ClientCommand_RespawnPlayer - player.SetPredictionEnabled( true ) ClearRespawnAvailable( player ) // need so the respawn icon doesn't show for like a frame on next death if ( ( expect bool( player.GetPersistentVar( "spawnAsTitan" ) ) && IsTitanAvailable( player ) ) || ( Riff_SpawnAsTitan() > 0 && Riff_ShouldSpawnAsTitan( player ) ) ) // spawn as titan @@ -377,29 +354,20 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga } void function PlayerWatchesKillReplayWrapper( entity player, entity attacker, float timeSinceAttackerSpawned, float timeOfDeath, float beforeTime, table replayTracker ) -{ - PlayerWatchesKillReplay( player, attacker.GetEncodedEHandle(), attacker.GetIndexForEntity(), timeSinceAttackerSpawned, timeOfDeath, beforeTime, replayTracker ) - player.ClearReplayDelay() - player.ClearViewEntity() - player.SetPredictionEnabled( true ) -} - -void function EndReplayOnTime( entity player, float replayLength ) { player.EndSignal( "RespawnMe" ) player.EndSignal( "OnRespawned" ) + player.EndSignal( "GameStateChanged" ) - wait replayLength - if ( IsValid( player ) && KillcamsEnabled() ) - { - print( "fucking how" ) - + OnThreadEnd( function() : ( player ) + { player.ClearReplayDelay() player.ClearViewEntity() player.SetPredictionEnabled( true ) - - player.SetObserverTarget( null ) - } + }) + + player.SetPredictionEnabled( false ) + PlayerWatchesKillReplay( player, attacker.GetEncodedEHandle(), attacker.GetIndexForEntity(), timeSinceAttackerSpawned, timeOfDeath, beforeTime, replayTracker ) } void function DecideRespawnPlayer( entity player ) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut index e3b252f78..46872692a 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut @@ -39,7 +39,7 @@ struct { bool roundWinningKillReplayTrackPilotKills = true bool roundWinningKillReplayTrackTitanKills = false - + float roundWinningKillReplayTime entity roundWinningKillReplayVictim entity roundWinningKillReplayAttacker -- cgit v1.2.3