aboutsummaryrefslogtreecommitdiff
path: root/Northstar.Custom/mod
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-01-01 23:29:20 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-01-01 23:29:20 +0000
commitc0f21bfafabcf92f6300f85adc414eeb19862e90 (patch)
treef14f13f22479fcd76ae4038a8365101ffa73cf0c /Northstar.Custom/mod
parent4b07c01ff192ffb492359509babd8eedc554ea85 (diff)
downloadNorthstarMods-c0f21bfafabcf92f6300f85adc414eeb19862e90.tar.gz
NorthstarMods-c0f21bfafabcf92f6300f85adc414eeb19862e90.zip
add the ability to disable inter-pilot collision
Diffstat (limited to 'Northstar.Custom/mod')
-rw-r--r--Northstar.Custom/mod/scripts/vscripts/sh_custom_pilot_collision.gnut32
1 files changed, 32 insertions, 0 deletions
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