Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progression system #655

Merged
merged 92 commits into from Sep 2, 2023
Merged
Show file tree
Hide file tree
Changes from 89 commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
2feff2b
backend work for client progression toggle
ASpoonPlaysGames Jun 24, 2023
c15c161
frontend stuff for client side progression
ASpoonPlaysGames Jun 24, 2023
f7d96a9
fix indentation
ASpoonPlaysGames Jun 24, 2023
c8c579d
update player loadouts on regen properly
ASpoonPlaysGames Jun 24, 2023
c4845f7
fix incorrect xp gain
ASpoonPlaysGames Jun 24, 2023
0199389
move global xp into its own function
ASpoonPlaysGames Jun 24, 2023
fda7145
use correct variables for weapon and titan xp
ASpoonPlaysGames Jun 24, 2023
076449b
grant xp properly on weapon/titan/faction level up
ASpoonPlaysGames Jun 24, 2023
6d7c85f
Merge branch 'main' into progression
ASpoonPlaysGames Jun 24, 2023
c49a8c5
show EOG scoreboard
ASpoonPlaysGames Jun 24, 2023
d933667
use AddPlayerScore for level up things
ASpoonPlaysGames Jun 24, 2023
183c56b
add score event for match complete and victory
ASpoonPlaysGames Jun 24, 2023
b21a62b
add score events for epilogue
ASpoonPlaysGames Jun 24, 2023
ea49dc8
add english localisation for progression
ASpoonPlaysGames Jun 24, 2023
ff4c73d
implement IncrementPlayerDidPilotExecutionWhileCloaked
ASpoonPlaysGames Jun 24, 2023
cbdb732
implement UpdateTitanCoreEarnedStat
ASpoonPlaysGames Jun 24, 2023
deb622c
fix compile
ASpoonPlaysGames Jun 24, 2023
47cd0ba
debug stuff
ASpoonPlaysGames Jun 27, 2023
2cd1ea3
callbacks maybe
ASpoonPlaysGames Jun 27, 2023
b29f653
i found sh_stats so now my life is easier
ASpoonPlaysGames Jun 28, 2023
ff7bc35
good progress
ASpoonPlaysGames Jun 28, 2023
6504c62
Merge branch 'main' into progression
ASpoonPlaysGames Jun 28, 2023
3deb25f
cleanup
ASpoonPlaysGames Jun 28, 2023
5fd6d1a
distance tracking
ASpoonPlaysGames Jun 28, 2023
e55d576
dont spam console
ASpoonPlaysGames Jun 28, 2023
fdd54af
time stats and match end stats
ASpoonPlaysGames Jun 28, 2023
ed0b080
evac stats
ASpoonPlaysGames Jun 28, 2023
ba5530a
boost activated stat
ASpoonPlaysGames Jun 28, 2023
9fd8dfe
first strike and ejection stats
ASpoonPlaysGames Jun 28, 2023
3429848
begin kill tracking
ASpoonPlaysGames Jun 29, 2023
edf40e7
some more kill and death stats
ASpoonPlaysGames Jun 29, 2023
edaf94e
more kill tracking and some damage tracking fixes
ASpoonPlaysGames Jun 29, 2023
e0e433a
execution stats and stuff
ASpoonPlaysGames Jun 29, 2023
855f6a4
better fd difficulty behaviour
ASpoonPlaysGames Jun 30, 2023
ab3786c
begin refactor: death stats
ASpoonPlaysGames Jun 30, 2023
d0d30eb
add comments for required stats
ASpoonPlaysGames Jul 1, 2023
931e214
forgor titan stats
ASpoonPlaysGames Jul 1, 2023
e642039
implement most kills_stats
ASpoonPlaysGames Jul 6, 2023
b26c40f
finish kill stats
ASpoonPlaysGames Jul 7, 2023
4e0a617
titan stats
ASpoonPlaysGames Jul 7, 2023
a2036c3
formatting and stuff
ASpoonPlaysGames Jul 7, 2023
7cbed0e
weapon kill stats
ASpoonPlaysGames Jul 8, 2023
43bf741
kdratio stats
ASpoonPlaysGames Jul 8, 2023
74cc53f
remove debug prints
ASpoonPlaysGames Jul 8, 2023
5567707
formatting and stub validation func
ASpoonPlaysGames Jul 8, 2023
fb1d554
start validation
ASpoonPlaysGames Jul 8, 2023
ca2cdcf
selected pilot and titan loadout index validation
ASpoonPlaysGames Jul 10, 2023
f7b1d52
titan loadout validation
ASpoonPlaysGames Jul 13, 2023
49de211
boost validation and comments for pilot validation
ASpoonPlaysGames Jul 13, 2023
352f2a6
pilot loadout validation
ASpoonPlaysGames Jul 19, 2023
5842d1f
Merge branch 'main' into progression
ASpoonPlaysGames Jul 19, 2023
d5dc0a7
formatting
ASpoonPlaysGames Jul 19, 2023
c9ebb63
Merge branch 'progression' of https://github.com/ASpoonPlaysGames/Nor…
ASpoonPlaysGames Jul 19, 2023
bb8500f
compatibility for DevEverythingUnlocked
ASpoonPlaysGames Jul 19, 2023
c41ae87
remove empty #if SERVER
ASpoonPlaysGames Jul 19, 2023
89860fa
Merge branch 'R2Northstar:main' into progression
ASpoonPlaysGames Jul 23, 2023
7bbc6f0
hotfixes from playtest
ASpoonPlaysGames Jul 24, 2023
f7b6cb6
fix weapon killing spree stats
ASpoonPlaysGames Jul 24, 2023
07f4aee
fix weapon assist stats
ASpoonPlaysGames Jul 24, 2023
ff3002a
improve weapon assists
ASpoonPlaysGames Jul 24, 2023
5dd7215
improve checks for valid stat item refs
ASpoonPlaysGames Jul 24, 2023
3851fbb
maybe fix evacsAttempted?
ASpoonPlaysGames Jul 24, 2023
2688848
attempt fix doublexp showing in postgame when not active
ASpoonPlaysGames Jul 24, 2023
d8e1c1b
fix time by mode stats not working
ASpoonPlaysGames Jul 24, 2023
a64a275
fix FD scoreboard showing incorrectly
ASpoonPlaysGames Jul 24, 2023
a733872
fix postgame report showing when it shouldn't
ASpoonPlaysGames Jul 24, 2023
f26db21
keep UI and CLIENT in sync properly
ASpoonPlaysGames Jul 24, 2023
cda1f7b
awfulness, I hate respawn
ASpoonPlaysGames Jul 24, 2023
ed2bc93
cleanup #if Stuff i think
ASpoonPlaysGames Jul 24, 2023
affb3a9
remove unnecessary compiler stuff
ASpoonPlaysGames Jul 24, 2023
19b9773
Merge branch 'progression' of https://github.com/ASpoonPlaysGames/Nor…
ASpoonPlaysGames Jul 24, 2023
3600435
Merge branch 'main' into progression
ASpoonPlaysGames Jul 24, 2023
bc19a70
Merge branch 'main' into progression
uniboi Aug 2, 2023
33a3616
Apply formatting from code review
ASpoonPlaysGames Aug 2, 2023
cdff95d
Apply suggestion from code review
ASpoonPlaysGames Aug 2, 2023
e253808
Update Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut
ASpoonPlaysGames Aug 2, 2023
de25a79
move to use `format`
ASpoonPlaysGames Aug 2, 2023
ebd3a65
better int casting and variable name
ASpoonPlaysGames Aug 20, 2023
4007143
allow for variable wait time in Stats_SaveStatDelayed
ASpoonPlaysGames Aug 20, 2023
275ebaf
formatting
ASpoonPlaysGames Aug 20, 2023
1684816
Merge branch 'progression' of https://github.com/ASpoonPlaysGames/Nor…
ASpoonPlaysGames Aug 20, 2023
77fb5a4
better UI flow
ASpoonPlaysGames Aug 20, 2023
95c3179
remove unused functions
ASpoonPlaysGames Aug 20, 2023
e2aa7d4
Better function than respawn wrote
ASpoonPlaysGames Aug 21, 2023
b6e9c01
Avoid getting team array multiple times
ASpoonPlaysGames Aug 21, 2023
4b7262c
reduce usage of string concat
ASpoonPlaysGames Aug 21, 2023
58e1778
Merge branch 'progression' of https://github.com/ASpoonPlaysGames/Nor…
ASpoonPlaysGames Aug 21, 2023
fde7783
Fix return value
ASpoonPlaysGames Aug 24, 2023
adc40c4
display announcement in the lobby for users
ASpoonPlaysGames Aug 24, 2023
caedf37
im stupid but dont worry about it
ASpoonPlaysGames Aug 25, 2023
3432319
trim trailing whitespace
ASpoonPlaysGames Aug 25, 2023
7aac5a0
add explanatory comment for why i poll
ASpoonPlaysGames Aug 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -342,5 +342,23 @@ Press Yes if you agree to this. This choice can be changed in the mods menu at a
"MOD_SETTINGS_RESET_ALL" "Reset All"
"NO_RESULTS" "No results."
"NO_MODS" "No settings available! Install more mods at ^5588FF00northstar.thunderstore.io^0."

