From 24b9bfc941fcd84604d040443cc65f70602d920b Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Wed, 12 Jan 2022 01:47:49 +0000 Subject: fix pilot voices --- .../vscripts/conversation/_battle_chatter.gnut | 24 ++++++++++++++++++++-- .../vscripts/conversation/_grunt_chatter_mp.gnut | 2 +- .../vscripts/conversation/_spectre_chatter_mp.gnut | 2 +- 3 files changed, 24 insertions(+), 4 deletions(-) (limited to 'Northstar.CustomServers/mod') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/conversation/_battle_chatter.gnut b/Northstar.CustomServers/mod/scripts/vscripts/conversation/_battle_chatter.gnut index 961816c7c..0fee4f2ce 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/conversation/_battle_chatter.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/conversation/_battle_chatter.gnut @@ -4,14 +4,16 @@ global function TryPlayWeaponBattleChatterLine void function BattleChatter_Init() { - //ShBattleChatter_Init() + AddCallback_OnPlayerGetsNewPilotLoadout( UpdatePlayerVoiceIndex ) } void function PlayBattleChatterLine( entity player, string conversationType ) { + int conversationIndex = GetConversationIndex( conversationType ) + foreach( entity otherPlayer in GetPlayerArray() ) if ( ShouldPlayBattleChatter( conversationType, otherPlayer, player ) && player != otherPlayer ) - Remote_CallFunction_NonReplay( otherPlayer, "ServerCallback_PlayBattleChatter", GetConversationIndex( conversationType ), player.GetEncodedEHandle() ) + Remote_CallFunction_Replay( otherPlayer, "ServerCallback_PlayBattleChatter", conversationIndex, player.GetEncodedEHandle() ) } void function TryPlayWeaponBattleChatterLine( entity player, entity weapon ) @@ -22,4 +24,22 @@ void function TryPlayWeaponBattleChatterLine( entity player, entity weapon ) expect string( chatterEvent ) PlayBattleChatterLine( player, chatterEvent ) +} + +void function UpdatePlayerVoiceIndex( entity player, PilotLoadoutDef voiceIndex ) +{ + if ( IsPlayerFemale( player ) ) + { + if ( player.IsMechanical() ) + player.SetPlayerNetInt( "battleChatterVoiceIndex", SelectRandomAndroidFemaleBattleChatterVoice() ) + else + player.SetPlayerNetInt( "battleChatterVoiceIndex", SelectRandomFemaleBattleChatterVoice() ) + } + else + { + if ( player.IsMechanical() ) + player.SetPlayerNetInt( "battleChatterVoiceIndex", SelectRandomAndroidMaleBattleChatterVoice() ) + else + player.SetPlayerNetInt( "battleChatterVoiceIndex", SelectRandomMaleBattleChatterVoice() ) + } } \ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/conversation/_grunt_chatter_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/conversation/_grunt_chatter_mp.gnut index b638e92bb..1a70c2896 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/conversation/_grunt_chatter_mp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/conversation/_grunt_chatter_mp.gnut @@ -14,5 +14,5 @@ void function PlayGruntChatterMPLine( entity grunt, string conversationType ) foreach ( entity player in GetPlayerArray() ) if ( ShouldPlayGruntChatterMPLine( conversationType, player, grunt ) ) - Remote_CallFunction_NonReplay( player, "ServerCallback_PlayGruntChatterMP", GetConversationIndex( conversationType ), grunt.GetEncodedEHandle() ) + Remote_CallFunction_Replay( player, "ServerCallback_PlayGruntChatterMP", GetConversationIndex( conversationType ), grunt.GetEncodedEHandle() ) } \ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/conversation/_spectre_chatter_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/conversation/_spectre_chatter_mp.gnut index 2f9e0f844..74ba53714 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/conversation/_spectre_chatter_mp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/conversation/_spectre_chatter_mp.gnut @@ -14,5 +14,5 @@ void function PlaySpectreChatterMPLine( entity spectre, string conversationType foreach ( entity player in GetPlayerArray() ) if ( ShouldPlaySpectreChatterMPLine( conversationType, player, spectre ) ) - Remote_CallFunction_NonReplay( player, "ServerCallback_PlaySpectreChatterMP", GetConversationIndex( conversationType ), spectre.GetEncodedEHandle() ) + Remote_CallFunction_Replay( player, "ServerCallback_PlaySpectreChatterMP", GetConversationIndex( conversationType ), spectre.GetEncodedEHandle() ) } \ No newline at end of file -- cgit v1.2.3