From a1cd08d5b2e8b726391539d2bfc7875dd0a1d20e Mon Sep 17 00:00:00 2001 From: Dinorush <62536724+Dinorush@users.noreply.github.com> Date: Wed, 23 Feb 2022 16:46:44 -0500 Subject: Fixes Kodai + Angel battery spawns (#224) --- .../scripts/vscripts/mp/levels/mp_angel_city.nut | 25 +++++++++++++++++-- .../vscripts/mp/levels/mp_forwardbase_kodai.nut | 28 +++++++++++++++++++++- 2 files changed, 50 insertions(+), 3 deletions(-) (limited to 'Northstar.CustomServers/mod/scripts/vscripts/mp') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_angel_city.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_angel_city.nut index e7cc82241..8b2a40605 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_angel_city.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_angel_city.nut @@ -1,5 +1,15 @@ global function CodeCallback_MapInit +struct { + int batteryIndex = 0 +} file + +const array BATTERY_SPAWNS = [ + < -1444.55, -1108.55, 127 >, // field + < -730, 644, 121 >, // mid + < 535, 2657.67, 119 > // bridge +] + void function CodeCallback_MapInit() { AddEvacNode( CreateScriptRef( < 2527.889893, -2865.360107, 753.002991 >, < 0, -80.54, 0 > ) ) @@ -9,13 +19,24 @@ void function CodeCallback_MapInit() SetEvacSpaceNode( CreateScriptRef( < -1700, -5500, -7600 >, < -3.620642, 270.307129, 0 > ) ) - // todo: also we need to change the powerup spawns on this map, they use a version from an older patch - + // Battery spawns (in LTS/Free Agents) are in old locations, so we move them to the proper locations + AddSpawnCallbackEditorClass( "script_ref", "script_power_up_other", FixBatterySpawns ) + // there are some really busted titan startspawns that are on the fucking other side of the map from where they should be, so we remove them AddSpawnCallback( "info_spawnpoint_titan_start", TrimBadTitanStartSpawns ) AddSpawnCallback( "sky_camera", FixSkycamFog ) } +void function FixBatterySpawns( entity spawn ) +{ + if ( GAMETYPE != LAST_TITAN_STANDING && GAMETYPE != FREE_AGENCY ) + return + + PowerUp powerupDef = GetPowerUpFromItemRef( expect string( spawn.kv.powerUpType ) ) + if ( powerupDef.spawnFunc() ) + spawn.SetOrigin( BATTERY_SPAWNS[file.batteryIndex++] ) +} + void function TrimBadTitanStartSpawns( entity spawn ) { if ( spawn.GetTeam() == TEAM_MILITIA ) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_forwardbase_kodai.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_forwardbase_kodai.nut index 37b891699..345a86d9b 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_forwardbase_kodai.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_forwardbase_kodai.nut @@ -1 +1,27 @@ -//fuck \ No newline at end of file +global function CodeCallback_MapInit + +struct { + int batteryIndex = 0 +} file + +const array BATTERY_SPAWNS = [ + < 3960, 1215.04, 942 >, // cliff + < 31, 462.459, 797 >, // mid + < -4150.21, 693.654, 1123 > // mountain +] + +void function CodeCallback_MapInit() +{ + // Battery spawns (in LTS/Free Agents) are in old locations, so we move them to the proper locations + AddSpawnCallbackEditorClass( "script_ref", "script_power_up_other", FixBatterySpawns ) +} + +void function FixBatterySpawns( entity spawn ) +{ + if ( GAMETYPE != LAST_TITAN_STANDING && GAMETYPE != FREE_AGENCY ) + return + + PowerUp powerupDef = GetPowerUpFromItemRef( expect string( spawn.kv.powerUpType ) ) + if ( powerupDef.spawnFunc() ) + spawn.SetOrigin( BATTERY_SPAWNS[file.batteryIndex++] ) +} \ No newline at end of file -- cgit v1.2.3