// Toggleable progression
"TOGGLE_PROGRESSION" "Toggle Progression"
"Y_BUTTON_TOGGLE_PROGRESSION" "%[Y_BUTTON]% Toggle Progression"

"PROGRESSION_TOGGLE_ENABLED_HEADER" "Disable Progression?"
"PROGRESSION_TOGGLE_ENABLED_BODY" "Titans, Weapons, Factions, Skins, etc. will all be unlocked and usable at any time.\n\nThis can be changed at any time in the multiplayer lobby."

"PROGRESSION_TOGGLE_DISABLED_HEADER" "Enable Progression?"
"PROGRESSION_TOGGLE_DISABLED_BODY" "Titans, Weapons, Factions, Skins, etc. will need to be unlocked by levelling up, or bought with Merits.\n\nThis can be changed at any time in the multiplayer lobby.\n\n^CC000000Warning: if you have currently equipped any items that you do not have unlocked, they will be reset!"

"PROGRESSION_ENABLED_HEADER" "Progression Enabled!"
"PROGRESSION_ENABLED_BODY" "^CCCC0000Progression has been enabled.^\n\nTitans, Weapons, Factions, Skins, etc. will need to be unlocked by levelling up, or bought with Merits.\n\nThis can be changed at any time in the multiplayer lobby."

