Hi,
I'm having a problem setting a player in spectator mode and then loading a new level. I have tried various ways of putting a player into spectator mode, but when the map changes, the countdown until the match starts gets stuck at 3 (just keeps pulsing), none of the bots join the server and the score board is empty. I've tried all sorts of work arounds, but I'm new to UnrealScript and this is driving me crazy! From what I can see, every time I set the player to spectator mode, SpectatorOnly=1 is added to the user.ini file. This seems to stop them being able to connect to the server.
I've tried this:
You can see, the various remarked lines I've also tried. I've also tried resetting the PlayerController and still no joy.
I'm sure it's something simple and stupid, but has anyone a solution to a) put a player in spectator mode and stop this SpectatorMode=1 being added to the user.ini file (config var) or b) know a way to disable SpectatorMode on connection?
Many thanks in advance!
I'm having a problem setting a player in spectator mode and then loading a new level. I have tried various ways of putting a player into spectator mode, but when the map changes, the countdown until the match starts gets stuck at 3 (just keeps pulsing), none of the bots join the server and the score board is empty. I've tried all sorts of work arounds, but I'm new to UnrealScript and this is driving me crazy! From what I can see, every time I set the player to spectator mode, SpectatorOnly=1 is added to the user.ini file. This seems to stop them being able to connect to the server.
I've tried this:
Code:
PController = Level.GetLocalPlayerController();
PController.PlayerReplicationInfo.bOnlySpectator = false;
if (sess==0) {
if (!PController.PlayerReplicationInfo.bIsSpectator) {
// PController.BecomeSpectator();
PController.GotoState('Spectating');
PController.PlayerReplicationInfo.bIsSpectator = true;
}
}else if (sess==1) { //only set session if successful, so retries if failed last time
if (PController.PlayerReplicationInfo.bIsSpectator) {
// PController.BecomeActivePlayer();
PController.GotoState('PlayerWaiting');
PController.PlayerReplicationInfo.bIsSpectator = false;
}
}
You can see, the various remarked lines I've also tried. I've also tried resetting the PlayerController and still no joy.
I'm sure it's something simple and stupid, but has anyone a solution to a) put a player in spectator mode and stop this SpectatorMode=1 being added to the user.ini file (config var) or b) know a way to disable SpectatorMode on connection?
Many thanks in advance!
Last edited: