aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-05 23:28:38 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-05 23:28:38 +0000
commitf1a07e1b01923b45f7a82c063d25b8dea5b13d53 (patch)
tree265a20be313fbdc054887c5be3d78797cbd6e707 /Northstar.CustomServers/mod/scripts/vscripts
parent51e16034230f4dd759900c7922b8db43941e0a70 (diff)
downloadNorthstarMods-f1a07e1b01923b45f7a82c063d25b8dea5b13d53.tar.gz
NorthstarMods-f1a07e1b01923b45f7a82c063d25b8dea5b13d53.zip
fixes from playtest
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut8
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_featured_mode_settings.gnut122
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_hardpoints.gnut2
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut9
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_playlist.gnut117
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut7
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/spawn.nut2
7 files changed, 136 insertions, 131 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut b/Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut
index d84ab873..9a7e89e2 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut
@@ -94,9 +94,11 @@ void function EvacEpilogueSetup()
void function EvacEpilogue()
{
- // make sure we don't run this on ffa modes if no epilogue was specified, since evac is default epilogue
- if ( GetCurrentPlaylistVarInt( "max_teams", 2 ) == 2 )
- thread Evac( GetOtherTeam( GetWinningTeam() ), EVAC_INITIAL_WAIT, EVAC_ARRIVAL_TIME, EVAC_WAIT_TIME, EvacEpiloguePlayerCanBoard, EvacEpilogueShouldLeaveEarly, EvacEpilogueCompleted )
+ int winner = GetWinningTeam()
+
+ // make sure we don't run this on ffa modes if no epilogue was specified or it won't work for current gamestate, since evac is default epilogue
+ if ( GetCurrentPlaylistVarInt( "max_teams", 2 ) == 2 && ( winner == TEAM_MILITIA || winner == TEAM_IMC ) )
+ thread Evac( GetOtherTeam( winner ), EVAC_INITIAL_WAIT, EVAC_ARRIVAL_TIME, EVAC_WAIT_TIME, EvacEpiloguePlayerCanBoard, EvacEpilogueShouldLeaveEarly, EvacEpilogueCompleted )
else
thread EvacEpilogueCompleted( null ) // this is hacky but like, this also shouldn't really be hit in normal gameplay
}
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_featured_mode_settings.gnut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_featured_mode_settings.gnut
deleted file mode 100644
index 62fd52c9..00000000
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_featured_mode_settings.gnut
+++ /dev/null
@@ -1,122 +0,0 @@
-untyped
-global function FeaturedModeSettings_Init
-
-void function FeaturedModeSettings_Init()
-{
- // if it's not super obvious at a glance this script is used for playlist vars with the prefix "featured_mode_"
- // these often set loadouts and shit so they need a script
- // note: for turbo_titans, the core multiplier is set in playlist
-
- AddCallback_OnPlayerRespawned( FeaturedModeSettingsSetupPilotLoadouts )
- AddCallback_OnPilotBecomesTitan( FeaturedModeSettingsSetupTitanLoadouts )
-}
-
-bool function IsFeaturedMode( string modeName )
-{
- return GetCurrentPlaylistVar( "featured_mode_" + modeName ) == "1"
-}
-
-void function FeaturedModeSettingsSetupPilotLoadouts( entity player )
-{
- bool shouldChangeLoadout = false
-
- // create loadout struct
- PilotLoadoutDef modifiedLoadout = clone GetActivePilotLoadout( player )
-
- if ( IsFeaturedMode( "all_holopilot" ) )
- {
- shouldChangeLoadout = true
-
- modifiedLoadout.special = "mp_ability_holopilot"
- }
-
- if ( IsFeaturedMode( "all_grapple" ) )
- {
- shouldChangeLoadout = true
-
- modifiedLoadout.special = "mp_ability_grapple"
- modifiedLoadout.specialMods = [ "all_grapple" ]
- }
-
- if ( IsFeaturedMode( "all_phase" ) )
- {
- shouldChangeLoadout = true
-
- modifiedLoadout.special = "mp_ability_shifter"
- modifiedLoadout.specialMods = [ "all_phase" ]
- }
-
- if ( IsFeaturedMode( "all_ticks" ) )
- {
- shouldChangeLoadout = true
-
- modifiedLoadout.ordnance = "mp_weapon_frag_drone"
- modifiedLoadout.ordnanceMods = [ "all_ticks" ]
- }
-
- if ( IsFeaturedMode( "rocket_arena" ) )
- {
- // this crashes sometimes for some reason
-
- shouldChangeLoadout = true
-
- modifiedLoadout.primary = "mp_weapon_epg"
- modifiedLoadout.primaryMods = [ "rocket_arena" ]
-
- // set secondary to whatever one is pistol
- if ( GetWeaponInfoFileKeyField_Global( player.GetMainWeapons()[ 1 ].GetWeaponClassName(), "menu_category" ) == "at" )
- {
- modifiedLoadout.weapon3 = "mp_weapon_autopistol"
- modifiedLoadout.weapon3Mods = [ "rocket_arena" ]
- }
- else
- {
- modifiedLoadout.secondary = "mp_weapon_autopistol"
- modifiedLoadout.secondaryMods = [ "rocket_arena" ]
- }
-
- player.GiveExtraWeaponMod( "rocket_arena" )
- }
-
- if ( IsFeaturedMode( "shotguns_snipers" ) )
- {
-
- shouldChangeLoadout = true
-
- // this one was never released, assuming it just gives you a mastiff and a kraber with quick swap
- modifiedLoadout.primary = "mp_weapon_sniper"
- modifiedLoadout.primaryMods = [ "pas_fast_swap", "pas_fast_ads" ]
-
- // set secondary to whatever one is pistol
- if ( GetWeaponInfoFileKeyField_Global( player.GetMainWeapons()[ 1 ].GetWeaponClassName(), "menu_category" ) == "at" )
- {
- modifiedLoadout.weapon3 = "mp_weapon_mastiff"
- modifiedLoadout.weapon3Mods = [ "pas_fast_swap", "pas_run_and_gun" ]
- }
- else
- {
- modifiedLoadout.secondary = "mp_weapon_mastiff"
- modifiedLoadout.secondaryMods = [ "pas_fast_swap", "pas_run_and_gun" ]
- }
- }
-
- // dont wanna give a new loadout if it's not necessary, could break other callbacks
- if ( shouldChangeLoadout )
- GivePilotLoadout( player, modifiedLoadout )
-
- if ( IsFeaturedMode( "tactikill" ) )
- player.GiveExtraWeaponMod( "tactical_cdr_on_kill" )
-
- if ( IsFeaturedMode( "amped_tacticals" ) )
- player.GiveExtraWeaponMod( "amped_tacticals" )
-}
-
-void function FeaturedModeSettingsSetupTitanLoadouts( entity player, entity titan )
-{
- if ( IsFeaturedMode( "turbo_titans" ) )
- {
- array<string> settingsMods = player.GetPlayerSettingsMods()
- settingsMods.append( "turbo_titan" )
- player.SetPlayerSettingsWithMods( player.GetPlayerSettings(), settingsMods )
- }
-} \ No newline at end of file
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_hardpoints.gnut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_hardpoints.gnut
index 0a32f133..8331a81a 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_hardpoints.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_hardpoints.gnut
@@ -11,7 +11,7 @@ global function CapturePoint_GetGoalProgress
void function Hardpoints_Init()
{
-
+ RegisterSignal( "StopHardpointBehavior" )
}
float function CapturePoint_GetStartProgress( entity hardpoint )
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
index 4263eb1a..e3b252f7 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
@@ -314,7 +314,7 @@ void function GameStateEnter_WinnerDetermined_Threaded()
if ( killcamsWereEnabled )
SetKillcamsEnabled( true )
}
- else
+ else if ( IsRoundBased() || !ClassicMP_ShouldRunEpilogue() )
{
// these numbers are temp and should really be based on consts of some kind
foreach( entity player in GetPlayerArray() )
@@ -650,8 +650,11 @@ void function CleanUpEntitiesForRoundEnd()
}
foreach ( entity npc in GetNPCArray() )
- if ( IsAlive( npc ) )
- npc.Die() // need this because getnpcarray includes the pettitans we just killed at this point
+ if ( IsValid( npc ) )
+ npc.Destroy() // need this because getnpcarray includes the pettitans we just killed at this point
+
+ foreach ( entity weapon in GetEntArrayByClass_Expensive( "weaponx" ) )
+ weapon.Destroy()
// allow other scripts to clean stuff up too
svGlobal.levelEnt.Signal( "CleanUpEntitiesForRoundEnd" )
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_playlist.gnut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_playlist.gnut
index dfceab41..0d610e37 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_playlist.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_playlist.gnut
@@ -1,6 +1,123 @@
+untyped
global function Playlist_Init
void function Playlist_Init()
{
+ // featured mode settings
+ AddCallback_OnPlayerRespawned( FeaturedModeSettingsSetupPilotLoadouts )
+ AddCallback_OnPilotBecomesTitan( FeaturedModeSettingsSetupTitanLoadouts )
+
+ // iron lts rules
+ if ( HasIronRules() )
+ Riff_ForceTitanExitEnabled( eTitanExitEnabled.Never )
+}
+bool function IsFeaturedMode( string modeName )
+{
+ return GetCurrentPlaylistVar( "featured_mode_" + modeName ) == "1"
+}
+
+void function FeaturedModeSettingsSetupPilotLoadouts( entity player )
+{
+ bool shouldChangeLoadout = false
+
+ // create loadout struct
+ PilotLoadoutDef modifiedLoadout = clone GetActivePilotLoadout( player )
+
+ if ( IsFeaturedMode( "all_holopilot" ) )
+ {
+ shouldChangeLoadout = true
+
+ modifiedLoadout.special = "mp_ability_holopilot"
+ }
+
+ if ( IsFeaturedMode( "all_grapple" ) )
+ {
+ shouldChangeLoadout = true
+
+ modifiedLoadout.special = "mp_ability_grapple"
+ modifiedLoadout.specialMods = [ "all_grapple" ]
+ }
+
+ if ( IsFeaturedMode( "all_phase" ) )
+ {
+ shouldChangeLoadout = true
+
+ modifiedLoadout.special = "mp_ability_shifter"
+ modifiedLoadout.specialMods = [ "all_phase" ]
+ }
+
+ if ( IsFeaturedMode( "all_ticks" ) )
+ {
+ shouldChangeLoadout = true
+
+ modifiedLoadout.ordnance = "mp_weapon_frag_drone"
+ modifiedLoadout.ordnanceMods = [ "all_ticks" ]
+ }
+
+ if ( IsFeaturedMode( "rocket_arena" ) )
+ {
+ // this crashes sometimes for some reason
+
+ shouldChangeLoadout = true
+
+ modifiedLoadout.primary = "mp_weapon_epg"
+ modifiedLoadout.primaryMods = [ "rocket_arena" ]
+
+ // set secondary to whatever one is pistol
+ if ( GetWeaponInfoFileKeyField_Global( player.GetMainWeapons()[ 1 ].GetWeaponClassName(), "menu_category" ) == "at" )
+ {
+ modifiedLoadout.weapon3 = "mp_weapon_autopistol"
+ modifiedLoadout.weapon3Mods = [ "rocket_arena" ]
+ }
+ else
+ {
+ modifiedLoadout.secondary = "mp_weapon_autopistol"
+ modifiedLoadout.secondaryMods = [ "rocket_arena" ]
+ }
+
+ player.GiveExtraWeaponMod( "rocket_arena" )
+ }
+
+ if ( IsFeaturedMode( "shotguns_snipers" ) )
+ {
+
+ shouldChangeLoadout = true
+
+ // this one was never released, assuming it just gives you a mastiff and a kraber with quick swap
+ modifiedLoadout.primary = "mp_weapon_sniper"
+ modifiedLoadout.primaryMods = [ "pas_fast_swap", "pas_fast_ads" ]
+
+ // set secondary to whatever one is pistol
+ if ( GetWeaponInfoFileKeyField_Global( player.GetMainWeapons()[ 1 ].GetWeaponClassName(), "menu_category" ) == "at" )
+ {
+ modifiedLoadout.weapon3 = "mp_weapon_mastiff"
+ modifiedLoadout.weapon3Mods = [ "pas_fast_swap", "pas_run_and_gun" ]
+ }
+ else
+ {
+ modifiedLoadout.secondary = "mp_weapon_mastiff"
+ modifiedLoadout.secondaryMods = [ "pas_fast_swap", "pas_run_and_gun" ]
+ }
+ }
+
+ // dont wanna give a new loadout if it's not necessary, could break other callbacks
+ if ( shouldChangeLoadout )
+ GivePilotLoadout( player, modifiedLoadout )
+
+ if ( IsFeaturedMode( "tactikill" ) )
+ player.GiveExtraWeaponMod( "tactical_cdr_on_kill" )
+
+ if ( IsFeaturedMode( "amped_tacticals" ) )
+ player.GiveExtraWeaponMod( "amped_tacticals" )
+}
+
+void function FeaturedModeSettingsSetupTitanLoadouts( entity player, entity titan )
+{
+ if ( IsFeaturedMode( "turbo_titans" ) )
+ {
+ array<string> settingsMods = player.GetPlayerSettingsMods()
+ settingsMods.append( "turbo_titan" )
+ player.SetPlayerSettingsWithMods( player.GetPlayerSettings(), settingsMods )
+ }
} \ No newline at end of file
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut
index 3421419c..39940769 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut
@@ -188,7 +188,12 @@ void function ScoreEvent_TitanKilled( entity victim, entity attacker, var damage
void function ScoreEvent_NPCKilled( entity victim, entity attacker, var damageInfo )
{
- AddPlayerScore( attacker, ScoreEventForNPCKilled( victim, damageInfo ), victim )
+ try
+ {
+ // have to trycatch this because marvins will crash on kill if we dont
+ AddPlayerScore( attacker, ScoreEventForNPCKilled( victim, damageInfo ), victim )
+ }
+ catch ( ex ) {}
}
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/spawn.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/spawn.nut
index b72e660e..1766a216 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/spawn.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/spawn.nut
@@ -273,7 +273,7 @@ bool function IsSpawnpointValid( entity spawnpoint, int team )
continue
// check distance, constant here is basically arbitrary
- if ( Distance( enemyPlayer, spawnpoint ) > 1000.0 )
+ if ( Distance( enemyPlayer.GetOrigin(), spawnpoint.GetOrigin() ) > 1000.0 )
continue
// check fov, constant here is stolen from every other place this is done