From 98b2de50edc53fbe62517c684650eaac94347e21 Mon Sep 17 00:00:00 2001 From: LightBlueCube <115393812+LightBlueCube@users.noreply.github.com> Date: Fri, 6 Sep 2024 09:33:16 +0800 Subject: [PATCH 1/5] use ArrayRemoveInvalid replace removebyvalue( null ) --- .../mod/scripts/vscripts/gamemodes/_gamemode_fw.nut | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fw.nut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fw.nut index fa66c2f71..783996727 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fw.nut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fw.nut @@ -459,7 +459,7 @@ bool function TryFWTerritoryDialogue( entity territory, entity player ) // the territory trigger will only save players and titans array allEntsInside = GetAllEntitiesInTrigger( territory ) - allEntsInside.removebyvalue( null ) // since we're using a fake trigger, need to check this + ArrayRemoveInvalid( allEntsInside ) // since we're using a fake trigger, need to check this array friendliesInside // this means territory's friendly team array enemiesInside // this means territory's enemy team array enemyTitansInside @@ -1342,8 +1342,8 @@ void function FWAreaThreatLevelThink_Threaded() // check threats array imcEntArray = GetAllEntitiesInTrigger( imcTerritory ) array mltEntArray = GetAllEntitiesInTrigger( mltTerritory ) - imcEntArray.removebyvalue( null ) // since we're using a fake trigger, need to check this - mltEntArray.removebyvalue( null ) + ArrayRemoveInvalid( imcEntArray ) // since we're using a fake trigger, need to check this + ArrayRemoveInvalid( mltEntArray ) foreach( entity ent in imcEntArray ) { //print( ent ) From 4b5228d2b1c6b6c2bb87d68b0509670c3b306a38 Mon Sep 17 00:00:00 2001 From: LightBlueCube <115393812+LightBlueCube@users.noreply.github.com> Date: Fri, 6 Sep 2024 09:57:22 +0800 Subject: [PATCH 2/5] let harvester can be hurt by melee damage --- .../mod/scripts/vscripts/gamemodes/_gamemode_fw.nut | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fw.nut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fw.nut index 783996727..76874499a 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fw.nut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fw.nut @@ -1752,6 +1752,7 @@ void function FW_createHarvester() fw_harvesterImc.harvester.Minimap_SetHeightTracking( true ) fw_harvesterImc.harvester.Minimap_SetZOrder( MINIMAP_Z_OBJECT ) fw_harvesterImc.harvester.Minimap_SetCustomState( eMinimapObject_prop_script.FD_HARVESTER ) + SetObjectCanBeMeleed( fw_harvesterImc.harvester, true ) AddEntityCallback_OnFinalDamaged( fw_harvesterImc.harvester, OnHarvesterDamaged ) AddEntityCallback_OnPostDamaged( fw_harvesterImc.harvester, OnHarvesterPostDamaged ) @@ -1778,6 +1779,7 @@ void function FW_createHarvester() fw_harvesterMlt.harvester.Minimap_SetHeightTracking( true ) fw_harvesterMlt.harvester.Minimap_SetZOrder( MINIMAP_Z_OBJECT ) fw_harvesterMlt.harvester.Minimap_SetCustomState( eMinimapObject_prop_script.FD_HARVESTER ) + SetObjectCanBeMeleed( fw_harvesterMlt.harvester, true ) AddEntityCallback_OnFinalDamaged( fw_harvesterMlt.harvester, OnHarvesterDamaged ) AddEntityCallback_OnPostDamaged( fw_harvesterMlt.harvester, OnHarvesterPostDamaged ) From 0a33165960e612eb5fa764db546627d7698af884 Mon Sep 17 00:00:00 2001 From: LightBlueCube <115393812+LightBlueCube@users.noreply.github.com> Date: Fri, 6 Sep 2024 10:19:03 +0800 Subject: [PATCH 3/5] override mp_thaw intro spawnpoint, due to player can stucked on sky --- .../mod/scripts/vscripts/gamemodes/_gamemode_fw.nut | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fw.nut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fw.nut index 76874499a..d5910562b 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fw.nut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fw.nut @@ -124,6 +124,10 @@ void function GamemodeFW_Init() // _battery_port.gnut needs this RegisterSignal( "BatteryActivate" ) + // mp_thaw's intro spawnpoint have some problem, player can be stucked on the sky, so override it + if( GetMapName() == "mp_thaw" ) + SetSpawnpointGamemodeOverride( TEAM_DEATHMATCH ) + AiGameModes_SetNPCWeapons( "npc_soldier", [ "mp_weapon_rspn101", "mp_weapon_dmr", "mp_weapon_r97", "mp_weapon_lmg" ] ) AiGameModes_SetNPCWeapons( "npc_spectre", [ "mp_weapon_hemlok_smg", "mp_weapon_doubletake", "mp_weapon_mastiff" ] ) From 1ac19bd5f56add0c240ee550e88d87e2ceb5d6af Mon Sep 17 00:00:00 2001 From: LightBlueCube <115393812+LightBlueCube@users.noreply.github.com> Date: Fri, 6 Sep 2024 10:38:40 +0800 Subject: [PATCH 4/5] fix wrong calculate --- .../mod/scripts/vscripts/gamemodes/_gamemode_fw.nut | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fw.nut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fw.nut index d5910562b..f1591b56b 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fw.nut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fw.nut @@ -2322,7 +2322,7 @@ function FW_UseBattery( batteryPortvar, playervar ) //actually void function( en if( turretReplaced || teamChanged ) // replaced/hacked turret will spawn with 50% health newHealth = int ( turret.GetMaxHealth() * GetCurrentPlaylistVarFloat( "fw_turret_hacked_health", TURRET_HACKED_HEALTH_PERCENTAGE ) ) // restore turret shield - int newShield = int ( min( turret.GetShieldHealthMax(), turret.GetShieldHealth() + ( turret.GetShieldHealth() * GetCurrentPlaylistVarFloat( "fw_turret_fixed_shield", TURRET_FIXED_SHIELD_PERCENTAGE ) ) ) ) + int newShield = int ( min( turret.GetShieldHealthMax(), turret.GetShieldHealth() + ( turret.GetShieldHealthMax() * GetCurrentPlaylistVarFloat( "fw_turret_fixed_shield", TURRET_FIXED_SHIELD_PERCENTAGE ) ) ) ) if( turretReplaced || teamChanged ) // replaced/hacked turret will spawn with 50% shield newShield = int ( turret.GetShieldHealthMax() * GetCurrentPlaylistVarFloat( "fw_turret_hacked_shield", TURRET_HACKED_SHIELD_PERCENTAGE ) ) // only do team score event if turret's shields down, encourage players to hack more turrets From ee090cd10aa317918b05beb1bbac5f2878a79d06 Mon Sep 17 00:00:00 2001 From: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> Date: Sat, 7 Sep 2024 23:55:07 +0100 Subject: [PATCH 5/5] Apply suggestions from code review --- .../mod/scripts/vscripts/gamemodes/_gamemode_fw.nut | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fw.nut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fw.nut index f1591b56b..562220876 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fw.nut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fw.nut @@ -125,7 +125,7 @@ void function GamemodeFW_Init() RegisterSignal( "BatteryActivate" ) // mp_thaw's intro spawnpoint have some problem, player can be stucked on the sky, so override it - if( GetMapName() == "mp_thaw" ) + if ( GetMapName() == "mp_thaw" ) SetSpawnpointGamemodeOverride( TEAM_DEATHMATCH ) AiGameModes_SetNPCWeapons( "npc_soldier", [ "mp_weapon_rspn101", "mp_weapon_dmr", "mp_weapon_r97", "mp_weapon_lmg" ] ) @@ -2322,7 +2322,7 @@ function FW_UseBattery( batteryPortvar, playervar ) //actually void function( en if( turretReplaced || teamChanged ) // replaced/hacked turret will spawn with 50% health newHealth = int ( turret.GetMaxHealth() * GetCurrentPlaylistVarFloat( "fw_turret_hacked_health", TURRET_HACKED_HEALTH_PERCENTAGE ) ) // restore turret shield - int newShield = int ( min( turret.GetShieldHealthMax(), turret.GetShieldHealth() + ( turret.GetShieldHealthMax() * GetCurrentPlaylistVarFloat( "fw_turret_fixed_shield", TURRET_FIXED_SHIELD_PERCENTAGE ) ) ) ) + int newShield = int( min( turret.GetShieldHealthMax(), turret.GetShieldHealth() + ( turret.GetShieldHealthMax() * GetCurrentPlaylistVarFloat( "fw_turret_fixed_shield", TURRET_FIXED_SHIELD_PERCENTAGE ) ) ) ) if( turretReplaced || teamChanged ) // replaced/hacked turret will spawn with 50% shield newShield = int ( turret.GetShieldHealthMax() * GetCurrentPlaylistVarFloat( "fw_turret_hacked_shield", TURRET_HACKED_SHIELD_PERCENTAGE ) ) // only do team score event if turret's shields down, encourage players to hack more turrets