"PROGRESSION_DISABLED_HEADER" "Progression Disabled!"
"PROGRESSION_DISABLED_BODY" "^CCCC0000Progression has been disabled.^\n\nTitans, Weapons, Factions, Skins, etc. will all be unlocked and usable at any time.\n\nThis can be changed at any time in the multiplayer lobby."

"PROGRESSION_ANNOUNCEMENT_BODY" "^CCCC0000Progression can now be enabled!^\n\nNorthstar now supports vanilla progression, meaning you can choose to unlock Weapons, Skins, Titans, etc. through levelling up and completing challenges.\n\nYou can enable progression using the button at the bottom of the lobby screen.\n\nThis can be changed at any time."
}
}
53 changes: 53 additions & 0 deletions Northstar.Client/mod/scripts/vscripts/ui/menu_lobby.nut
Expand Up @@ -178,6 +178,8 @@ void function InitLobbyMenu()
AddMenuFooterOption( menu, BUTTON_B, "#B_BUTTON_BACK", "#BACK" )
AddMenuFooterOption( menu, BUTTON_BACK, "#BACK_BUTTON_POSTGAME_REPORT", "#POSTGAME_REPORT", OpenPostGameMenu, IsPostGameMenuValid )
AddMenuFooterOption( menu, BUTTON_TRIGGER_RIGHT, "#R_TRIGGER_CHAT", "", null, IsVoiceChatPushToTalk )
// Client side progression toggle
AddMenuFooterOption( menu, BUTTON_Y, "#Y_BUTTON_TOGGLE_PROGRESSION", "#TOGGLE_PROGRESSION", ShowToggleProgressionDialog )

