From 75e95ef7c8f319765e5702e8c178d93f03471e75 Mon Sep 17 00:00:00 2001 From: William Miller Date: Wed, 2 Oct 2024 09:36:01 -0300 Subject: [PATCH 1/7] Restore missing faction dialogue for Titan Meter buildup (#876) Adds faction dialogue saying that Titan is soon ready as well as showing a message when Titan is ready to drop. --- .../vscripts/earn_meter/sv_earn_meter_mp.gnut | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter_mp.gnut index a20e7aa05..21723ab5d 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter_mp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter_mp.gnut @@ -91,6 +91,8 @@ void function EarnMeterMP_PlayerLifeThink( entity player ) EarnObject pilotReward = PlayerEarnMeter_GetReward( player ) float pilotRewardFrac = PlayerEarnMeter_GetRewardFrac( player ) int lastEarnMeterMode = PlayerEarnMeter_GetMode( player ) + bool saidTitanSoon = false + bool titanReadyMsg = false float lastPassiveGainTime = Time() OnThreadEnd( @@ -148,8 +150,22 @@ void function EarnMeterMP_PlayerLifeThink( entity player ) if ( lastEarnMeterMode == eEarnMeterMode.DEFAULT ) { + if ( Riff_TitanAvailability() != eTitanAvailability.Never ) + { + if ( PlayerEarnMeter_GetOwnedFrac( player ) >= 0.75 && PlayerEarnMeter_GetOwnedFrac( player ) < 0.95 && !saidTitanSoon ) + { + PlayFactionDialogueToPlayer( "mp_titanSoon", player ) + saidTitanSoon = true + } + else if( PlayerEarnMeter_GetOwnedFrac( player ) < 0.75 ) + saidTitanSoon = false + } + if ( PlayerEarnMeter_GetOwnedFrac( player ) < 1.0 ) + { PlayerEarnMeter_DisableGoal( player ) + titanReadyMsg = false + } else if ( player.GetPlayerNetInt( "goalState" ) != eRewardState.UNAVAILABLE ) { // if goal is enabled then the client will show "titan ready" alerts even if it isn't @@ -157,6 +173,11 @@ void function EarnMeterMP_PlayerLifeThink( entity player ) // so unfortunately we have to do this manually player.SetPlayerNetInt( "goalState", eRewardState.AVAILABLE ) PlayerEarnMeter_RefreshGoal( player ) + if( !titanReadyMsg ) + { + Remote_CallFunction_NonReplay( player, "ServerCallback_TitanReadyMessage" ) + titanReadyMsg = true + } } if ( Time() - lastPassiveGainTime > 4.0 && file.passiveMeterGainEnabled ) // this might be 5.0 From 22109d62eea28ce96838a0f739a9de14bd9b18a7 Mon Sep 17 00:00:00 2001 From: William Miller Date: Fri, 4 Oct 2024 12:08:03 -0300 Subject: [PATCH 2/7] Remove Clutter Client Logging from Glitch (#889) --- .../mod/scripts/vscripts/mp/levels/cl_mp_glitch.nut | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Northstar.Client/mod/scripts/vscripts/mp/levels/cl_mp_glitch.nut b/Northstar.Client/mod/scripts/vscripts/mp/levels/cl_mp_glitch.nut index 5c1a20927..4ca323919 100644 --- a/Northstar.Client/mod/scripts/vscripts/mp/levels/cl_mp_glitch.nut +++ b/Northstar.Client/mod/scripts/vscripts/mp/levels/cl_mp_glitch.nut @@ -101,10 +101,6 @@ void function AddInWorldMinimapObject( entity ent ) //TODO: If we want radar jam void function AddInWorldMinimapObjectInternal( entity ent, var screen ) { - printt( "AddInWorldMinimapObject" ) - printt( screen ) - printt( ent ) - bool isNPCTitan = ent.IsNPC() && ent.IsTitan() bool isPetTitan = ent == GetLocalViewPlayer().GetPetTitan() bool isLocalPlayer = ent == GetLocalViewPlayer() From 7a58805827c9447a4584bfe6025dbff18a1bda90 Mon Sep 17 00:00:00 2001 From: Harmony Weblate <96563367+harmony-weblate@users.noreply.github.com> Date: Tue, 8 Oct 2024 15:11:43 +0200 Subject: [PATCH 3/7] Translations update from Weblate (#891) Translated using Weblate (Portuguese) Currently translated at 100.0% (323 of 323 strings) Translation: Northstar/Northstar Client Localisation Translate-URL: https://translate.harmony.tf/projects/northstar/client/pt/ Co-authored-by: William Miller --- ...orthstar_client_localisation_portuguese.txt | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Northstar.Client/mod/resource/northstar_client_localisation_portuguese.txt b/Northstar.Client/mod/resource/northstar_client_localisation_portuguese.txt index 75a5faad6..79f3272de 100644 --- a/Northstar.Client/mod/resource/northstar_client_localisation_portuguese.txt +++ b/Northstar.Client/mod/resource/northstar_client_localisation_portuguese.txt @@ -304,8 +304,8 @@ Clique em Sim se você concorda. Esta escolha pode ser alterada a qualquer momen "HIDE_LOCKED" "Esconder desativados" // In-game chat - "HUD_CHAT_WHISPER_PREFIX" "[WHISPER]" - "HUD_CHAT_SERVER_PREFIX" "[SERVER]" + "HUD_CHAT_WHISPER_PREFIX" "[SUSSURRO]" + "HUD_CHAT_SERVER_PREFIX" "[SERVIDOR]" "ONLY_HOST_MATCH_SETTINGS" "Somente o Host pode mudar as configurações da Partida Privada" "ONLY_HOST_CAN_START_MATCH" "Somente o Host pode Iniciar a Partida" "LOG_UNKNOWN_CLIENTCOMMANDS" "Registrar Comandos desconhecidos de Clientes" @@ -355,8 +355,8 @@ Clique em Sim se você concorda. Esta escolha pode ser alterada a qualquer momen "MOD_DL_DISABLED" "(download automático de mod está desabilitado)" "DOWNLOADING_MOD_TITLE" "Baixando mod" "DOWNLOADING_MOD_TEXT_W_PROGRESS" "Baixando %s1 v%s2...\n(%s3/%s4 MB)" - "CHECKSUMING_TITLE" "Verificando o mod" - "CHECKSUMING_TEXT" "Verificando conteúdo de %s1 v%s2..." + "CHECKSUMING_TITLE" "Verificando a integridade do mod" + "CHECKSUMING_TEXT" "Validando arquivos de %s1 v%s2..." "EXTRACTING_MOD_TITLE" "Extraíndo mod (%s1%)" "MOD_REQUIRED_WARNING" " Este mod pode ser desativado quando entrar em um servidor" "AUTHENTICATION_FAILED_HEADER" "Autenticação Falhou" @@ -376,5 +376,15 @@ Clique em Sim se você concorda. Esta escolha pode ser alterada a qualquer momen "MOD_FETCHING_FAILED_GENERAL" "Extração do mod falhou. Verifique os logs para mais detalhes." "MANIFESTO_FETCHING_TEXT" "Retornando a lista de mods verificados..." "MANIFESTO_FETCHING_TITLE" "Preparando o download do mod" + "MODE_MENU_PVPVE" "JcJcA" + "MODE_MENU_PVE" "JcA" + "MODE_MENU_PVP" "JcJ" + "MODE_MENU_FFA" "TcT" + "MODE_MENU_OTHER" "Outros" + "MODE_MENU_CUSTOM" "Personalizado" + "MODE_MENU_ALL" "Todos" + "MODE_MENU_UNKNOWN" "Desconhecido" + "MODE_MENU_SWITCH" "Filtrar" + "MODE_MENU_TITAN_ONLY" "Somente Titãs" } } From e616cb1d5f148bbc1b892cac140a0138735ed05c Mon Sep 17 00:00:00 2001 From: William Miller Date: Thu, 10 Oct 2024 09:24:57 -0300 Subject: [PATCH 4/7] Delete `_spawnpoints.gnut` (#890) Unused file, not loaded by Northstar. --- .../mod/scripts/vscripts/gamemodes/_spawnpoints.gnut | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_spawnpoints.gnut diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_spawnpoints.gnut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_spawnpoints.gnut deleted file mode 100644 index e69de29bb..000000000 From 9beff344f5c71856e27c8a18e97e42fc92bb793d Mon Sep 17 00:00:00 2001 From: GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> Date: Mon, 14 Oct 2024 13:07:21 +0200 Subject: [PATCH 5/7] Update links to point to new wiki (#894) Documentation was moved from GitBook to MkDocs so the links to the wiki should updated accordingly. --- Northstar.Client/mod/scripts/vscripts/ui/atlas_auth.nut | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Northstar.Client/mod/scripts/vscripts/ui/atlas_auth.nut b/Northstar.Client/mod/scripts/vscripts/ui/atlas_auth.nut index 89b7f7196..966686025 100644 --- a/Northstar.Client/mod/scripts/vscripts/ui/atlas_auth.nut +++ b/Northstar.Client/mod/scripts/vscripts/ui/atlas_auth.nut @@ -37,7 +37,7 @@ void function AtlasAuthDialog_Threaded() if ( res.errorCode != "" ) dialogData.message += format( "\n\n%s", Localize( "#AUTHENTICATION_FAILED_ERROR_CODE", res.errorCode ) ) - string link = "https://r2northstar.gitbook.io/r2northstar-wiki/installing-northstar/troubleshooting" + string link = "https://docs.northstar.tf/Wiki/installing-northstar/troubleshooting/" // link to generic troubleshooting page if we don't have an error code from Atlas if ( res.errorCode != "" ) link = format( "%s#%s", link, res.errorCode ) diff --git a/README.md b/README.md index 4dbbd6edd..3d7a9019c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Translation status -[Squirrel](http://www.squirrel-lang.org/squirreldoc/reference/index.html) scripts used to recreate server-side gamelogic and add [custom content](https://r2northstar.gitbook.io/r2northstar-wiki/using-northstar/gamemodes) to the game. +[Squirrel](http://www.squirrel-lang.org/squirreldoc/reference/index.html) scripts used to recreate server-side gamelogic and add [custom content](https://docs.northstar.tf/Wiki/using-northstar/gamemodes/) to the game. ## Contents: From 9b83a632621264e28dd1724b90d381727c83d941 Mon Sep 17 00:00:00 2001 From: William Miller Date: Wed, 30 Oct 2024 19:40:11 -0300 Subject: [PATCH 6/7] Fix Match Stats Tracking Improperly (#898) Previously would incorrectly count each round in round based modes as individual games duplicating and stacking stats for those modes in the process. This commit changes where the hook happens. Ensures the stats will register only once and only when the match really ends, still disconsidering Epilogue state. --- .../mod/scripts/vscripts/mp/_gamestate_mp.nut | 32 +------------- .../mod/scripts/vscripts/mp/_stats.nut | 44 +++++++++---------- 2 files changed, 22 insertions(+), 54 deletions(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut index 0c66f5a96..17323c38b 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut @@ -226,37 +226,7 @@ void function SetWinner( int team, string winningReason = "", string losingReaso SetGameState( eGameState.WinnerDetermined ) ScoreEvent_MatchComplete( team ) - array players = GetPlayerArray() - int functionref( entity, entity ) compareFunc = GameMode_GetScoreCompareFunc( GAMETYPE ) - if ( compareFunc != null ) - { - players.sort( compareFunc ) - int playerCount = players.len() - int currentPlace = 1 - for ( int i = 0; i < 3; i++ ) - { - if ( i >= playerCount ) - continue - - if ( i > 0 && compareFunc( players[i - 1], players[i] ) != 0 ) - currentPlace += 1 - - switch( currentPlace ) - { - case 1: - UpdatePlayerStat( players[i], "game_stats", "mvp" ) - UpdatePlayerStat( players[i], "game_stats", "mvp_total" ) - UpdatePlayerStat( players[i], "game_stats", "top3OnTeam" ) - break - case 2: - UpdatePlayerStat( players[i], "game_stats", "top3OnTeam" ) - break - case 3: - UpdatePlayerStat( players[i], "game_stats", "top3OnTeam" ) - break - } - } - } + RegisterMatchStats_OnMatchComplete() } } } diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut index 74a9088b8..84b09ec8d 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut @@ -13,6 +13,7 @@ global function UpdateTitanCoreEarnedStat global function PreScoreEventUpdateStats global function PostScoreEventUpdateStats global function Stats_OnPlayerDidDamage +global function RegisterMatchStats_OnMatchComplete struct { table< string, array > refs @@ -36,7 +37,6 @@ void function Stats_Init() AddCallback_OnPlayerRespawned( OnPlayerRespawned ) AddCallback_OnClientConnected( OnClientConnected ) AddCallback_OnClientDisconnected( OnClientDisconnected ) - AddCallback_GameStateEnter( eGameState.WinnerDetermined, OnWinnerDetermined ) thread HandleDistanceAndTimeStats_Threaded() thread SaveStatsPeriodically_Threaded() @@ -813,7 +813,7 @@ void function OnPlayerRespawned( entity player ) thread SetLastPosForDistanceStatValid_Threaded( player, true ) } -void function OnWinnerDetermined() +void function RegisterMatchStats_OnMatchComplete() { // award players for match completed, wins, and losses foreach ( entity player in GetPlayerArray() ) @@ -888,30 +888,28 @@ void function OnWinnerDetermined() player.SetPersistentVar( "kdratio_lifetime_pvp", kdratio_lifetimepvp ) } - // award mvp and top 3 in each team - if ( !IsFFAGame() ) + array players = GetPlayerArray() + players.sort( GetScoreboardCompareFunc() ) + int playerCount = players.len() + int currentPlace = 1 + for ( int i = 0; i < 3; i++ ) { - string gamemode = GameRules_GetGameMode() - int functionref( entity, entity ) compareFunc = GameMode_GetScoreCompareFunc( gamemode ) - - for( int team = 0; team < MAX_TEAMS; team++ ) + if ( i >= playerCount ) + continue + + int functionref( entity, entity ) compareFunc = GetScoreboardCompareFunc() + if ( i > 0 && compareFunc( players[i - 1], players[i] ) != 0 ) + currentPlace += 1 + switch( currentPlace ) { - array players = GetPlayerArrayOfTeam( team ) - if ( compareFunc == null ) - { - printt( "gamemode doesn't have a compare func to get the top 3" ) - return - } - players.sort( compareFunc ) - int maxAwards = int( min( players.len(), 3 ) ) - for ( int i = 0; i < maxAwards; i++ ) - { - if ( i == 0 ) - Stats_IncrementStat( players[ i ], "game_stats", "mvp", "", 1.0 ) - Stats_IncrementStat( players[ i ], "game_stats", "top3OnTeam", "", 1.0 ) - } + case 1: // MVP have two parallel stats which one registers MVP for the map played and the other goes to the player's stats menu as a total MVP times + UpdatePlayerStat( players[i], "game_stats", "mvp" ) + UpdatePlayerStat( players[i], "game_stats", "mvp_total" ) + case 2: + case 3: + UpdatePlayerStat( players[i], "game_stats", "top3OnTeam" ) // Ingame this is the "Times Top 3" for the whole match, not per team + break } - } } From 730616d4ceef904cf8a286837249a75cd886fbb2 Mon Sep 17 00:00:00 2001 From: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> Date: Mon, 4 Nov 2024 00:01:47 +0000 Subject: [PATCH 7/7] Replace uses of `disconnect` with `NSDisconnectPlayer` (#841) As we want to remove `FCVAR_SERVER_CAN_EXECUTE` flag from `disconnect`. --- .../mod/scripts/vscripts/burnmeter/sh_burnmeter.gnut | 2 +- Northstar.CustomServers/mod/scripts/vscripts/sh_loadouts.nut | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Northstar.Custom/mod/scripts/vscripts/burnmeter/sh_burnmeter.gnut b/Northstar.Custom/mod/scripts/vscripts/burnmeter/sh_burnmeter.gnut index 37d4356f0..10bca342c 100644 --- a/Northstar.Custom/mod/scripts/vscripts/burnmeter/sh_burnmeter.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/burnmeter/sh_burnmeter.gnut @@ -207,7 +207,7 @@ string function GetSelectedBurnCardRef( entity player ) #if SERVER if ( GetItemDisplayData( ref ).hidden ) - ClientCommand( player, "disconnect" ) + NSDisconnectPlayer( player, "" ) #endif #if SERVER || CLIENT diff --git a/Northstar.CustomServers/mod/scripts/vscripts/sh_loadouts.nut b/Northstar.CustomServers/mod/scripts/vscripts/sh_loadouts.nut index 7a7498b8c..4bf195b6d 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/sh_loadouts.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/sh_loadouts.nut @@ -1509,7 +1509,7 @@ string function GetValidatedPersistentLoadoutValue( entity player, string loadou { printt( "Invalid Loadout Property: ", loadoutType, loadoutIndex, loadoutProperty, value ) value = ResetLoadoutPropertyToDefault( player, loadoutType, loadoutIndex, loadoutProperty ) //TODO: This will call player.SetPersistentVar() directly. Awkward to do this in a getter function - ClientCommand( player, "disconnect #RESETTING_LOADOUT", 0 ) //Kick player out with a "Resetting Invalid Loadout" message. Mainly necessary so UI/Client script don't crash out later with known, bad data from persistence + NSDisconnectPlayer( player, "#RESETTING_LOADOUT" ) // Kick player out with a "Resetting Invalid Loadout" message. Mainly necessary so UI/Client script don't crash out later with known, bad data from persistence } } @@ -1519,7 +1519,8 @@ string function GetValidatedPersistentLoadoutValue( entity player, string loadou { printt( "Invalid Loadout Property: ", loadoutType, loadoutIndex, loadoutProperty, value ) value = ResetLoadoutPropertyToDefault( player, loadoutType, loadoutIndex, loadoutProperty ) //TODO: This will call player.SetPersistentVar() directly. Awkward to do this in a getter function - ClientCommand( player, "disconnect #RESETTING_LOADOUT", 0 ) //Kick player out with a "Resetting Invalid Loadout" message. Mainly necessary so UI/Client script don't crash out later with known, bad data from persistence + NSDisconnectPlayer( player, "#RESETTING_LOADOUT" ) // Kick player out with a "Resetting Invalid Loadout" message. Mainly necessary so UI/Client script don't crash out later with known, bad data from persistence + } ValidateSkinAndCamoIndexesAsAPair( player, loadoutType, loadoutIndex, loadoutProperty, value ) //TODO: This is awkward, has the potential to call a SetPersistentLoadoutValue() if skinIndex and camoIndex are not correct as a pair