I am trying to replace the player's PlayerReplicationInfo class with my own.
I am not making a new game type, nor a new player pawn. I just have a mutator running against good old DeathMatchPlus.
The problem I experience is that during the game, each player appears immobile to every other player in the game. But in fact every player can still move around and do everything, so essentially their visual movement is not getting sent to the other players.
I DO know that my instance of the PlayerReplicationInfo is created, attached to the player, and it is doing the other tasks I assigned it. But something isn't right!
I guess I should first ask, has anyone got it to work to replace a player's existing player replication info class with a sub-classed one? If so, what am I missing?
First I simplified my class to make sure it wasn't my custom code that was faulty. So I have this:
One way I attempted to sub it in was this way - I have a spawn notification that fires on the spawn of a PlayerReplicationInfo:
Another way was catching when a player was spawned, and replacing the PlayerReplicationInfo at that point:
Again, both of these work as far as getting called, and subbing in myPlayerReplicationInfo. But I get the problem of the player's movement not updated to each player.
Would someone know what I need to do?
Thanks.
I am not making a new game type, nor a new player pawn. I just have a mutator running against good old DeathMatchPlus.
The problem I experience is that during the game, each player appears immobile to every other player in the game. But in fact every player can still move around and do everything, so essentially their visual movement is not getting sent to the other players.
I DO know that my instance of the PlayerReplicationInfo is created, attached to the player, and it is doing the other tasks I assigned it. But something isn't right!
I guess I should first ask, has anyone got it to work to replace a player's existing player replication info class with a sub-classed one? If so, what am I missing?
First I simplified my class to make sure it wasn't my custom code that was faulty. So I have this:
Code:
class myPlayerReplicationInfo expands PlayerReplicationInfo;
defaultproperties
{
bAlwaysRelevant=true
}
One way I attempted to sub it in was this way - I have a spawn notification that fires on the spawn of a PlayerReplicationInfo:
Code:
class myPRISpawnNotify expands SpawnNotify;
event Actor SpawnNotification(Actor A)
{
if (A.IsA('myPlayerReplicationInfo'))
return A;
A.Destroy();
return Spawn(class'myPlayerReplicationInfo');
}
defaultproperties
{
ActorClass=class'PlayerReplicatonInfo'
}
Another way was catching when a player was spawned, and replacing the PlayerReplicationInfo at that point:
Code:
class myPlayerPawnSpawnNotify expands SpawnNotify;
event Actor SpawnNotification(Actor A)
{
local PlayerPawn p;
local PlayerReplicationInfo PRI;
local myPlayerReplicationInfo mpri;
if (!A.IsA('PlayerPawn'))
return A;
p = PlayerPawn(A);
p.PlayerReplicationInfoClass = class'myPlayerReplicationInfo';
Log("SpawnNotification() - A PlayerPawn.PlayerReplicationInfoClass has been set to a myPlayerReplicationInfo class type");
if((p.PlayerReplicationInfo != None) && (!p.PlayerReplicationInfo.IsA('myPlayerReplicationInfo')))
{
Log("The regular PRI has already been assigned, so we are going to replace it");
PRI = p.PlayerReplicationInfo;
// Create our instance of the class
mpri = Spawn(Class'myPlayerReplicationInfo', p);
// Get any values from the current PRI
mpri.PlayerName = PRI.PlayerName;
mpri.OldName = PRI.OldName;
mpri.PlayerID = PRI.PlayerID;
mpri.TeamName = PRI.TeamName;
mpri.Team = PRI.Team;
mpri.TeamID = PRI.TeamID;
mpri.Score = PRI.Score;
mpri.Deaths = PRI.Deaths;
mpri.VoiceType = PRI.VoiceType;
mpri.HasFlag = PRI.HasFlag;
mpri.Ping = PRI.Ping;
mpri.PacketLoss = PRI.PacketLoss;
mpri.bIsFemale = PRI.bIsFemale;
mpri.bIsABot = PRI.bIsABot;
mpri.bFeigningDeath = PRI.bFeigningDeath;
mpri.bIsSpectator = PRI.bIsSpectator;
mpri.bWaitingPlayer = PRI.bWaitingPlayer;
mpri.bAdmin = PRI.bAdmin;
mpri.TalkTexture = PRI.TalkTexture;
mpri.PlayerZone = PRI.PlayerZone;
mpri.PlayerLocation = PRI.PlayerLocation;
mpri.StartTime = PRI.StartTime;
mpri.TimeAcc = PRI.TimeAcc;
// Destroy the original
p.PlayerReplicationInfo.Destroy();
// Give the player our instance
p.PlayerReplicationInfo = mpri;
}
return A;
}
defaultproperties
{
ActorClass=Class'Botpack.PlayerPawn'
}
Again, both of these work as far as getting called, and subbing in myPlayerReplicationInfo. But I get the problem of the player's movement not updated to each player.
Would someone know what I need to do?
Thanks.