InitChatroom( menu )

Expand Down Expand Up @@ -226,6 +228,57 @@ void function InitLobbyMenu()
RegisterSignal( "LeaveParty" )
}

void function ShowToggleProgressionDialog( var button )
{
bool enabled = Progression_GetPreference()

DialogData dialogData
dialogData.menu = GetMenu( "AnnouncementDialog" )
dialogData.header = enabled ? "#PROGRESSION_TOGGLE_ENABLED_HEADER" : "#PROGRESSION_TOGGLE_DISABLED_HEADER"
dialogData.message = enabled ? "#PROGRESSION_TOGGLE_ENABLED_BODY" : "#PROGRESSION_TOGGLE_DISABLED_BODY"
dialogData.image = $"ui/menu/common/dialog_announcement_1"

AddDialogButton( dialogData, "#NO" )
AddDialogButton( dialogData, "#YES", enabled ? DisableProgression : EnableProgression )

OpenDialog( dialogData )
}

void function EnableProgression()
{
Progression_SetPreference( true )

// update the cache just in case something changed
UpdateCachedLoadouts_Delayed()

DialogData dialogData
dialogData.menu = GetMenu( "AnnouncementDialog" )
dialogData.header = "#PROGRESSION_ENABLED_HEADER"
dialogData.message = "#PROGRESSION_ENABLED_BODY"
dialogData.image = $"ui/menu/common/dialog_announcement_1"

AddDialogButton( dialogData, "#OK" )

EmitUISound( "UI_Menu_Item_Purchased_Stinger" )

OpenDialog( dialogData )
}

void function DisableProgression()
{
Progression_SetPreference( false )

DialogData dialogData
dialogData.menu = GetMenu( "AnnouncementDialog" )
dialogData.header = "#PROGRESSION_DISABLED_HEADER"
dialogData.message = "#PROGRESSION_DISABLED_BODY"
dialogData.image = $"ui/menu/common/dialog_announcement_1"

AddDialogButton( dialogData, "#OK" )

OpenDialog( dialogData )
}
uniboi marked this conversation as resolved.
Show resolved Hide resolved

void function SetupComboButtonTest( var menu )
ASpoonPlaysGames marked this conversation as resolved.
Show resolved Hide resolved
{
ComboStruct comboStruct = ComboButtons_Create( menu )
Expand Down
18 changes: 18 additions & 0 deletions Northstar.CustomServers/mod.json
Expand Up @@ -53,6 +53,11 @@
{
"Name": "ns_allow_kill_commands",
"DefaultValue": "0"
},
{
"Name": "ns_progression_enabled",
"DefaultValue": "0",
"Flags": "ARCHIVE_PLAYERPROFILE"
ASpoonPlaysGames marked this conversation as resolved.
Show resolved Hide resolved
}
],
"Scripts": [
Expand Down Expand Up @@ -150,6 +155,19 @@
"ServerCallback": {
"After": "AiTurretSentry_Init"
}
},
{
"Path": "sh_progression.nut",
"RunOn": "UI || SERVER || CLIENT",
"ServerCallback": {
"Before": "Progression_Init"
},
"ClientCallback": {
"Before": "Progression_Init"
},
"UICallback": {
"Before": "Progression_Init"
}
}
]
}
5 changes: 4 additions & 1 deletion Northstar.CustomServers/mod/cfg/autoexec_ns_server.cfg
Expand Up @@ -21,4 +21,7 @@ sv_updaterate_mp 20 // default updaterate: 20 tick
sv_minupdaterate 20 // unsure if this actually works, but if it does, should set minimum client updaterate
sv_max_snapshots_multiplayer 300 // this needs to be updaterate * 15, or clients will dc in killreplay
net_data_block_enabled 0 // not really sure on this, have heard datablock could have security issues? doesn't seem to have any adverse effects being disabled
host_skip_client_dll_crc 1 // allow people to run modded client dlls, this is mainly so people running pilot visor colour mods can keep those, since they use a client.dll edit
host_skip_client_dll_crc 1 // allow people to run modded client dlls, this is mainly so people running pilot visor colour mods can keep those, since they use a client.dll edit

