From cfa0acc4546389117fbeebc725dde768d87aebeb Mon Sep 17 00:00:00 2001 From: Zanieon Date: Tue, 23 Jan 2024 15:15:37 -0300 Subject: [PATCH 1/7] Update sh_progression.nut --- .../mod/scripts/vscripts/sh_progression.nut | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut index 2dc88d0d4..1e6916637 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut @@ -97,6 +97,23 @@ bool function ClientCommand_ResetTitanAegis( entity player, array args ) return false int suitIndex = args[0].tointeger() + + //Idfk why don't ask, but these fucking 3 Titans have indexes swapped for reasons beyond Lovecraftian gods comprehension + //Tone index points to Northstar, Northstar points to Ronin and Ronin points to Tone, had to do this to proper make them reset their Aegis + switch ( args[0] ) + { + case "2": + suitIndex = 4 + break + + case "3": + suitIndex = 2 + break + + case "4": + suitIndex = 3 + break + } player.SetPersistentVar( "titanFDUnlockPoints[" + suitIndex + "]", 0 ) player.SetPersistentVar( "previousFDUnlockPoints[" + suitIndex + "]", 0 ) player.SetPersistentVar( "fdTitanXP[" + suitIndex + "]", 0 ) From 61e8a8f5e6cd6663311672abe018fc7c461e2ba9 Mon Sep 17 00:00:00 2001 From: Zanieon Date: Tue, 23 Jan 2024 19:53:54 -0300 Subject: [PATCH 2/7] Change method of reading to Refs instead --- .../mod/scripts/vscripts/sh_progression.nut | 22 +++---------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut index 1e6916637..a1afe4c8f 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut @@ -88,7 +88,7 @@ bool function ClientCommand_SetProgression( entity player, array args ) /// Resets a specific Titan's Aegis rank back to `0` /// * `player` - The player entity to perform the action on -/// * `args` - The arguments passed from the client command. `args[0]` should be an integer corresponding to the index of the Titan to reset. +/// * `args` - The arguments passed from the client command. `args[0]` should be a string corresponding to the chassis name of the Titan to reset. /// /// Returns `true` on success and `false` on missing args. bool function ClientCommand_ResetTitanAegis( entity player, array args ) @@ -96,30 +96,14 @@ bool function ClientCommand_ResetTitanAegis( entity player, array args ) if ( !args.len() ) return false - int suitIndex = args[0].tointeger() + string titanRef = args[0] + int suitIndex = PersistenceGetEnumIndexForItemName( "titanClasses", titanRef ) - //Idfk why don't ask, but these fucking 3 Titans have indexes swapped for reasons beyond Lovecraftian gods comprehension - //Tone index points to Northstar, Northstar points to Ronin and Ronin points to Tone, had to do this to proper make them reset their Aegis - switch ( args[0] ) - { - case "2": - suitIndex = 4 - break - - case "3": - suitIndex = 2 - break - - case "4": - suitIndex = 3 - break - } 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 RecalculateHighestTitanFDLevel( player ) return true From 6881bac00d0651d0761f4e027fc118f63c8aae0d Mon Sep 17 00:00:00 2001 From: Zanieon Date: Tue, 23 Jan 2024 21:39:09 -0300 Subject: [PATCH 3/7] Update sh_progression.nut --- .../mod/scripts/vscripts/sh_progression.nut | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut index a1afe4c8f..f7a22013b 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut @@ -89,6 +89,7 @@ bool function ClientCommand_SetProgression( entity player, array args ) /// Resets a specific Titan's Aegis rank back to `0` /// * `player` - The player entity to perform the action on /// * `args` - The arguments passed from the client command. `args[0]` should be a string corresponding to the chassis name of the Titan to reset. +/// * `chassis name` - Valid chassis are: Ion, Tone, Vanguard, Northstar, Ronin, Legion and Scorch. /// /// Returns `true` on success and `false` on missing args. bool function ClientCommand_ResetTitanAegis( entity player, array args ) @@ -97,6 +98,9 @@ bool function ClientCommand_ResetTitanAegis( entity player, array args ) return false string titanRef = args[0] + if( !PersistenceEnumValueIsValid( "titanClasses", titanRef ) ) + return false + int suitIndex = PersistenceGetEnumIndexForItemName( "titanClasses", titanRef ) player.SetPersistentVar( "titanFDUnlockPoints[" + suitIndex + "]", 0 ) From fba9f1a0bef1a43b6ad39e057abf48ec38c7cda6 Mon Sep 17 00:00:00 2001 From: Zanieon Date: Thu, 25 Jan 2024 09:17:22 -0300 Subject: [PATCH 4/7] Lowercasing and doc changing --- Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut index f7a22013b..fab0e1767 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut @@ -89,7 +89,7 @@ bool function ClientCommand_SetProgression( entity player, array args ) /// Resets a specific Titan's Aegis rank back to `0` /// * `player` - The player entity to perform the action on /// * `args` - The arguments passed from the client command. `args[0]` should be a string corresponding to the chassis name of the Titan to reset. -/// * `chassis name` - Valid chassis are: Ion, Tone, Vanguard, Northstar, Ronin, Legion and Scorch. +/// Valid chassis are: ion, tone, vanguard, northstar, ronin, legion and scorch. /// /// Returns `true` on success and `false` on missing args. bool function ClientCommand_ResetTitanAegis( entity player, array args ) From 30b91f9ab3b0b9feb95b4c305baf6463bb78100f Mon Sep 17 00:00:00 2001 From: Zanieon Date: Thu, 25 Jan 2024 09:22:37 -0300 Subject: [PATCH 5/7] Force lowercase in argument input --- Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut index fab0e1767..109d14d5a 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut @@ -97,7 +97,7 @@ bool function ClientCommand_ResetTitanAegis( entity player, array args ) if ( !args.len() ) return false - string titanRef = args[0] + string titanRef = args[0].tolower() if( !PersistenceEnumValueIsValid( "titanClasses", titanRef ) ) return false From b405b6ddba60484f259748036131c6a1af90f8a5 Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Fri, 26 Jan 2024 22:28:30 +0100 Subject: [PATCH 6/7] fix: Grammar in comment --- Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut index 109d14d5a..1ac557e4c 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut @@ -89,7 +89,7 @@ bool function ClientCommand_SetProgression( entity player, array args ) /// Resets a specific Titan's Aegis rank back to `0` /// * `player` - The player entity to perform the action on /// * `args` - The arguments passed from the client command. `args[0]` should be a string corresponding to the chassis name of the Titan to reset. -/// Valid chassis are: ion, tone, vanguard, northstar, ronin, legion and scorch. +/// Valid chassis are: ion, tone, vanguard, northstar, ronin, legion, and scorch. /// /// Returns `true` on success and `false` on missing args. bool function ClientCommand_ResetTitanAegis( entity player, array args ) From f700ed62ac46549703ae9d787e182180f1691d88 Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Fri, 26 Jan 2024 22:28:44 +0100 Subject: [PATCH 7/7] fix: Restore removed comment --- Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut | 1 + 1 file changed, 1 insertion(+) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut index 1ac557e4c..5098dd328 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut @@ -108,6 +108,7 @@ bool function ClientCommand_ResetTitanAegis( entity player, array args ) 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 RecalculateHighestTitanFDLevel( player ) return true