For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

Trying to include a player's name in a broadcast message

UnrealEd 2.1 (227i) and UnrealEd 2.2 (227j), for Unreal 227. With many additions, bugfixes and improvements. Ask mapping related questions, or give hints, tips and tricks.
Post Reply
User avatar
Buffalo Baggins
OldUnreal Member
Posts: 21
Joined: Mon Dec 12, 2016 2:08 am

Trying to include a player's name in a broadcast message

Post by Buffalo Baggins »

I have skaarj set up so that when you kill it, it triggers a special event that broadcasts a message
Is there a way for me to have the message include the players name?

Something like: "*Player* killed the Skaarj!"
America is a tune. It must be sung together.
User avatar
Masterkent
OldUnreal Member
Posts: 1469
Joined: Fri Apr 05, 2013 12:41 pm

Re: Trying to include a player's name in a broadcast message

Post by Masterkent »

The standard SpecialEvent doesn't provide such an option. You can define your own subclass of it and implement function Trigger like this:

Code: Select all

static function string GetNameOf(Pawn P)
{
      if (P == none)
            return "Someone";
      if (P.PlayerReplicationInfo != none)
            return P.PlayerReplicationInfo.PlayerName;
      if (Len(P.MenuName) == 0)
            P.MenuName = string(P.Class.Name);
      return P.NameArticle $ P.MenuName;
}

function Trigger(Actor A, Pawn EventInstigator)
{
      BroadcastMessage(GetNameOf(EventInstigator) @ Message, true, 'CriticalEvent');
}
Last edited by Masterkent on Sat Aug 18, 2018 9:16 am, edited 1 time in total.
Post Reply

Return to “UnrealEd 2.x, the Unreal 227 editors”