announcementVersion 1
GeckoEidechse marked this conversation as resolved.
Show resolved Hide resolved
announcement #PROGRESSION_ANNOUNCEMENT_BODY
8 changes: 4 additions & 4 deletions Northstar.CustomServers/mod/scripts/vscripts/_items.nut
Expand Up @@ -5698,7 +5698,7 @@ bool function IsUnlockValid( string ref, string parentRef = "" )

bool function IsSubItemLocked( entity player, string ref, string parentRef )
{
if ( DevEverythingUnlocked() )
if ( DevEverythingUnlocked( player ) )
return false

if ( IsItemInEntitlementUnlock( ref, parentRef ) )
Expand Down Expand Up @@ -5817,7 +5817,7 @@ bool function IsSubItemLocked( entity player, string ref, string parentRef )

bool function IsItemLocked( entity player, string ref )
{
if ( DevEverythingUnlocked() )
if ( DevEverythingUnlocked( player ) )
return false

if ( IsItemInEntitlementUnlock( ref ) )
Expand Down Expand Up @@ -5906,7 +5906,7 @@ bool function IsItemLockedForEntitlement( entity player, string ref, string pare

bool function IsSubItemOwned( entity player, string ref, string parentRef )
{
if ( DevEverythingUnlocked() )
if ( DevEverythingUnlocked( player ) )
return false

Assert( IsValid( player ) )
Expand Down Expand Up @@ -5990,7 +5990,7 @@ bool function IsSubItemOwned( entity player, string ref, string parentRef )

bool function IsItemOwned( entity player, string ref )
{
if ( DevEverythingUnlocked() )
if ( DevEverythingUnlocked( player ) )
return false

Assert( IsValid( player ) )
Expand Down
Expand Up @@ -65,6 +65,8 @@ bool function ClientCommandCallback_GenUp( entity player, array<string> args )
player.GenChanged()
player.XPChanged()
}

RegenPersistentLoadouts(player)

return true
}
39 changes: 16 additions & 23 deletions Northstar.CustomServers/mod/scripts/vscripts/_xp.gnut
@@ -1,6 +1,7 @@
global function SvXP_Init
global function PlayerProgressionAllowed
global function HandleXPGainForScoreEvent
global function AddXP

void function SvXP_Init()
{
Expand Down Expand Up @@ -29,46 +30,38 @@ bool function PlayerProgressionAllowed( entity player )
void function HandleXPGainForScoreEvent( entity player, ScoreEvent event )
{
// note: obviously all xp stuff can be cheated in if people want to on customs, this is mainly just here for fun for those who want it and feature completeness
// most score events don't have this, so we'll set this to the xp value of other categories later if needed

int xpValue = ScoreEvent_GetXPValue( event )
int weaponXp = ScoreEvent_GetXPValueWeapon( event )
int titanXp = ScoreEvent_GetXPValueTitan( event )

if ( xpValue < weaponXp )
xpValue = weaponXp
else if ( xpValue < titanXp )
xpValue = titanXp
int factionXp = ScoreEvent_GetXPValueFaction( event )

entity weapon = player.GetActiveWeapon()
if ( IsValid( weapon ) && ShouldTrackXPForWeapon( weapon.GetWeaponClassName() ) )
AddWeaponXP( player, xpValue )
if ( IsValid( weapon ) && ShouldTrackXPForWeapon( weapon.GetWeaponClassName() ) && weaponXp != 0 )
uniboi marked this conversation as resolved.
Show resolved Hide resolved
AddWeaponXP( player, weaponXp )

// if we specifically gain titan xp, then give titan xp no matter what, otherwise only give it when we're in a titan
if ( titanXp != 0 || player.IsTitan() )
AddTitanXP( player, xpValue )

// most events don't have faction xp but almost everything should give it
int factionXp = ScoreEvent_GetXPValueFaction( event )
if ( xpValue > factionXp )
factionXp = xpValue
else if ( xpValue < factionXp )
xpValue = factionXp
if ( titanXp != 0 )
AddTitanXP( player, titanXp )

if ( factionXp != 0 )
AddFactionXP( player, factionXp )

if ( xpValue == 0 )
return

// global xp
if ( xpValue != 0 )
AddXP( player, xpValue )
}

void function AddXP( entity player, int amount )
{
int oldXp = player.GetPersistentVarAsInt( "xp" )
if(oldXp<0) oldXp = 0
if( oldXp < 0 ) oldXp = 0
int oldLevel = GetLevelForXP( oldXp )
player.SetPersistentVar( "xp", min( oldXp + xpValue, PlayerGetMaxXPPerGen() ) )
player.SetPersistentVar( "xp", min( oldXp + amount, PlayerGetMaxXPPerGen() ) )
player.XPChanged() // network xp change to client, gen can't change here

int newXp = player.GetPersistentVarAsInt( "xp" )
int newLevel = GetLevelForXP( newXp )
if ( newLevel != oldLevel )
Remote_CallFunction_NonReplay( player, "ServerCallback_PlayerLeveledUp", player.GetPersistentVarAsInt( "gen" ), newLevel )
}
}
Expand Up @@ -265,6 +265,8 @@ void function UseBurnCardWeapon( entity weapon, entity player )
PlayerEarnMeter_SetRewardUsed( player )

thread PlayerInventory_PopInventoryItem( player )

UpdatePlayerStat( player, "misc_stats", "boostsActivated" )
}

void function UseBurnCardWeaponInCriticalSection( entity weapon, entity ownerPlayer )
Expand Down
45 changes: 45 additions & 0 deletions Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut
Expand Up @@ -422,6 +422,40 @@ void function Evac( int evacTeam, float initialWait, float arrivalTime, float wa
foreach ( entity otherPlayer in GetPlayerArray() )
Remote_CallFunction_NonReplay( otherPlayer, "ServerCallback_EvacObit", player.GetEncodedEHandle() )
}

// award player score to evacing team
int evacCount = 0
array<entity> evacingPlayers = GetPlayerArrayOfTeam( dropship.GetTeam() ) // all players that are supposed to evac in the dropship

// count how many players are in the dropship
foreach ( entity player in evacingPlayers )
{
if ( !PlayerInDropship( player, dropship ) )
continue

evacCount++
}

bool allEvac = evacCount == evacingPlayers.len()

foreach(entity player in evacingPlayers)
{
if ( !PlayerInDropship( player, dropship ) )
continue

AddPlayerScore( player, "HotZoneExtract" )
UpdatePlayerStat( player, "misc_stats", "evacsSurvived" )

if ( allEvac )
AddPlayerScore( player, "TeamBonusFullEvac" )
}

// sole survivor (but not the only one on the team)
if ( evacCount == 1 && !allEvac )
{
// we can assume there is one player in the array because otherwise evacCount wouldn't be 1
AddPlayerScore( evacingPlayers[0], "SoleSurvivor" )
}
}

void function AddPlayerToEvacDropship( entity dropship, entity player )
Expand All @@ -442,6 +476,8 @@ void function AddPlayerToEvacDropship( entity dropship, entity player )
if ( !PlayerInDropship( player, dropship ) )
return

UpdatePlayerStat( player, "misc_stats", "evacsAttempted" )

// need to cancel if the dropship dies
dropship.EndSignal( "OnDeath", "OnDestroy" )

Expand Down Expand Up @@ -507,6 +543,15 @@ void function CheckIfAnyPlayerLeft( int evacTeam )
SetTeamActiveObjective( evacTeam, "EG_DropshipExtractEvacPlayersKilled" )
SetTeamActiveObjective( GetOtherTeam( evacTeam ), "EG_StopExtractEvacPlayersKilled" )
thread EvacEpilogueCompleted( null )

// score for killing the entire evacing team
foreach ( entity player in GetPlayerArray() )
{
if ( player.GetTeam() == evacTeam )
continue
ASpoonPlaysGames marked this conversation as resolved.
Show resolved Hide resolved

AddPlayerScore( player, "TeamBonusKilledAll")
}
}
)
while( true )
Expand Down
3 changes: 3 additions & 0 deletions Northstar.CustomServers/mod/scripts/vscripts/faction_xp.gnut
Expand Up @@ -3,8 +3,11 @@ global function AddFactionXP
void function AddFactionXP( entity player, int amount )
{
string faction = GetFactionChoice( player )
int oldLevel = FactionGetLevel( player, faction )
// increment xp
player.SetPersistentVar( "factionXP[" + faction + "]", min( FactionGetXP( player, faction ) + amount, FactionGetMaxXP( faction ) ) )

// note: no notif for faction level up
if ( FactionGetLevel( player, faction ) != oldLevel )
ASpoonPlaysGames marked this conversation as resolved.
Show resolved Hide resolved
AddPlayerScore( player, "FactionLevelUp" )
}
12 changes: 12 additions & 0 deletions Northstar.CustomServers/mod/scripts/vscripts/lobby/_lobby.gnut
Expand Up @@ -14,6 +14,7 @@ void function Lobby_Init()
{
// non-private lobby clientcommands
AddClientCommandCallback( "StartPrivateMatchSearch", ClientCommandCallback_StartPrivateMatchSearch )
AddClientCommandCallback( "SetAnnouncementVersionSeen", ClientCommandCallback_SetAnnouncementVersionSeen )
}
}

