UE3 - UT3 Broadcast Localized Message

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Phoenix_Wing

Official Kantham Stalker
Mar 28, 2008
386
0
0
California
Just a little confused on how this works to send a message about a players death. I know that it refers to a Message Class for its first parameter, then the related players PRIs but how does it add their name into the killed string? In most of the message classes (ex Warfare) it doesn't have the PlayerName Picked up the orb! messages, so i can't look at those, and others just refer to them in the broadcast function as MessageClass and i'm not quite sure where to look for that.

Heres the function if anybody wants them:
Code:
BroadcastLocalizedMessage( class<LocalMessage> MessageClass, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject )

I just can't figure out how it puts the Player names in certain places. In BattleTeamArena they put MessageText(1) = "Now viewing `1" in the defaults but where is that called? Do i just put the string in an array and put `1 for RelatedPRI_1?

Sorry if that was confusing, but its a little hard to explain. Thanks in advance!
-Phoenix
 
Last edited:

DannyMeister

UT3 Jailbreak Coder
Dec 11, 2002
1,275
1
38
40
Bolivar, Missouri
Here's how death messages work. Each damagetype class has a DeathString, FemaleSuicide, and MaleSuicide variables that has the death message. There are escape characters like `o for victim and `k for killer.

The gametype's GameInfo class has a DeathMessageClass class variable that gets passed in to BroadcastLocalizedMessage() from the BroadcastDeathMessage() method, and the damage type class gets passed as the OptionalObject.

The PlayerController recieves the message, and calls the death message class's ClientReceive(), which in turn (in the LocalMessage super-class) calls GetString(). The PRI's of the victim and the killer are passed along that whole chain of events, and GetString() uses the PRI's to find the player names. It passes those names and the death message string along to GameInfo.static.ParseKillMessage() to replace the escape character with the player names.

So that's the whole chain of events... if your question is really "how do i make my custom weapon have a unique death for a player's death?" then the short answer is create a UTDamageType subclass and put your desired message in the DeathString, FemaleSuicide, and MaleSuicide variables.
 

Phoenix_Wing

Official Kantham Stalker
Mar 28, 2008
386
0
0
California
Thanks Danny! That really cleared up things for me.

I wan't it so when a player gets killed, it shows a message that says "Blue Team's <PlayerName> was killed!" Now i should be able to do that :D