diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-01-01 23:29:20 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-01-01 23:29:20 +0000 |
commit | c0f21bfafabcf92f6300f85adc414eeb19862e90 (patch) | |
tree | f14f13f22479fcd76ae4038a8365101ffa73cf0c | |
parent | 4b07c01ff192ffb492359509babd8eedc554ea85 (diff) | |
download | NorthstarMods-c0f21bfafabcf92f6300f85adc414eeb19862e90.tar.gz NorthstarMods-c0f21bfafabcf92f6300f85adc414eeb19862e90.zip |
add the ability to disable inter-pilot collision
-rw-r--r-- | Northstar.Client/mod/resource/northstar_client_localisation_english.txt | bin | 20116 -> 20212 bytes | |||
-rw-r--r-- | Northstar.Custom/mod.json | 12 | ||||
-rw-r--r-- | Northstar.Custom/mod/scripts/vscripts/sh_custom_pilot_collision.gnut | 32 |
3 files changed, 44 insertions, 0 deletions
diff --git a/Northstar.Client/mod/resource/northstar_client_localisation_english.txt b/Northstar.Client/mod/resource/northstar_client_localisation_english.txt Binary files differindex 49ec746c..f438b0f7 100644 --- a/Northstar.Client/mod/resource/northstar_client_localisation_english.txt +++ b/Northstar.Client/mod/resource/northstar_client_localisation_english.txt 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 |