Expand All @@ -37,3 +38,14 @@ bool function ClientCommandCallback_StartPrivateMatchSearch( entity player, arra

return true
}

bool function ClientCommandCallback_SetAnnouncementVersionSeen( entity player, array<string> args )
{
if ( args.len() < 1 )
return false

int version = int( args[0] )

player.SetPersistentVar( "announcementVersionSeen", version )
return true
}
Expand Up @@ -134,6 +134,15 @@ void function CodeCallback_OnClientConnectionCompleted( entity player )
Lobby_OnClientConnectionCompleted( player )
return
}
else if ( !IsFDMode( GAMETYPE ) )
{
// reset this for non-fd modes
// for some reason the postgame scoreboard uses this to
// determine if it should show the FD aegis rank one
// FD should either set this in their own mode, or add an else
// to this if statement when it releases
uniboi marked this conversation as resolved.
Show resolved Hide resolved
player.SetPersistentVar( "lastFDTitanRef", "" )
}

player.hasConnected = true

Expand Down
Expand Up @@ -58,7 +58,9 @@ void function CodeCallback_MatchIsOver()
#if MP
void function PopulatePostgameData()
{
// something's busted here because this isn't showing automatically on match end, ag
// show the postgame scoreboard summary
SetUIVar( level, "showGameSummary", true )

foreach ( entity player in GetPlayerArray() )
{
int teams = GetCurrentPlaylistVarInt( "max_teams", 2 )
Expand Down
Expand Up @@ -800,6 +800,8 @@ void function SetWinner( int team, string winningReason = "", string losingReaso
}
else
SetGameState( eGameState.WinnerDetermined )

ScoreEvent_MatchComplete( team )
}
}

Expand Down