From a7df0676bfc21eb9471aa4f486b0383b533a1317 Mon Sep 17 00:00:00 2001 From: x3Karma Date: Thu, 21 Jul 2022 08:30:10 +0800 Subject: Prevent crashing when an NPC titan kills a player or tries to earn score in Attrition (#425) * Small Fix towards Attrition * Update again after having more thoughts --- .../mod/scripts/vscripts/gamemodes/_gamemode_aitdm.nut | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Northstar.CustomServers/mod/scripts') 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 +} -- cgit v1.2.3 From 2cbdc1f6338a77ef64927e07ae356b64d15d6e4d Mon Sep 17 00:00:00 2001 From: Maya Date: Fri, 22 Jul 2022 01:21:11 +0200 Subject: Prevent effect hibernation for dome shields (#415) --- Northstar.CustomServers/mod/scripts/vscripts/_bubble_shield.gnut | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Northstar.CustomServers/mod/scripts') 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 -- cgit v1.2.3 From d9fed6e461c6e19ee488568951bee7064a62baa0 Mon Sep 17 00:00:00 2001 From: GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> Date: Wed, 27 Jul 2022 11:02:41 +0200 Subject: Fix RespawnAsTitan not triggering FirstToFall (#427) Co-authored-by: x3Karma --- .../mod/scripts/vscripts/mp/_base_gametype_mp.gnut | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'Northstar.CustomServers/mod/scripts') 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..05537435 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut @@ -447,7 +447,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 ) -- cgit v1.2.3 From f66c631e7746fefe12e690bcbc8cd15b8d26130b Mon Sep 17 00:00:00 2001 From: DBmaoha <56738369+DBmaoha@users.noreply.github.com> Date: Wed, 3 Aug 2022 05:24:18 +0800 Subject: Added Killer Outline (#470) * Added Killer Outline Added killer outline: highlight the killer after being killed * Changed to _base_gametype_mp.gnut Not using a single script right now * Removed IsNPC() Check Moved inside the if ( IsValid ( attacker ) ) check and removed the attacker.IsNPC() --- Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Northstar.CustomServers/mod/scripts') 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 05537435..b453286c 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 -- cgit v1.2.3 From eeb653546c25282a4c40799d6e4a5da466fc919c Mon Sep 17 00:00:00 2001 From: cat_or_not <41955154+catornot@users.noreply.github.com> Date: Sun, 7 Aug 2022 12:52:44 -0400 Subject: fix DelayedGamemodeAnnouncement (#471) --- Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Northstar.CustomServers/mod/scripts') 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 341493ba..8d859ba6 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut @@ -339,7 +339,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 -- cgit v1.2.3 From 853429f771adac08ebfc07fd2665d865fce46e86 Mon Sep 17 00:00:00 2001 From: GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> Date: Sun, 7 Aug 2022 18:54:35 +0200 Subject: Fix race condition crash when boarding dropship as it explodes (#438) Co-authored-by: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Co-authored-by: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> --- Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Northstar.CustomServers/mod/scripts') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut b/Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut index bce8b4c7..4a21e697 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut @@ -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 ] -- cgit v1.2.3 From fcdbedd671e8c824f626b39a75538df9aff762c0 Mon Sep 17 00:00:00 2001 From: cat_or_not <41955154+catornot@users.noreply.github.com> Date: Thu, 11 Aug 2022 08:15:18 -0400 Subject: adding win achievement (#481) --- Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Northstar.CustomServers/mod/scripts') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut index bfcd23e0..4108d0d9 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 -- cgit v1.2.3 From 1bb3dafd123a4c4df987ac5077f1cec202858be9 Mon Sep 17 00:00:00 2001 From: x3Karma Date: Thu, 11 Aug 2022 21:09:02 +0800 Subject: Swap EVAC_WAIT_TIME to waitTime in _evac.gnut (#482) --- Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Northstar.CustomServers/mod/scripts') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut b/Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut index 4a21e697..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" ) -- cgit v1.2.3 From 052e45547536ed139a5729498461ee242951a4c2 Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Sat, 27 Aug 2022 00:39:25 +0100 Subject: Remove bad loadout validation properties for pilot and titan (#493) --- Northstar.CustomServers/mod/scripts/vscripts/sh_loadouts.nut | 3 --- 1 file changed, 3 deletions(-) (limited to 'Northstar.CustomServers/mod/scripts') 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": -- cgit v1.2.3 From 57c9f05a5fd4f901bd8622829dbee4809990e71a Mon Sep 17 00:00:00 2001 From: GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> Date: Sat, 27 Aug 2022 01:41:47 +0200 Subject: Add alive checks (#491) hotfixes respawn crash exploit Co-authored-by: ScureX --- .../mod/scripts/vscripts/mp/_base_gametype_mp.gnut | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Northstar.CustomServers/mod/scripts') 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 b453286c..ca8dc5f1 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut @@ -427,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 -- cgit v1.2.3 From 7f819ca53f7dea47e7d51f43329a911d4327cecf Mon Sep 17 00:00:00 2001 From: DBmaoha <56738369+DBmaoha@users.noreply.github.com> Date: Sun, 25 Sep 2022 07:48:07 +0800 Subject: Refuse noclipping while player is setparented (#487) * Update _northstar_cheatcommands.nut * Cleaner Check * Apply suggestions --- .../mod/scripts/vscripts/_northstar_cheatcommands.nut | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Northstar.CustomServers/mod/scripts') 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 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" ) -- cgit v1.2.3 From 5ac11bd422a7c65b167633197642106755fd1e68 Mon Sep 17 00:00:00 2001 From: DBmaoha <56738369+DBmaoha@users.noreply.github.com> Date: Wed, 28 Sep 2022 04:12:04 +0800 Subject: Fixed Phase Rewind not Behaving Well (#505) * Fixed Phase Rewind not Behaving Well Phase Rewind will now have a longer distance and mostly won't stuck as It be like in vanilla Map Hack won't show sonar pulse to other players anymore, also be like in vanilla * No need to make last node Specific * Compared vanilla and nearfed vanilla phase rewind don't works so well, I found this one is better * Apply suggestions from code review * little fix for my next pr * Make rewind smoother --- .../mod/scripts/vscripts/burnmeter/_burnmeter.gnut | 72 ++++++++++++++++++---- 1 file changed, 61 insertions(+), 11 deletions(-) (limited to 'Northstar.CustomServers/mod/scripts') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut b/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut index 056f0313..0d189017 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 @@ -221,18 +223,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 ) @@ -407,6 +409,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 @@ -414,9 +420,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 ) @@ -470,18 +473,65 @@ void function PlayerUsesPhaseRewindBurncardThreaded( entity player ) array positions = clone player.p.burnCardPhaseRewindStruct.phaseRetreatSavedPositions + array 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 ) -- cgit v1.2.3 From bcb6b30db6b051776e2585c3d162856b4e9481b3 Mon Sep 17 00:00:00 2001 From: Dinorush <62536724+Dinorush@users.noreply.github.com> Date: Fri, 7 Oct 2022 21:34:03 -0400 Subject: Fix crash when final killcam entity becomes invalid (#516) --- .../mod/scripts/vscripts/mp/_gamestate_mp.nut | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'Northstar.CustomServers/mod/scripts') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut index 4108d0d9..6cde4655 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut @@ -387,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 { -- cgit v1.2.3 From 5edc1b0c98aed20cbd3b3bc429db9c5d17939945 Mon Sep 17 00:00:00 2001 From: DBmaoha <56738369+DBmaoha@users.noreply.github.com> Date: Sat, 8 Oct 2022 18:22:29 +0800 Subject: Added ReaperFall Marks and Reapers' Outlines (#468) * Added ReaperFall Marks and Reapers' Outlines Added red mark for reaperfall points and outline after landing * Fixed RoundEndCleanUp Crash * Better Outline Function --- .../scripts/vscripts/gamemodes/_ai_gamemodes.gnut | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'Northstar.CustomServers/mod/scripts') 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 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 ) { -- cgit v1.2.3 From 118f9414326b0af067ee2a925d052c3ee17e4bef Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Mon, 17 Oct 2022 21:06:48 +0100 Subject: Use refactor's updated miscserverscript defs (#519) --- .../mod/scripts/vscripts/_menu_callbacks.gnut | 6 ++-- .../mod/scripts/vscripts/lobby/_private_lobby.gnut | 36 ++++++++++------------ 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'Northstar.CustomServers/mod/scripts') 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 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/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 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 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 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 args ){ - if( step.find( "mode" ) || step.find( "map" )){ +void function LogPrivateMatchChange( entity player , string step , array 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 -- cgit v1.2.3