| Home Page | Recent Changes | Preferences

Message Interactions

Message mutators pick up all messages that are displayed on screen: Who killed who, who picked up the flag, who took the ball in bombing run, etc. What it will NOT pick up on though, is when you use the SAY command or the TeamSay command.

I suppose a reporter bot could be made using one of these.

First off, you need to make your mutator class that will create your interaction. See Creating An Interaction From A Mutator for this.

Done that? Good...

So thats the mutator part done. Next is the easy part! :)

A simple interaction:

Class MyInteraction extends Interaction;

Function Initialize()
{
    Log("Interaction Initialized");
}

Dont forget to add

bActive=True

Under defaultproperties (else this interaction wont do anything).

Now, how to pick up the messages? Add this function:

function Message( coerce string Msg, float MsgLife)
{
//Do stuff here
}

"Msg", as you could guess, is the message itself. MsgLife is how long it is diplayed on screen for.

That is all there is to it.

If you wanted to log everything that appeared on screen, your Interaction class would look like this:

Class MyInteraction extends Interaction;

Function Initialize()
{
    Log("Interaction Initialized");
}

function Message( coerce string Msg, float MsgLife)
{
    Log("Message:" @ Msg);
}

DefaultProperties
{
bActive=True
}

Thats it. :)


Will: Any problems understanding this? Anything I could do to make it clearer? If so: tell me, or do it yourself ;)

Daid: Is it possible to change the message with this code?

Will: Afraid not. All it allows you to do is see the messages, log them, whatever. It's a very basic function, and rather crap.

Tyoma: So message mutators are dead?

Wormbo: Yes, they are. The only class that is still allowed to modify messages is the BroadcastHandler which is spawned as a per-GameInfo actor.

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Image Uploads

Random Page

Recent Changes

Offline Wiki

Unreal Engine

Console Commands

Terminology

Mapping Topics

Mapping Lessons

UnrealEd Interface

Questions&Answers

Scripting Topics

Scripting Lessons

Making Mods

Class Tree

Questions&Answers

Modeling Topics

Questions&Answers

Log In