From c0f21bfafabcf92f6300f85adc414eeb19862e90 Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Sat, 1 Jan 2022 23:29:20 +0000 Subject: add the ability to disable inter-pilot collision --- .../northstar_client_localisation_english.txt | Bin 20116 -> 20212 bytes Northstar.Custom/mod.json | 12 ++++++++ .../vscripts/sh_custom_pilot_collision.gnut | 32 +++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 Northstar.Custom/mod/scripts/vscripts/sh_custom_pilot_collision.gnut diff --git a/Northstar.Client/mod/resource/northstar_client_localisation_english.txt b/Northstar.Client/mod/resource/northstar_client_localisation_english.txt index 49ec746c..f438b0f7 100644 Binary files a/Northstar.Client/mod/resource/northstar_client_localisation_english.txt and b/Northstar.Client/mod/resource/northstar_client_localisation_english.txt differ diff --git a/Northstar.Custom/mod.json b/Northstar.Custom/mod.json index 23132642..7b2ad50d 100644 --- a/Northstar.Custom/mod.json +++ b/Northstar.Custom/mod.json @@ -344,6 +344,18 @@ "ServerCallback": { "After": "DisallowedWeapons_Init" } + }, + + { + "Path": "sh_custom_pilot_collision.gnut", + "RunOn": "( CLIENT || SERVER ) && MP", + "ClientCallback": { + "After": "CustomPilotCollision_InitPlaylistVars" + }, + + "ServerCallback": { + "After": "CustomPilotCollision_InitPlaylistVars" + } } ], diff --git a/Northstar.Custom/mod/scripts/vscripts/sh_custom_pilot_collision.gnut b/Northstar.Custom/mod/scripts/vscripts/sh_custom_pilot_collision.gnut new file mode 100644 index 00000000..b33a4c02 --- /dev/null +++ b/Northstar.Custom/mod/scripts/vscripts/sh_custom_pilot_collision.gnut @@ -0,0 +1,32 @@ +global function CustomPilotCollision_InitPlaylistVars + +void function CustomPilotCollision_InitPlaylistVars() +{ + AddPrivateMatchModeSettingEnum( "#MODE_SETTING_CATEGORY_PILOT", "no_pilot_collision", [ "#SETTING_DISABLED", "#SETTING_ENABLED" ], "0" ) + +#if SERVER + AddCallback_OnPlayerRespawned( SetPilotCollisionFlagsForRespawn ) + AddCallback_OnPilotBecomesTitan( PilotCollisionOnPilotBecomesTitan ) + AddCallback_OnTitanBecomesPilot( PilotCollisionOnTitanBecomesPilot ) +#endif +} + +#if SERVER +void function SetPilotCollisionFlagsForRespawn( entity player ) +{ + if ( GetCurrentPlaylistVarInt( "no_pilot_collision", 0 ) == 1 ) + player.kv.CollisionGroup = TRACE_COLLISION_GROUP_BLOCK_WEAPONS +} + +void function PilotCollisionOnPilotBecomesTitan( entity player, entity titan ) +{ + if ( GetCurrentPlaylistVarInt( "no_pilot_collision", 0 ) == 1 ) + player.kv.CollisionGroup = TRACE_COLLISION_GROUP_PLAYER +} + +void function PilotCollisionOnTitanBecomesPilot( entity player, entity titan ) +{ + if ( GetCurrentPlaylistVarInt( "no_pilot_collision", 0 ) == 1 ) + player.kv.CollisionGroup = TRACE_COLLISION_GROUP_BLOCK_WEAPONS +} +#endif \ No newline at end of file -- cgit v1.2.3