Unreal 227 has additional localized variables for death messages related to female players:
in UnrealGameInfo
var(DeathMessage) localized array<string> FemDeathMessages,FemHeadLossMessages,FemMajorDeathMessages;
var(DeathMessage) localized string FemExplodeMessage,FemSuicideMessage,FemFallMessage,
FemDrownedMessage,FemBurnedMessage,FemCorrodedMessage,
FemHackedMessage,FemBleededMessage;
var(DeathMessage) localized bool bGenderMessages;
These variables do not cover non-classic death messages (based on strings defined for particular weapons - when GameInfo's bClassicDeathMessages == false) and death messages associated with ASMD combo (SpecialDamageString).
Also currently there is no way to specify different localized versions of strings "<PlayerName> entered the game" (GameInfo.EnteredMessage) and "<PlayerName> left the game" (GameInfo.LeftMessage) for male players and female players.
Suggested solution:
1. In class Engine.Weapon: add localized variables FemDeathMessage and FemKillMessage:
var() Localized string DeathMessage, FemDeathMessage, FemKillMessage;
FemDeathMessage is supposed to be used when it's nonempty and the implied victim is a female,
FemKillMessage is supposed to be used when it's nonempty and the implied killer is a female.
In case of ambiguity between FemDeathMessage and FemKillMessage, the latter takes priority of the former.
(see clause 2.3)
2. In class Engine.GameInfo:
2.1. add new non-localized variable FemSpecialDamageString:
var() string SpecialDamageString, FemSpecialDamageString;
2.2. add new function GetSpecialDamageString:
// [227j] ASMD combo kill message that may depend on the victim's gender
function string GetSpecialDamageString(Pawn Victim)
{
// If SpecialDamageString is empty, the function shall return empty string even if FemaleSpecialDamageString is nonempty
if (Victim.bIsFemale && Len(FemSpecialDamageString) > 0 && Len(SpecialDamageString) > 0)
return FemSpecialDamageString;
return SpecialDamageString;
}
2.3. modify function Killed:
....
if (Killer.Weapon != None)
{
KillerWeaponName = Killer.Weapon.ItemName;
- DeathMessage = Killer.Weapon.DeathMessage;
+ if (Killer.bIsFemale && Len(Killer.Weapon.FemKillMessage) > 0)
+ DeathMessage = Killer.Weapon.FemKillMessage;
+ else if (Other.bIsFemale && Len(Killer.Weapon.FemDeathMessage) > 0)
+ DeathMessage = Killer.Weapon.FemDeathMessage;
+ else
+ DeathMessage = Killer.Weapon.DeathMessage;
}
....
- if ( (DamageType == 'SpecialDamage') && (SpecialDamageString != "") )
+ if (DamageType == 'SpecialDamage' && Len(GetSpecialDamageString(Other)) > 0)
{
message = ParseKillMessage(
Killer.GetHumanName(),
Other.GetHumanName(),
KillerWeaponName,
- SpecialDamageString,
+ GetSpecialDamageString(Other),
Other.bIsFemale);
BroadcastMessage(message, false, 'DeathMessage');
}
....
2.4. add localized variables FemEnteredMessage and FemLeftMessage:
var localized string EnteredMessage, FemEnteredMessage;
var localized string LeftMessage, FemLeftMessage;
2.5. modify function Login:
....
if ( Level.NetMode==NM_DedicatedServer || Level.NetMode==NM_ListenServer )
- BroadcastMessage( NewPlayer.PlayerReplicationInfo.PlayerName$EnteredMessage, false );
+ {
+ if (NewPlayer.bIsFemale && Len(FemEnteredMessage) > 0)
+ BroadcastMessage(NewPlayer.PlayerReplicationInfo.PlayerName $ FemEnteredMessage, false);
+ else
+ BroadcastMessage(NewPlayer.PlayerReplicationInfo.PlayerName $ EnteredMessage, false);
+ }
....
2.6. modify function Logout:
....
if ( Spectator(Exiting)!=None && Level.NetMode!=NM_StandAlone )
NumSpectators--;
else if ( Level.NetMode==NM_DedicatedServer || Level.NetMode==NM_ListenServer )
- BroadcastMessage( Exiting.PlayerReplicationInfo.PlayerName$LeftMessage, false );
+ {
+ if (Exiting.bIsFemale && Len(FemLeftMessage) > 0)
+ BroadcastMessage(Exiting.PlayerReplicationInfo.PlayerName $ FemLeftMessage, false);
+ else
+ BroadcastMessage(Exiting.PlayerReplicationInfo.PlayerName $ LeftMessage, false);
+ }
....
3. Modify function UnrealShare.DeathMatchGame.AddBot:
....
// broadcast a welcome message.
- BroadcastMessage( NewBot.PlayerReplicationInfo.PlayerName$EnteredMessage, true );
+ if (NewBot.bIsFemale && Len(FemEnteredMessage) > 0)
+ BroadcastMessage(NewBot.PlayerReplicationInfo.PlayerName $ FemEnteredMessage, true);
+ else
+ BroadcastMessage(NewBot.PlayerReplicationInfo.PlayerName $ EnteredMessage, true);
....
4. In class UnrealShare.TazerProj:
4.1. add new localized variable FemComboKillMessage:
var() localized string ComboKillMessage, FemComboKillMessage;
4.2. modify function SuperExplosion:
function SuperExplosion()
{
local RingExplosion2 r;
Level.Game.SpecialDamageString = ComboKillMessage;
+ Level.Game.FemSpecialDamageString = FemComboKillMessage;
+
HurtRadius(Damage*3.9, 240, 'SpecialDamage', MomentumTransfer*2, Location );
+
Level.Game.SpecialDamageString = "";
+ Level.Game.FemSpecialDamageString = "";
+
r = Spawn(Class'RingExplosion2',,'',Location, Instigator.ViewRotation);
if (r!=none)
r.PlaySound(r.ExploSound,,20.0,,1000,0.6);
Destroy();
}
5. Modify function UnrealShare.UnrealGameInfo.KillMessage:
....
case 'Special':
- message = SpecialDamageString;
+ message = GetSpecialDamageString(Other);
break;
....
[Note: these changes are included in 227j_39_40_appendix_2]