From 341f3aca6b9f712490277610f796a98f812e548c Mon Sep 17 00:00:00 2001 From: Zanieon Date: Fri, 29 Sep 2023 02:47:52 -0300 Subject: [PATCH 1/8] Keep store items unlocked with progression enabled --- .../mod/scripts/vscripts/_items.nut | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_items.nut b/Northstar.CustomServers/mod/scripts/vscripts/_items.nut index 5878da134..62c375937 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/_items.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/_items.nut @@ -5700,6 +5700,12 @@ bool function IsSubItemLocked( entity player, string ref, string parentRef ) { if ( DevEverythingUnlocked( player ) ) return false + + if ( IsItemPurchasableEntitlement( ref, parentRef ) ) + return false + + if ( GetItemType( ref ) == eItemTypes.PRIME_TITAN || GetSubitemType( parentRef, ref ) == eItemTypes.PRIME_TITAN ) + return false if ( IsItemInEntitlementUnlock( ref, parentRef ) ) { @@ -5724,7 +5730,7 @@ bool function IsSubItemLocked( entity player, string ref, string parentRef ) if ( IsItemLocked( player, parentRef ) ) return true - + if ( GetSubItemUnlockType( ref, parentRef ) == eUnlockType.STAT ) { if ( !IsSubItemLockedForStat( player, ref, parentRef) ) @@ -5819,6 +5825,12 @@ bool function IsItemLocked( entity player, string ref ) { if ( DevEverythingUnlocked( player ) ) return false + + if ( IsItemPurchasableEntitlement( ref ) ) + return false + + if ( GetItemType( ref ) == eItemTypes.PRIME_TITAN ) + return false if ( IsItemInEntitlementUnlock( ref ) ) { From a1ea16b7fff39154e915f54bf86596cc67133496 Mon Sep 17 00:00:00 2001 From: Zanieon Date: Fri, 29 Sep 2023 02:48:26 -0300 Subject: [PATCH 2/8] Add Aegis Rank reset functionality --- .../mod/scripts/vscripts/sh_progression.nut | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut index 22354349a..21f2f9a1a 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut @@ -5,7 +5,6 @@ global function Progression_SetPreference global function Progression_GetPreference global function UpdateCachedLoadouts_Delayed #endif - #if SP // literally just stub the global functions and call it a day void function Progression_Init() {} @@ -17,7 +16,6 @@ void function UpdateCachedLoadouts_Delayed() {} #endif // CLIENT || UI #else // MP || UI basically - // SO FOR SOME GOD DAMN REASON, PUTTING THESE INTO ONE STRUCT // AND PUTTING THE #if STUFF AROUND THE VARS CAUSES A COMPILE // ERROR, SO I HAVE TO DO THIS AWFULNESS @@ -38,6 +36,7 @@ void function Progression_Init() #if SERVER AddCallback_OnClientDisconnected( OnClientDisconnected ) AddClientCommandCallback( "ns_progression", ClientCommand_SetProgression ) + AddClientCommandCallback( "ns_resettitanaegis", ClientCommand_ResetTitanAegis ) AddCallback_GameStateEnter( eGameState.Playing, OnPlaying ) #elseif CLIENT AddCallback_OnClientScriptInit( OnClientScriptInit ) @@ -84,6 +83,29 @@ bool function ClientCommand_SetProgression( entity player, array args ) return true } + +bool function ClientCommand_ResetTitanAegis( entity player, array args ) +{ + int suitIndex = GetPersistentSpawnLoadoutIndex( player, "titan" ) + player.SetPersistentVar( "titanFDUnlockPoints[" + suitIndex + "]", 0 ) + player.SetPersistentVar( "previousFDUnlockPoints[" + suitIndex + "]", 0 ) + player.SetPersistentVar( "fdTitanXP[" + suitIndex + "]", 0 ) + player.SetPersistentVar( "fdPreviousTitanXP[" + suitIndex + "]", 0 ) + + //Refresh Highest Aegis Titan since we might get all of them back to 1 if players wants + int enumCount = PersistenceGetEnumCount( "titanClasses" ) + int HighestAegis = 0 + for ( int i = 0; i < enumCount; i++ ) + { + string enumName = PersistenceGetEnumItemNameForIndex( "titanClasses", i ) + int AegisLevel = FD_TitanGetLevelForXP( enumName, FD_TitanGetXP( player, enumName ) ) + if ( HighestAegis < AegisLevel ) + HighestAegis = AegisLevel + } + player.SetPersistentVar( "fdStats.highestTitanFDLevel", HighestAegis ) + + return true +} #endif #if CLIENT @@ -268,7 +290,7 @@ void function ValidateEquippedItems( entity player ) // camoIndex if ( loadout.skinIndex == TITAN_SKIN_INDEX_CAMO ) { - array camoSkins = GetAllItemsOfType( eItemTypes.CAMO_SKIN ) + array camoSkins = GetAllItemsOfType( eItemTypes.CAMO_SKIN_TITAN ) if ( loadout.camoIndex >= camoSkins.len() || loadout.camoIndex < 0 ) { printt( " - INVALID TITAN CAMO/SKIN, RESETTING" ) @@ -1102,4 +1124,4 @@ string function GetWeaponWarpaintRefByIndex( int skinIndex, string parentRef ) } #endif // SERVER -#endif // MP +#endif // MP \ No newline at end of file From 824d914539ce683e4a13b0e939c156d1085563ba Mon Sep 17 00:00:00 2001 From: Zanieon Date: Fri, 29 Sep 2023 10:17:53 -0300 Subject: [PATCH 3/8] Revert "Add Aegis Rank reset functionality" This reverts commit a1ea16b7fff39154e915f54bf86596cc67133496. --- .../mod/scripts/vscripts/sh_progression.nut | 30 +++---------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut index 21f2f9a1a..22354349a 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut @@ -5,6 +5,7 @@ global function Progression_SetPreference global function Progression_GetPreference global function UpdateCachedLoadouts_Delayed #endif + #if SP // literally just stub the global functions and call it a day void function Progression_Init() {} @@ -16,6 +17,7 @@ void function UpdateCachedLoadouts_Delayed() {} #endif // CLIENT || UI #else // MP || UI basically + // SO FOR SOME GOD DAMN REASON, PUTTING THESE INTO ONE STRUCT // AND PUTTING THE #if STUFF AROUND THE VARS CAUSES A COMPILE // ERROR, SO I HAVE TO DO THIS AWFULNESS @@ -36,7 +38,6 @@ void function Progression_Init() #if SERVER AddCallback_OnClientDisconnected( OnClientDisconnected ) AddClientCommandCallback( "ns_progression", ClientCommand_SetProgression ) - AddClientCommandCallback( "ns_resettitanaegis", ClientCommand_ResetTitanAegis ) AddCallback_GameStateEnter( eGameState.Playing, OnPlaying ) #elseif CLIENT AddCallback_OnClientScriptInit( OnClientScriptInit ) @@ -83,29 +84,6 @@ bool function ClientCommand_SetProgression( entity player, array args ) return true } - -bool function ClientCommand_ResetTitanAegis( entity player, array args ) -{ - int suitIndex = GetPersistentSpawnLoadoutIndex( player, "titan" ) - player.SetPersistentVar( "titanFDUnlockPoints[" + suitIndex + "]", 0 ) - player.SetPersistentVar( "previousFDUnlockPoints[" + suitIndex + "]", 0 ) - player.SetPersistentVar( "fdTitanXP[" + suitIndex + "]", 0 ) - player.SetPersistentVar( "fdPreviousTitanXP[" + suitIndex + "]", 0 ) - - //Refresh Highest Aegis Titan since we might get all of them back to 1 if players wants - int enumCount = PersistenceGetEnumCount( "titanClasses" ) - int HighestAegis = 0 - for ( int i = 0; i < enumCount; i++ ) - { - string enumName = PersistenceGetEnumItemNameForIndex( "titanClasses", i ) - int AegisLevel = FD_TitanGetLevelForXP( enumName, FD_TitanGetXP( player, enumName ) ) - if ( HighestAegis < AegisLevel ) - HighestAegis = AegisLevel - } - player.SetPersistentVar( "fdStats.highestTitanFDLevel", HighestAegis ) - - return true -} #endif #if CLIENT @@ -290,7 +268,7 @@ void function ValidateEquippedItems( entity player ) // camoIndex if ( loadout.skinIndex == TITAN_SKIN_INDEX_CAMO ) { - array camoSkins = GetAllItemsOfType( eItemTypes.CAMO_SKIN_TITAN ) + array camoSkins = GetAllItemsOfType( eItemTypes.CAMO_SKIN ) if ( loadout.camoIndex >= camoSkins.len() || loadout.camoIndex < 0 ) { printt( " - INVALID TITAN CAMO/SKIN, RESETTING" ) @@ -1124,4 +1102,4 @@ string function GetWeaponWarpaintRefByIndex( int skinIndex, string parentRef ) } #endif // SERVER -#endif // MP \ No newline at end of file +#endif // MP From 643d7d6746bc0d84d073d301b7b00deed8094ddd Mon Sep 17 00:00:00 2001 From: William Miller Date: Fri, 29 Sep 2023 11:38:21 -0300 Subject: [PATCH 4/8] Space'y Co-authored-by: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> --- Northstar.CustomServers/mod/scripts/vscripts/_items.nut | 1 - 1 file changed, 1 deletion(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_items.nut b/Northstar.CustomServers/mod/scripts/vscripts/_items.nut index 62c375937..2ee7648bc 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/_items.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/_items.nut @@ -5730,7 +5730,6 @@ bool function IsSubItemLocked( entity player, string ref, string parentRef ) if ( IsItemLocked( player, parentRef ) ) return true - if ( GetSubItemUnlockType( ref, parentRef ) == eUnlockType.STAT ) { if ( !IsSubItemLockedForStat( player, ref, parentRef) ) From 1bc8e0d2ecf3280b9662291b9975a10843b63d43 Mon Sep 17 00:00:00 2001 From: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> Date: Sun, 1 Oct 2023 20:22:12 +0100 Subject: [PATCH 5/8] Trigger workflows Github actions having a moment, so I'm making a random whitespace change to trigger it again --- Northstar.CustomServers/mod/scripts/vscripts/_items.nut | 1 + 1 file changed, 1 insertion(+) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_items.nut b/Northstar.CustomServers/mod/scripts/vscripts/_items.nut index 2ee7648bc..a5c3e2709 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/_items.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/_items.nut @@ -5730,6 +5730,7 @@ bool function IsSubItemLocked( entity player, string ref, string parentRef ) if ( IsItemLocked( player, parentRef ) ) return true + if ( GetSubItemUnlockType( ref, parentRef ) == eUnlockType.STAT ) { if ( !IsSubItemLockedForStat( player, ref, parentRef) ) From 60f779e53e91cd941acdef92fe9f273964e446f9 Mon Sep 17 00:00:00 2001 From: Zanieon Date: Wed, 11 Oct 2023 20:45:33 -0300 Subject: [PATCH 6/8] Expose third string var --- Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut index 010184ff1..e3bafc2af 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut @@ -136,12 +136,12 @@ float function PlayerStat_GetCurrentFloat( entity player, string statCategory, s return 0 } -void function UpdatePlayerStat( entity player, string statCategory, string subStat, int count = 1 ) +void function UpdatePlayerStat( entity player, string statCategory, string subStat, int count = 1, string alias = "" ) { if ( !IsValid( player ) ) return - Stats_IncrementStat( player, statCategory, subStat, "", count.tofloat() ) + Stats_IncrementStat( player, statCategory, subStat, alias, count.tofloat() ) } void function IncrementPlayerDidPilotExecutionWhileCloaked( entity player ) From 55f45ec661f58de4a6c861ad0af4e2d11cebcc07 Mon Sep 17 00:00:00 2001 From: William Miller Date: Thu, 12 Oct 2023 14:27:02 -0300 Subject: [PATCH 7/8] Better naming of extra arg Co-authored-by: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> --- Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut index e3bafc2af..04ff7c209 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut @@ -136,7 +136,7 @@ float function PlayerStat_GetCurrentFloat( entity player, string statCategory, s return 0 } -void function UpdatePlayerStat( entity player, string statCategory, string subStat, int count = 1, string alias = "" ) +void function UpdatePlayerStat( entity player, string statCategory, string subStat, int count = 1, string statAlias = "" ) { if ( !IsValid( player ) ) return From b48e2315f60a2bc39a0c146ea08cd160dfd3e332 Mon Sep 17 00:00:00 2001 From: Zanieon Date: Thu, 12 Oct 2023 14:30:20 -0300 Subject: [PATCH 8/8] Fix passing of wrong arg name --- Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut index 04ff7c209..208e6da12 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut @@ -141,7 +141,7 @@ void function UpdatePlayerStat( entity player, string statCategory, string subSt if ( !IsValid( player ) ) return - Stats_IncrementStat( player, statCategory, subStat, alias, count.tofloat() ) + Stats_IncrementStat( player, statCategory, subStat, statAlias, count.tofloat() ) } void function IncrementPlayerDidPilotExecutionWhileCloaked( entity player )