• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

TeamMessage trigger? (teamsay)

SnZ

Grizzled Veteran
Oct 24, 2012
115
0
Hi,

I'm trying to get output of 'TeamSay' ingame command but without success, I've checked a lot of source from KF tryed other methods but no luck.

Any idea what I'm doing wrong? (Output from 'Say' is fine').

Code:
class X extends PlayerController;

Event TeamMessage(PlayerReplicationInfo PRI, coerce string S, name Type ) {

    log("Type: " $ Type $ "Str: " $ S);

}
defaultproperties
{
}

Tryed also 'extends MessagingSpectator'.

It just don't log 'TeamSay' related stuff.
 
Last edited:
What do you mean under "it doesn't work"? What are you trying to achieve?
TeamSay is executing on client side, so search inside client log. If you want to parse string on server side, override ServerTeamSay() instead.

I'm trying to get users chat messages from game.

So can this be done via 'ServerTeamSay()'? I don't really know this far how to solve my problem.
 
Upvote 0
so I need to use:

Event ServerTeamSay() ?

I didn't saw that type use in killing floor source (via asembla - https://www.assembla.com/code/killingfloorsource/subversion/nodes)

Just for the record, my goal is to get messages that user writes on chat, i don't want to send messages.

When i checked some other UnrealScripts, it was always called like this:

Code:
Event TeamMessage(PlayerReplicationInfo PRI, coerce string S, name Type ) {
    if (Type == 'Say' || Type == 'TeamSay') {
        log("S: " $ S);
    }
}
but it didn't work. Also google say nothing for me.

Similar method is used in: killingfloorsource/Engine/Classes/PlayerController.uc
 
Last edited:
Upvote 0
I believe this is what your after.......

ServerExt (whitelisted) mod on your server and enable the chat filter.
http://wiki.unrealadmin.org/ServerExt#Chat_Filterhttp://wiki.unrealadmin.org/ServerExt#Chat_Filter

With a few lines you can setup teamchat to be sent to webadmin. From there just enable logging.

I will try to decompile it and maybe i will find a part that catch chat messages (I'm after that to implement it to own code).

Thanks will check.


//I think i slowly get it. ServerTeamSay() is working different so i can't access it so easy as 'Say' right?
 
Last edited:
Upvote 0
I've tryed with replacing existing ServerTeamSay, but still no luck:


Code:
class X extends PlayerController;

function postBeginPlay() {
super.postBeginPlay();
log("------------test-----------");
}


exec function Say( string Msg ){
    Msg = Left(Msg,128);
    ServerSay(Msg);
    log(Msg);
}

exec function TeamSay( string Msg ){
    Msg = Left(Msg,128);
    ServerSay(Msg);
    log(Msg);
}

Event TeamMessage(PlayerReplicationInfo PRI, coerce string S, name Type ) {
log(Type);
}

exec function Test(string Msg)
{
log(Msg);
}


defaultproperties
{
}
I don't get any log() output from exec functions.


also tryed:

Code:
class X extends PlayerController ;



simulated function postBeginPlay() {
super.postBeginPlay();

log("[+]-----------------------");
log("[+]-----------------------");
}




simulated function ServerSay( string Msg )
{
super.ServerSay(Msg);
log("1111111");
}
    
function ServerTeamSay( string Msg )
{
Super.ServerTeamSay(Msg);
log("222222222");
}
    




defaultproperties
{
}
I load via ServerActors=X.X
 
Last edited:
Upvote 0
better use a BroadcastHandler
for usage please refer to KFBots source code...

Thanks for point i was already trying it few days ago but same without luck

Code:
class X extends BroadcastHandler;

function postBeginPlay() {
  super.postBeginPlay();
  log("[+]-----------------------");
}


function bool AcceptBroadcastText( PlayerController Receiver, PlayerReplicationInfo SenderPRI, out string Msg, optional name Type )
{
  log("---------- " $ Msg);
  Level.Game.Broadcast(None, "test text", 'Say'); 
    return super.AcceptBroadcastText(Receiver, SenderPRI, Msg, Type);
}

defaultproperties
{
}
I guess i will try to look this sources and update thread with results after 22.04.

Important question
Btw can this be problem, that my UnrealScript is loaded via ServerActors= ? Because i don't want to make it work like normal mutator. It need to be loaded like that, because it doesn't change anything in gameplay
 
Last edited:
Upvote 0