PDA

View Full Version : Build messages storing, light version.



Higor
10-25-2012, 11:47 PM
Writing this from a toaster filled with viruses, just as reminder for myself to copy/paste later.




// Short build message storing on connected clients, should display on SiegeStats below the rankings
// Useful for quick screenshots, improves moderation and teamwork, encourages usage of SiegeStats
class sgClientBuildMessages expands Info;

var string sHistory[16];
var PlayerPawn LocalPlayer;

replication
{
reliable if ( Role == ROLE_Authority)
ReceiveMessage;
}

simulated event PostBeginPlay()
{
if ( Level.NetMode != NM_DedicatedServer )
SetTimer(2, false);
}

simulated event Timer()
{
local playerPawn P;
ForEach AllActors (class'PlayerPawn',P)
if ( ViewPort(P.Player) != none )
{ LocalPlayer = P;
return;
}
Destroy(); //Why would a client have no player?
}

simulated function ReceiveMessage( string sMsg, int Team, bool bAnnounce)
{
local int i;
if ( (Spectator(LocalPlayer) == none) && (LocalPlayer.PlayerReplicationInfo.Team != Team) )
return; //Only store messages on spectators and same team players
For ( i=ArrayCount(sHistory) ; i>0 ; i-- )
sHistory[i] = sHistory[i-1]; //Push up
sHistory[0] = sMsg;
if ( bAnnounce )
LocalPlayer.ClientMessage("-== "$sMsg$" ==-");
}

defaultproperties
{
bAlwaysRelevant=True
RemoteRole=ROLE_SimulatedProxy
}

Higor
10-26-2012, 12:02 AM
Add to SiegeGI...




var sgClientBuildMessages ClientBuildM;

//on InitGame:
ClientBuildM = Spawn( class'sgClientBuildMessages');

//on BuildingCreated( sgBuilding sgNew)
if ( sgNew.Owner != none )
ClientBuildM.ReceiveMessage( Pawn(sgNew.Owner).PlayerReplicationInfo.PlayerName @"built a"@sgNew.BuildingName, Pawn(sgNew.Owner).PlayerReplicationInfo.Team, false);

function BuildingRemoved( sgBuilding sgRem, pawn Remover)
{
if ( sgNew.Owner != none )
ClientBuildM.ReceiveMessage( Pawn(sgNew.Owner).PlayerReplicationInfo.PlayerName @"'s"@sgNew.BuildingName @ "has been removed by" @ Remover.PlayerReplicationInfo.PlayerName, Remover.PlayerReplicationInfo.Team, true);
else
ClientBuildM.ReceiveMessage( "A"@sgNew.BuildingName @ "has been removed by" @ Remover.PlayerReplicationInfo.PlayerName, Remover.PlayerReplicationInfo.Team, true);
}



That's just a basic model, a localized one would be significantly different.


Add to sgBuilding:


//on RemovedBy( pawn Remover) //I added this case to sgBuilding on RC15
SiegeGI(Level.Game).BuildingRemoved( self, Remover);

SAM
10-26-2012, 04:03 AM
Global announce for remove please! Even better would be call nexgen detect moderator or higher and announce to them explicitally :D

however in doing that would make it difficult for pub players to report so global announce would be best way to go.

.seVered.][
10-26-2012, 04:00 PM
Global announce for remove please! Even better would be call nexgen detect moderator or higher and announce to them explicitally :D

however in doing that would make it difficult for pub players to report so global announce would be best way to go.

With an AUDIBLE alert for the Kick message? Perhaps a Car Horn (http://www.soundboard.com/sb/Car_Horn_Sounds) or something like that.

and a simple adjustment to the the remove message would make it easier to find in the log.

sgConstructor.uc, Case 2 // Remove Mode


{
sMessage=">> Player >>"@Pawn(Owner).PlayerReplicationInfo.PlayerName@" has been warned for Team Removing.";
AnnounceAll(sMessage);
}

Disturbed//*.
10-27-2012, 02:47 AM
I have no idea what all them dang codes, So another words, what is this?

.seVered.][
10-27-2012, 04:15 AM
I have no idea what all them dang codes, So another words, what is this?

Build Message and Warning's would be posted to this list and available on the F3 key, along with other useful information about the match.