aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts
diff options
context:
space:
mode:
authorRoyalBlue1 <realEmail@veryRealURL.com>2022-10-18 02:33:57 +0200
committerRoyalBlue1 <realEmail@veryRealURL.com>2022-10-18 02:33:57 +0200
commit52dab1de818e957c3817548de9bf23c1471172dd (patch)
tree0cfba289dda76c0851a8e8a587f6d0561cbf251a /Northstar.CustomServers/mod/scripts/vscripts
parente32bd27b12d198301e0221a1f4176c854487c6a9 (diff)
parent118f9414326b0af067ee2a925d052c3ee17e4bef (diff)
downloadNorthstarMods-52dab1de818e957c3817548de9bf23c1471172dd.tar.gz
NorthstarMods-52dab1de818e957c3817548de9bf23c1471172dd.zip
Merge remote-tracking branch 'upsteam/main' into gamemode_fd
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/_bubble_shield.gnut3
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/_menu_callbacks.gnut6
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/_northstar_cheatcommands.nut5
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut72
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut12
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_ai_gamemodes.gnut41
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_aitdm.nut6
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut36
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut24
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut16
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut3
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/sh_loadouts.nut3
12 files changed, 179 insertions, 48 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_bubble_shield.gnut b/Northstar.CustomServers/mod/scripts/vscripts/_bubble_shield.gnut
index 30758bec..f09ef957 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/_bubble_shield.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/_bubble_shield.gnut
@@ -223,6 +223,7 @@ entity function CreateBubbleShieldWithSettings( int team, vector origin, vector
entity neutralColoredFX = StartParticleEffectInWorld_ReturnEntity( BUBBLE_SHIELD_FX_PARTICLE_SYSTEM_INDEX, coloredFXOrigin, <0, 0, 0> )
SetTeam( neutralColoredFX, team )
bubbleShieldDotS.neutralColoredFX <- neutralColoredFX
+ neutralColoredFX.DisableHibernation()
bubbleShieldFXs.append( neutralColoredFX )
}
else
@@ -232,11 +233,13 @@ entity function CreateBubbleShieldWithSettings( int team, vector origin, vector
SetTeam( friendlyColoredFX, team )
friendlyColoredFX.kv.VisibilityFlags = ENTITY_VISIBLE_TO_FRIENDLY
EffectSetControlPointVector( friendlyColoredFX, 1, FRIENDLY_COLOR_FX )
+ friendlyColoredFX.DisableHibernation()
entity enemyColoredFX = StartParticleEffectInWorld_ReturnEntity( BUBBLE_SHIELD_FX_PARTICLE_SYSTEM_INDEX, coloredFXOrigin, <0, 0, 0> )
SetTeam( enemyColoredFX, team )
enemyColoredFX.kv.VisibilityFlags = ENTITY_VISIBLE_TO_ENEMY
EffectSetControlPointVector( enemyColoredFX, 1, ENEMY_COLOR_FX )
+ enemyColoredFX.DisableHibernation()
bubbleShieldDotS.friendlyColoredFX <- friendlyColoredFX
bubbleShieldDotS.enemyColoredFX <- enemyColoredFX
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_menu_callbacks.gnut b/Northstar.CustomServers/mod/scripts/vscripts/_menu_callbacks.gnut
index 02be47a4..1092bf2d 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/_menu_callbacks.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/_menu_callbacks.gnut
@@ -9,7 +9,7 @@ void function MenuCallbacks_Init()
bool function ClientCommandCallback_LeaveMatch( entity player, array<string> args )
{
// note: this is imperfect if we have multiple people of the same uid on a server, but that's only a thing in testing
- if ( NSIsPlayerIndexLocalPlayer( player.GetPlayerIndex() ) )
+ if ( NSIsPlayerLocalPlayer( player ) )
{
if ( GetConVarBool( "ns_should_return_to_lobby" ) && GetMapName() != "mp_lobby" )
{
@@ -41,9 +41,11 @@ void function WritePersistenceAndLeaveForLocalPlayerOnly( entity player )
void function WritePersistenceAndLeave( entity player )
{
+ player.EndSignal( "OnDestroy" )
+
// write player persistence before we leave, since leaving player might load local lobby before server writes persistence, so they won't get newest
// not super essential, but a nice qol thing
- NSEarlyWritePlayerIndexPersistenceForLeave( player.GetPlayerIndex() )
+ NSEarlyWritePlayerPersistenceForLeave( player )
while ( NSIsWritingPlayerPersistence() )
WaitFrame()
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_northstar_cheatcommands.nut b/Northstar.CustomServers/mod/scripts/vscripts/_northstar_cheatcommands.nut
index c79265ac..af3dfea5 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/_northstar_cheatcommands.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/_northstar_cheatcommands.nut
@@ -14,6 +14,11 @@ bool function ClientCommandCallbackToggleNoclip( entity player, array<string> ar
{
if ( !GetConVarBool( "sv_cheats" ) )
return true
+ if( player.GetParent() ) // change movetype while setparented will crash the server
+ {
+ print( player + " failed noclipping because the entity is parented" )
+ return true
+ }
print( player + " TOGGLED NOCLIP" )
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut b/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut
index 7ff4bcf8..a8def7b2 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut
@@ -15,8 +15,10 @@ global function InitBurnMeterPersistentData
const float PHASE_REWIND_LENGTH = 2.0
// taken from wraith portal in apex, assuming it's the same as tf2's
-const float PHASE_REWIND_PATH_SNAPSHOT_INTERVAL = 0.1
-const int PHASE_REWIND_MAX_SNAPSHOTS = int( PHASE_REWIND_LENGTH / PHASE_REWIND_PATH_SNAPSHOT_INTERVAL )
+// 0.1 can be too fast for ttf2 scripts
+const float PHASE_REWIND_PATH_SNAPSHOT_INTERVAL = 0.2 // mainly controlled by this const, the higher the rewind path will be longer, assuming this one is like vanilla's
+const int PHASE_REWIND_MAX_SNAPSHOTS = int( PHASE_REWIND_LENGTH / PHASE_REWIND_PATH_SNAPSHOT_INTERVAL ) - 1
+const int PHASE_REWIND_DATA_MAX_POSITIONS = int( PHASE_REWIND_LENGTH * 10 ) + 1 // hardcoded but maybe good
const float AMPED_WEAPONS_LENGTH = 30.0
@@ -222,18 +224,18 @@ void function PhaseRewindLifetime( entity player )
{
PhaseRewindData rewindData
rewindData.origin = player.GetOrigin()
- rewindData.angles = player.GetAngles()
+ rewindData.angles = < 0, player.EyeAngles().y, 0 >
rewindData.velocity = player.GetVelocity()
rewindData.wasInContextAction = player.ContextAction_IsActive()
rewindData.wasCrouched = player.IsCrouched()
- if ( player.p.burnCardPhaseRewindStruct.phaseRetreatSavedPositions.len() >= PHASE_REWIND_MAX_SNAPSHOTS )
+ if ( player.p.burnCardPhaseRewindStruct.phaseRetreatSavedPositions.len() >= PHASE_REWIND_DATA_MAX_POSITIONS )
{
// shift all snapshots left
- for ( int i = 0; i < PHASE_REWIND_MAX_SNAPSHOTS - 1; i++ )
+ for ( int i = 0; i < PHASE_REWIND_DATA_MAX_POSITIONS - 1; i++ )
player.p.burnCardPhaseRewindStruct.phaseRetreatSavedPositions[ i ] = player.p.burnCardPhaseRewindStruct.phaseRetreatSavedPositions[ i + 1 ]
- player.p.burnCardPhaseRewindStruct.phaseRetreatSavedPositions[ PHASE_REWIND_MAX_SNAPSHOTS - 1 ] = rewindData
+ player.p.burnCardPhaseRewindStruct.phaseRetreatSavedPositions[ PHASE_REWIND_DATA_MAX_POSITIONS - 1 ] = rewindData
}
else
player.p.burnCardPhaseRewindStruct.phaseRetreatSavedPositions.append( rewindData )
@@ -409,6 +411,10 @@ void function PlayerUsesMaphackBurncardThreaded( entity player )
entities.extend( GetPlayerDecoyArray() )
IncrementSonarPerTeam( playerTeam )
+
+ if ( IsAlive( player ) ) // only owner can see the pulse
+ Remote_CallFunction_Replay( player, "ServerCallback_SonarPulseFromPosition", player.GetOrigin().x, player.GetOrigin().y, player.GetOrigin().z, SONAR_GRENADE_RADIUS )
+
foreach ( entity ent in entities )
{
if ( !IsValid( ent ) ) // Not sure why we can get invalid entities at this point
@@ -416,9 +422,6 @@ void function PlayerUsesMaphackBurncardThreaded( entity player )
if ( ent.IsPlayer() )
{
- if ( IsAlive( player ) )
- Remote_CallFunction_Replay( ent, "ServerCallback_SonarPulseFromPosition", player.GetOrigin().x, player.GetOrigin().y, player.GetOrigin().z, SONAR_GRENADE_RADIUS )
-
// Map Hack also gives radar on enemies for longer than the sonar duration.
if ( ent.GetTeam() == playerTeam )
thread ScanMinimap( ent, false, MAPHACK_PULSE_DELAY - 0.2 )
@@ -472,18 +475,65 @@ void function PlayerUsesPhaseRewindBurncardThreaded( entity player )
array<PhaseRewindData> positions = clone player.p.burnCardPhaseRewindStruct.phaseRetreatSavedPositions
+ array<PhaseRewindData> tempArray
+ int segment = positions.len() / PHASE_REWIND_MAX_SNAPSHOTS
+ for( int i = 0; i < PHASE_REWIND_MAX_SNAPSHOTS; i++ )
+ {
+ if( positions.len() <= segment * i )
+ break
+ tempArray.append( positions[ segment * i ] )
+ }
+ positions = tempArray
+
+ vector startOrigin = player.GetOrigin()
ViewConeZero( player )
player.HolsterWeapon()
player.SetPredictionEnabled( false )
PhaseShift( player, 0.0, positions.len() * PHASE_REWIND_PATH_SNAPSHOT_INTERVAL * 1.5 )
+ EmitSoundOnEntityOnlyToPlayer( player, player, "pilot_phaserewind_1p" )
+ EmitSoundOnEntityExceptToPlayer( player, player, "pilot_phaserewind_3p" )
for ( int i = positions.len() - 1; i > -1; i-- )
{
- mover.NonPhysicsMoveTo( positions[ i ].origin, PHASE_REWIND_PATH_SNAPSHOT_INTERVAL, 0, 0 )
- mover.NonPhysicsRotateTo( positions[ i ].angles, PHASE_REWIND_PATH_SNAPSHOT_INTERVAL, 0, 0 )
+ // should looks better?
+ float moveTime = PHASE_REWIND_PATH_SNAPSHOT_INTERVAL + 0.1
+ player.SetVelocity( -positions[ i ].velocity )
+ mover.NonPhysicsMoveTo( positions[ i ].origin, moveTime, 0, 0 )
+ mover.NonPhysicsRotateTo( positions[ i ].angles, moveTime, 0, 0 )
wait PHASE_REWIND_PATH_SNAPSHOT_INTERVAL
}
player.SetVelocity( <0, 0, 0> )
+ if( positions[0].wasCrouched )
+ player.SetOrigin( player.GetOrigin() + < 0, 0, 20 > )
+
+ // fix position after rewind
+ PutPhaseRewindedPlayerInSafeSpot( player, 1 )
+}
+
+void function PutPhaseRewindedPlayerInSafeSpot( entity player, int severity )
+{
+ vector baseOrigin = player.GetOrigin()
+
+ if ( PutEntityInSafeSpot( player, player, null, < baseOrigin.x, baseOrigin.y + severity, baseOrigin.z >, baseOrigin ) )
+ return
+
+ if ( PutEntityInSafeSpot( player, player, null, < baseOrigin.x, baseOrigin.y - severity, baseOrigin.z >, baseOrigin ) )
+ return
+
+ if ( PutEntityInSafeSpot( player, player, null, < baseOrigin.x + severity, baseOrigin.y, baseOrigin.z >, baseOrigin ) )
+ return
+
+ if ( PutEntityInSafeSpot( player, player, null, < baseOrigin.x - severity, baseOrigin.y, baseOrigin.z >, baseOrigin ) )
+ return
+
+ if ( PutEntityInSafeSpot( player, player, null, < baseOrigin.x, baseOrigin.y, baseOrigin.z + severity >, baseOrigin ) )
+ return
+
+ if ( PutEntityInSafeSpot( player, player, null, < baseOrigin.x, baseOrigin.y, baseOrigin.z - severity >, baseOrigin ) )
+ return
+
+ return PutPhaseRewindedPlayerInSafeSpot( player, severity + 5 )
+
}
void function PlayerUsesNukeTitanBurncard( entity player )
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut b/Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut
index bce8b4c7..b1d8f6bd 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut
@@ -268,8 +268,8 @@ void function Evac( int evacTeam, float initialWait, float arrivalTime, float wa
thread PlayAnim( dropship, "cd_dropship_rescue_side_idle", evacNode )
// eta until leave
- SetTeamActiveObjective( evacTeam, "EG_DropshipExtract2", Time() + EVAC_WAIT_TIME, file.evacIcon )
- SetTeamActiveObjective( GetOtherTeam( evacTeam ), "EG_StopExtract2", Time() + EVAC_WAIT_TIME, file.evacIcon )
+ SetTeamActiveObjective( evacTeam, "EG_DropshipExtract2", Time() + waitTime, file.evacIcon )
+ SetTeamActiveObjective( GetOtherTeam( evacTeam ), "EG_StopExtract2", Time() + waitTime, file.evacIcon )
// setup evac trigger
entity trigger = CreateEntity( "trigger_cylinder" )
@@ -356,7 +356,6 @@ void function Evac( int evacTeam, float initialWait, float arrivalTime, float wa
foreach ( entity otherPlayer in GetPlayerArray() )
Remote_CallFunction_NonReplay( otherPlayer, "ServerCallback_EvacObit", player.GetEncodedEHandle() )
}
-
}
void function AddPlayerToEvacDropship( entity dropship, entity player )
@@ -376,7 +375,10 @@ void function AddPlayerToEvacDropship( entity dropship, entity player )
// no slots available
if ( !PlayerInDropship( player, dropship ) )
return
-
+
+ // need to cancel if the dropship dies
+ dropship.EndSignal( "OnDeath", "OnDestroy" )
+
player.SetInvulnerable()
player.UnforceCrouch()
player.ForceStand()
@@ -391,7 +393,7 @@ void function AddPlayerToEvacDropship( entity dropship, entity player )
EmitSoundOnEntityOnlyToPlayer( player, player, SHIFTER_START_SOUND_3P )
// should play SHIFTER_START_SOUND_1P when they actually arrive in the ship i think, unsure how this is supposed to be done
PlayPhaseShiftDisappearFX( player )
- waitthread FirstPersonSequence( fp, player, dropship )
+ FirstPersonSequence( fp, player, dropship )
FirstPersonSequenceStruct idleFp
idleFp.firstPersonAnimIdle = EVAC_IDLE_ANIMS_1P[ slot ]
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_ai_gamemodes.gnut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_ai_gamemodes.gnut
index d6d578bb..0fad768c 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_ai_gamemodes.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_ai_gamemodes.gnut
@@ -111,7 +111,16 @@ void function AiGameModes_SpawnDropPod( vector pos, vector rot, int team, string
void function AiGameModes_SpawnReaper( vector pos, vector rot, int team, string aiSettings = "", void functionref( entity reaper ) reaperHandler = null )
{
+ thread Reaper_Spawnpoint( pos, team, 11.2 )
+
+ wait 10
+ // spawn reapers right before it warpfalls, or round_end clean up will crash the game
entity reaper = CreateSuperSpectre( team, pos, rot )
+ // reaper highlight
+ Highlight_SetFriendlyHighlight( reaper, "sp_enemy_pilot" )
+ reaper.Highlight_SetParam( 1, 0, < 3,3,3 > )
+ Highlight_SetEnemyHighlight( reaper, "enemy_titan" )
+
SetSpawnOption_Titanfall( reaper )
SetSpawnOption_Warpfall( reaper )
@@ -125,6 +134,38 @@ void function AiGameModes_SpawnReaper( vector pos, vector rot, int team, string
thread reaperHandler( reaper )
}
+// copied from cl_replacement_titan_hud.gnut
+void function Reaper_Spawnpoint( vector origin, int team, float impactTime, bool hasFriendlyWarning = false )
+{
+ array<entity> targetEffects = []
+ vector surfaceNormal = < 0, 0, 1 >
+
+ int index = GetParticleSystemIndex( $"P_ar_titan_droppoint" )
+
+ if( hasFriendlyWarning )
+ {
+ entity effectFriendly = StartParticleEffectInWorld_ReturnEntity( index, origin, surfaceNormal )
+ SetTeam( effectFriendly, team )
+ EffectSetControlPointVector( effectFriendly, 1, < 128,188,255 > )
+ effectFriendly.kv.VisibilityFlags = ENTITY_VISIBLE_TO_FRIENDLY
+ targetEffects.append( effectFriendly )
+ }
+
+ entity effectEnemy = StartParticleEffectInWorld_ReturnEntity( index, origin, surfaceNormal )
+ SetTeam( effectEnemy, team )
+ EffectSetControlPointVector( effectEnemy, 1, < 255,99,0 > )
+ effectEnemy.kv.VisibilityFlags = ENTITY_VISIBLE_TO_ENEMY
+ targetEffects.append( effectEnemy )
+
+ wait impactTime
+
+ foreach( entity targetEffect in targetEffects )
+ {
+ if ( IsValid( targetEffect ) )
+ EffectStop( targetEffect )
+ }
+}
+
// including aisettings stuff specifically for at bounty titans
void function AiGameModes_SpawnTitan( vector pos, vector rot, int team, string setFile, string aiSettings = "", void functionref( entity titan ) titanHandler = null )
{
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_aitdm.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_aitdm.nut
index 9a94b848..fae778d6 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_aitdm.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_aitdm.nut
@@ -78,6 +78,10 @@ void function HandleScoreEvent( entity victim, entity attacker, var damageInfo )
// Hacked spectre filter
if ( victim.GetOwner() == attacker )
return
+
+ // NPC titans without an owner player will not count towards any team's score
+ if ( attacker.IsNPC() && attacker.IsTitan() && !IsValid( GetPetTitanOwner( attacker ) ) )
+ return
// Split score so we can check if we are over the score max
// without showing the wrong value on client
@@ -507,4 +511,4 @@ void function AITdm_CleanupBoredNPCThread( entity guy )
print( "cleaning up bored npc: " + guy + " from team " + guy.GetTeam() )
guy.Destroy()
-} \ No newline at end of file
+}
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut b/Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut
index c410869e..0a28031a 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut
@@ -38,14 +38,14 @@ void function SetupPrivateMatchUIVarsWhenReady()
bool function ClientCommandCallback_PrivateMatchLaunch( entity player, array<string> args )
{
if ( GetConVarBool( "ns_private_match_only_host_can_start" ) )
- if ( !NSIsPlayerIndexLocalPlayer( player.GetPlayerIndex() ) )
+ if ( !NSIsPlayerLocalPlayer( player ) )
return true
- PlayerChangedTheGame( player , " changed the game state." , args )
+ LogPrivateMatchChange( player , " changed the game state." , args )
if ( file.startState == ePrivateMatchStartState.STARTING )
{
- PlayerChangedTheGame( player , " canceled the game countdown." , args )
+ LogPrivateMatchChange( player , " canceled the game countdown." , args )
// cancel start if we're already mid-countdown
file.startState = ePrivateMatchStartState.READY
@@ -54,7 +54,7 @@ bool function ClientCommandCallback_PrivateMatchLaunch( entity player, array<str
}
else
{
- PlayerChangedTheGame( player , " started the game countdown." , args )
+ LogPrivateMatchChange( player , " started the game countdown." , args )
// start match
file.startState = ePrivateMatchStartState.STARTING
@@ -73,10 +73,10 @@ bool function ClientCommandCallback_PrivateMatchSetMode( entity player, array<st
return true
if ( GetConVarInt( "ns_private_match_only_host_can_change_settings" ) == 2 )
- if ( !NSIsPlayerIndexLocalPlayer( player.GetPlayerIndex() ) )
+ if ( !NSIsPlayerLocalPlayer( player ) )
return true
- PlayerChangedTheGame( player , " changed the mode to " , args )
+ LogPrivateMatchChange( player , " changed the mode to " , args )
// todo: need to verify this value
file.mode = args[0]
@@ -97,10 +97,10 @@ bool function ClientCommandCallback_SetCustomMap( entity player, array<string> a
return true
if ( GetConVarInt( "ns_private_match_only_host_can_change_settings" ) == 2 )
- if ( !NSIsPlayerIndexLocalPlayer( player.GetPlayerIndex() ) )
+ if ( !NSIsPlayerLocalPlayer( player ) )
return true
- PlayerChangedTheGame( player , " changed the map to " , args )
+ LogPrivateMatchChange( player , " changed the map to " , args )
// todo: need to verify this value
file.map = args[0]
@@ -217,10 +217,10 @@ bool function ClientCommandCallback_PrivateMatchSetPlaylistVarOverride( entity p
return true
if ( GetConVarInt( "ns_private_match_only_host_can_change_settings" ) >= 1 )
- if ( !NSIsPlayerIndexLocalPlayer( player.GetPlayerIndex() ) )
+ if ( !NSIsPlayerLocalPlayer( player ) )
return true
- PlayerChangedTheGame( player , " override the setting " , args )
+ LogPrivateMatchChange( player , " override the setting " , args )
bool found = false
foreach ( string category in GetPrivateMatchSettingCategories() )
@@ -244,23 +244,21 @@ bool function ClientCommandCallback_PrivateMatchSetPlaylistVarOverride( entity p
bool function ClientCommandCallback_ResetMatchSettingsToDefault( entity player, array<string> args )
{
if ( GetConVarInt( "ns_private_match_only_host_can_change_settings" ) >= 1 )
- if ( !NSIsPlayerIndexLocalPlayer( player.GetPlayerIndex() ) )
+ if ( !NSIsPlayerLocalPlayer( player ) )
return true
- PlayerChangedTheGame( player , " reset to default" , args )
+ LogPrivateMatchChange( player , " reset to default" , args )
ClearPlaylistVarOverrides()
return true
}
-void function PlayerChangedTheGame( entity player , string step , array<string> args ){
- if( step.find( "mode" ) || step.find( "map" )){
+void function LogPrivateMatchChange( entity player , string step , array<string> args )
+{
+ if( step.find( "mode" ) || step.find( "map" ) )
print( player.GetPlayerName() + step + args[ 0 ] + ".---" + "UID:" +player.GetUID() )
- }
- else if(step.find("setting")){
+ else if ( step.find( "setting" ) )
print( player.GetPlayerName() + step + args[ 0 ] + " to "+ args[ 1 ] + ".---" + "UID:" +player.GetUID() )
- }
- else{
+ else
print( player.GetPlayerName() + step + ".---" + "UID:" + player.GetUID())
- }
} \ No newline at end of file
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 1c53167f..ca8dc5f1 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut
@@ -298,6 +298,9 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga
attackerInfo.attacker.AddToPlayerGameStat( PGS_ASSISTS, 1 )
}
}
+
+ if( attacker.IsPlayer() )
+ Highlight_SetDeathRecapHighlight( attacker, "killer_outline" )
}
player.p.rematchOrigin = player.p.deathOrigin
@@ -424,11 +427,17 @@ void function DecideRespawnPlayer( entity player )
void function RespawnAsPilot( entity player )
{
+ // respawn crash exploit hotfix
+ if(IsAlive( player )) return
+
player.RespawnPlayer( FindSpawnPoint( player, false, ( ShouldStartSpawn( player ) || Flag( "ForceStartSpawn" ) ) && !IsFFAGame() ) )
}
void function RespawnAsTitan( entity player, bool manualPosition = false )
{
+ // respawn crash exploit hotfix
+ if(IsAlive( player )) return
+
player.Signal( "PlayerRespawnStarted" )
player.isSpawning = true
@@ -447,7 +456,20 @@ void function RespawnAsTitan( entity player, bool manualPosition = false )
AddCinematicFlag( player, CE_FLAG_CLASSIC_MP_SPAWNING ) // hide hud
// do titanfall scoreevent
- AddPlayerScore( player, "Titanfall", player )
+ if ( !level.firstTitanfall )
+ {
+ AddPlayerScore( player, "FirstTitanfall", player )
+
+ #if HAS_STATS
+ UpdatePlayerStat( player, "misc_stats", "titanFallsFirst" )
+ #endif
+
+ level.firstTitanfall = true
+ }
+ else
+ {
+ AddPlayerScore( player, "Titanfall", player )
+ }
entity camera = CreateTitanDropCamera( spawnpoint.GetAngles(), < 90, titan.GetAngles().y, 0 > )
camera.SetParent( titan )
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
index bfcd23e0..6cde4655 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
@@ -278,6 +278,9 @@ void function GameStateEnter_WinnerDetermined_Threaded()
Remote_CallFunction_NonReplay( player, "ServerCallback_AnnounceRoundWinner", winningTeam, announcementSubstr, ROUND_WINNING_KILL_REPLAY_SCREEN_FADE_TIME, GameRules_GetTeamScore2( TEAM_MILITIA ), GameRules_GetTeamScore2( TEAM_IMC ) )
else
Remote_CallFunction_NonReplay( player, "ServerCallback_AnnounceWinner", winningTeam, announcementSubstr, ROUND_WINNING_KILL_REPLAY_SCREEN_FADE_TIME )
+
+ if ( player.GetTeam() == winningTeam )
+ UnlockAchievement( player, achievements.MP_WIN )
}
WaitFrame() // wait a frame so other scripts can setup killreplay stuff
@@ -384,11 +387,14 @@ void function PlayerWatchesRoundWinningKillReplay( entity player, float replayLe
player.SetPredictionEnabled( false ) // prediction fucks with replays
entity attacker = file.roundWinningKillReplayAttacker
- player.SetKillReplayDelay( Time() - replayLength, THIRD_PERSON_KILL_REPLAY_ALWAYS )
- player.SetKillReplayInflictorEHandle( attacker.GetEncodedEHandle() )
- player.SetKillReplayVictim( file.roundWinningKillReplayVictim )
- player.SetViewIndex( attacker.GetIndexForEntity() )
- player.SetIsReplayRoundWinning( true )
+ if ( IsValid( attacker ) )
+ {
+ player.SetKillReplayDelay( Time() - replayLength, THIRD_PERSON_KILL_REPLAY_ALWAYS )
+ player.SetKillReplayInflictorEHandle( attacker.GetEncodedEHandle() )
+ player.SetKillReplayVictim( file.roundWinningKillReplayVictim )
+ player.SetViewIndex( attacker.GetIndexForEntity() )
+ player.SetIsReplayRoundWinning( true )
+ }
if ( replayLength >= ROUND_WINNING_KILL_REPLAY_LENGTH_OF_REPLAY - 0.5 ) // only do fade if close to full length replay
{
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut
index bb03f1f5..d0ce4f79 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut
@@ -344,7 +344,8 @@ void function PlayerWatchesWargamesIntro( entity player )
void function DelayedGamemodeAnnouncement( entity player )
{
wait 1.0
- TryGameModeAnnouncement( player )
+ if ( IsValid( player ) && IsAlive( player ) )
+ TryGameModeAnnouncement( player )
}
void function PlaySound_SimPod_DoorShut( entity playerFirstPersonProxy ) // stolen from sp_training
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/sh_loadouts.nut b/Northstar.CustomServers/mod/scripts/vscripts/sh_loadouts.nut
index d15220e4..fbaf9e02 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/sh_loadouts.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/sh_loadouts.nut
@@ -2379,10 +2379,8 @@ bool function IsValidPilotLoadoutProperty( string propertyName )
case "weapon3Mod2":
case "weapon3Mod3":
case "ordnance":
- case "special":
case "passive1":
case "passive2":
- case "melee":
case "skinIndex":
case "camoIndex":
case "primarySkinIndex":
@@ -2403,7 +2401,6 @@ bool function IsValidTitanLoadoutProperty( string propertyName )
{
case "name":
case "titanClass":
- case "setFile":
case "primaryMod":
case "special":
case "antirodeo":