diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-22 16:46:49 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-22 16:46:49 +0000 |
commit | fb32cb1b780c1169a834c951bc0c928199a2b59e (patch) | |
tree | e2435cc869fed0fa3f7c3d187335d2350b8b1e14 /Northstar.CustomServers/mod/scripts/vscripts/mp | |
parent | dade102a0d4d14ba5ee560022b8e2f1ddf960977 (diff) | |
download | NorthstarMods-fb32cb1b780c1169a834c951bc0c928199a2b59e.tar.gz NorthstarMods-fb32cb1b780c1169a834c951bc0c928199a2b59e.zip |
playtest fixes
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/mp')
6 files changed, 51 insertions, 27 deletions
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 9c4949b6..6945fb96 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut @@ -38,8 +38,8 @@ void function BaseGametype_Init_MPSP() AddClientCommandCallback( "spec_prev", ClientCommandCallback_spec_prev ) AddClientCommandCallback( "spec_mode", ClientCommandCallback_spec_mode ) - AddDamageCallback( "player", AddToTitanDamageStat ) - AddDamageCallback( "npc_titan", AddToTitanDamageStat ) + AddPostDamageCallback( "player", AddToTitanDamageStat ) + AddPostDamageCallback( "npc_titan", AddToTitanDamageStat ) RegisterSignal( "PlayerRespawnStarted" ) } @@ -354,10 +354,8 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga else // spawn as pilot RespawnAsPilot( player ) } - else - { + else if ( GamePlayingOrSuddenDeath() || GetGameState() == eGameState.Epilogue ) thread PlayerBecomesSpectator( player ) - } } void function PlayerWatchesKillReplayWrapper( entity player, entity attacker, float timeSinceAttackerSpawned, float timeOfDeath, float beforeTime, table replayTracker ) @@ -372,7 +370,8 @@ void function PlayerWatchesKillReplayWrapper( entity player, entity attacker, fl OnThreadEnd( function() : ( player ) { - if ( IsValid( player ) ) + // don't clear if we're in a roundwinningkillreplay + if ( IsValid( player ) && !( ( GetGameState() == eGameState.SwitchingSides || GetGameState() == eGameState.WinnerDetermined ) && IsRoundWinningKillReplayEnabled() ) ) { player.ClearReplayDelay() player.ClearViewEntity() @@ -389,9 +388,9 @@ void function DecideRespawnPlayer( entity player ) // this isn't even used atm, could likely be removed if some vanilla code didn't rely on it } -void function RespawnAsPilot( entity player, bool manualPosition = false ) +void function RespawnAsPilot( entity player ) { - player.RespawnPlayer( FindSpawnPoint( player, false, ShouldStartSpawn( player ) && !IsFFAGame() ) ) + player.RespawnPlayer( FindSpawnPoint( player, false, ( ShouldStartSpawn( player ) || Flag( "ForceStartSpawn" ) ) && !IsFFAGame() ) ) } void function RespawnAsTitan( entity player, bool manualPosition = false ) @@ -399,7 +398,7 @@ void function RespawnAsTitan( entity player, bool manualPosition = false ) player.Signal( "PlayerRespawnStarted" ) player.isSpawning = true - entity spawnpoint = FindSpawnPoint( player, true, ShouldStartSpawn( player ) && !IsFFAGame() ) + entity spawnpoint = FindSpawnPoint( player, true, ( ShouldStartSpawn( player ) || Flag( "ForceStartSpawn" ) ) && !IsFFAGame() ) TitanLoadoutDef titanLoadout = GetTitanLoadoutForPlayer( player ) @@ -501,15 +500,23 @@ void function PlayerBecomesSpectator( entity player ) targetIndex-- } + if ( targetIndex >= targets.len() ) + targetIndex = 0 + entity target = targets[ targetIndex ] player.StopObserverMode() - player.SetSpecReplayDelay( 0.0 ) // clear spectator replay + if ( player.IsWatchingSpecReplay() ) + player.SetSpecReplayDelay( 0.0 ) // clear spectator replay if ( target.IsPlayer() ) { - player.SetObserverTarget( target ) - player.StartObserverMode( OBS_MODE_CHASE ) + try + { + player.SetObserverTarget( target ) + player.StartObserverMode( OBS_MODE_CHASE ) + } + catch ( ex ) {} } else { diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_classic_mp_dropship_intro.gnut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_classic_mp_dropship_intro.gnut index 69f67584..1e6d8271 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_classic_mp_dropship_intro.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_classic_mp_dropship_intro.gnut @@ -150,10 +150,11 @@ void function SpawnPlayerIntoDropship( entity player ) playerDropship = dropship playerDropshipIndex = i + dropship.players[ i ] = player break } - if ( true )//if ( playerDropship.dropship == null ) + if ( playerDropship.dropship == null ) { // if we're at this point, we have more players than we do dropships, so just pick a random one playerDropship = teamDropships.getrandom() @@ -189,10 +190,11 @@ void function SpawnPlayerIntoDropship( entity player ) jumpSequence.firstPersonAnim = DROPSHIP_JUMP_ANIMS_POV[ playerDropshipIndex ] jumpSequence.thirdPersonAnim = DROPSHIP_JUMP_ANIMS[ playerDropshipIndex ] jumpSequence.attachment = "ORIGIN" - jumpSequence.setInitialTime = Time() - ( file.introStartTime + 10.9 ) // pretty sure you should do this with GetScriptedAnimEventCycleFrac? + jumpSequence.setInitialTime = max( 0.0, Time() - ( file.introStartTime + 11.0 ) ) // pretty sure you should do this with GetScriptedAnimEventCycleFrac? // idk unsure how to use that, all i know is getsequenceduration > the length it actually should be - FirstPersonSequence( jumpSequence, player, playerDropship.dropship ) + thread FirstPersonSequence( jumpSequence, player, playerDropship.dropship ) + WaittillAnimDone( player ) // somehow this is better than just waiting for the blocking FirstPersonSequence call? player.s.dropshipIntroIsJumping <- true thread PlayerJumpsFromDropship( player ) @@ -217,6 +219,7 @@ void function PlayerJumpsFromDropship( entity player ) player.ConsumeDoubleJump() // movementdisable doesn't prevent double jumps // wait for player to hit the ground + wait 0.1 // assume players will never actually hit ground before this while ( !player.IsOnGround() && !player.IsWallRunning() && !player.IsWallHanging() ) // todo this needs tweaking WaitFrame() diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut index b2ce4fca..4b90b1a2 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut @@ -127,7 +127,7 @@ void function WaitForPlayers( ) // note: atm if someone disconnects as this happens the game will just wait forever float endTime = Time() + 30.0 - while ( GetPendingClientsCount() != 0 && endTime > Time() ) + while ( ( GetPendingClientsCount() != 0 && endTime > Time() ) || GetPlayerArray().len() == 0 ) WaitFrame() print( "done waiting!" ) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_playlist.gnut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_playlist.gnut index 8db52b11..b27fdbaa 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_playlist.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_playlist.gnut @@ -7,6 +7,12 @@ void function Playlist_Init() AddCallback_OnPlayerRespawned( FeaturedModeSettingsSetupPilotLoadouts ) AddCallback_OnPilotBecomesTitan( FeaturedModeSettingsSetupTitanLoadouts ) + if ( IsFeaturedMode( "all_holopilot" ) || IsFeaturedMode( "all_grapple" ) || + IsFeaturedMode( "all_phase" ) || IsFeaturedMode( "all_ticks" ) || + IsFeaturedMode( "rocket_arena" ) || IsFeaturedMode( "shotguns_snipers" ) || + IsFeaturedMode( "tactikill" ) || IsFeaturedMode( "amped_tacticals" ) ) + SetLoadoutGracePeriodEnabled( false ) + // iron lts rules if ( HasIronRules() ) Riff_ForceTitanExitEnabled( eTitanExitEnabled.Never ) @@ -78,6 +84,8 @@ void function FeaturedModeSettingsSetupPilotLoadouts( entity player ) modifiedLoadout.secondaryMods = [ "rocket_arena" ] } + modifiedLoadout.meleeMods = [ "rocket_arena" ] + player.GiveExtraWeaponMod( "rocket_arena" ) } @@ -120,7 +128,12 @@ void function FeaturedModeSettingsSetupTitanLoadouts( entity player, entity tita if ( IsFeaturedMode( "turbo_titans" ) ) { array<string> settingsMods = player.GetPlayerSettingsMods() - settingsMods.append( "turbo_titan" ) - player.SetPlayerSettingsWithMods( player.GetPlayerSettings(), settingsMods ) + + // seems to crash if we set both of these at once? idk odd game + if ( !settingsMods.contains( "pas_mobility_dash_capacity" ) ) + { + settingsMods.append( "turbo_titan" ) + player.SetPlayerSettingsWithMods( player.GetPlayerSettings(), settingsMods ) + } } }
\ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut index ac64af37..e52c9142 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut @@ -10,6 +10,7 @@ global function ScoreEvent_NPCKilled global function ScoreEvent_SetEarnMeterValues global function ScoreEvent_SetupEarnMeterValuesForMixedModes +global function ScoreEvent_SetupEarnMeterValuesForTitanModes struct { bool firstStrikeDone = false @@ -212,7 +213,7 @@ void function ScoreEvent_SetupEarnMeterValuesForMixedModes() // mixed modes in t { // todo needs earn/overdrive values // player-controlled stuff - ScoreEvent_SetEarnMeterValues( "KillPilot", 0.0, 0.05 ) + ScoreEvent_SetEarnMeterValues( "KillPilot", 0.7, 0.15 ) ScoreEvent_SetEarnMeterValues( "KillTitan", 0.0, 0.15 ) ScoreEvent_SetEarnMeterValues( "TitanKillTitan", 0.0, 0.0 ) // unsure ScoreEvent_SetEarnMeterValues( "PilotBatteryStolen", 0.0, 0.35 ) @@ -227,6 +228,5 @@ void function ScoreEvent_SetupEarnMeterValuesForMixedModes() // mixed modes in t void function ScoreEvent_SetupEarnMeterValuesForTitanModes() { - // todo needs earn/overdrive values - + // relatively sure we don't have to do anything here but leaving this function for consistency }
\ 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 88f1e04c..9b293524 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/spawn.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/spawn.nut @@ -267,7 +267,7 @@ bool function IsSpawnpointValid( entity spawnpoint, int team ) return false } - array<entity> projectiles = GetProjectileArrayEx( "any", TEAM_ANY, TEAM_ANY, spawnpoint.GetOrigin(), 400 ) + array<entity> projectiles = GetProjectileArrayEx( "any", TEAM_ANY, TEAM_ANY, spawnpoint.GetOrigin(), 600 ) foreach ( entity projectile in projectiles ) if ( projectile.GetTeam() != team ) return false @@ -283,13 +283,14 @@ bool function IsSpawnpointValid( entity spawnpoint, int team ) { if ( enemyPlayer.GetTeam() == team || !IsAlive( enemyPlayer ) ) continue + + float dist = 1000.0 + // check fov, constant here is stolen from every other place this is done + if ( VectorDot_PlayerToOrigin( enemyPlayer, spawnpoint.GetOrigin() ) > 0.8 ) + dist /= 0.75 // check distance, constant here is basically arbitrary - if ( Distance( enemyPlayer.GetOrigin(), spawnpoint.GetOrigin() ) > 1000.0 ) - continue - - // check fov, constant here is stolen from every other place this is done - if ( VectorDot_PlayerToOrigin( enemyPlayer, spawnpoint.GetOrigin() ) < 0.8 ) + if ( Distance( enemyPlayer.GetOrigin(), spawnpoint.GetOrigin() ) > dist ) continue // check actual los |