logo
Main

Forums

Downloads

Unreal-Netiquette

Donate for Oldunreal:
Donate

borderline

Links to our wiki:
Wiki

Walkthrough

Links

Tutorials

Unreal Reference

Usermaps

borderline

Contact us:
Submit News
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Localized messages that depend on gender (Read 74 times)
Masterkent
Developer Team
Offline



Posts: 983
Location: Russia
Joined: Apr 5th, 2013
Gender: Male
Localized messages that depend on gender
Apr 1st, 2018 at 2:44pm
Print Post  
Unreal 227 has additional localized variables for death messages related to female players:

in UnrealGameInfo
Code
Select All
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:

Code
Select All
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:

Code
Select All
var() string					SpecialDamageString, FemSpecialDamageString; 


2.2. add new function GetSpecialDamageString:

Code
Select All
// [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:

Code
Select All
....
			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:

Code
Select All
var localized string			EnteredMessage, FemEnteredMessage; 


Code
Select All
var localized string			LeftMessage, FemLeftMessage; 


2.5. modify function Login:

Code
Select All
....
	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:

Code
Select All
....
	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:

Code
Select All
....
	// 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:

Code
Select All
var() localized string ComboKillMessage, FemComboKillMessage; 


4.2. modify function SuperExplosion:

Code
Select All
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:

Code
Select All
....
	case 'Special':
-		message = SpecialDamageString;
+		message = GetSpecialDamageString(Other);
		break;
....
 


[Note: these changes are included in 227j_39_40_appendix_2]
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint
Bookmarks: del.icio.us Digg Facebook Google Google+ Linked in reddit StumbleUpon Twitter Yahoo