Announcement

Collapse
No announcement yet.

Spectator View on ListenServer

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Spectator View on ListenServer

    Hello Guys ,


    I am trying to implement spectator view(without spawning pawn) on listen server and when client joins(pawn is apawned) their position in the world gets viewed on the spectator view . For now, i have a spectator view on a listen server which shows the clients pawn when he joins but, after then the game locks . So, i am wondering if anyone knows how to do this?.

    Thanks,
    Kushal

    #2
    i figured this out ..
    so in the PlayerController Spectating state
    state Spectating extends BaseSpectating
    {
    ignores RestartLevel, Suicide, ThrowWeapon, NotifyPhysicsVolumeChange, NotifyHeadVolumeChange;

    exec function StartFire( optional byte FireModeNum )
    {
    this was the reason for the game to lock once you hit mouse...so comment this..
    //ServerViewNextPlayer();
    }

    // Return to spectator's own camera.
    exec function StartAltFire( optional byte FireModeNum )
    {
    //// comment this also...
    // ResetCameraMode();
    // ServerViewSelf();
    }

    event BeginState(Name PreviousStateName)
    {
    if ( Pawn != None )
    {

    SetLocation(Pawn.Location);
    Pawn.SetHidden(true);
    UnPossess();
    }
    bCollideWorld = true;
    }

    event EndState(Name NextStateName)
    {
    if ( PlayerReplicationInfo != None )
    {
    if ( PlayerReplicationInfo.bOnlySpectator )
    {
    `log("WARNING - Spectator only player leaving spectating state to go to "$NextStateName);
    }
    PlayerReplicationInfo.bIsSpectator = false;
    }

    bCollideWorld = false;
    }
    }


    and in your Player Controller

    ////works with "E" Key
    exec function Use()
    {

    setspectating();

    }


    reliable server setspectating()
    {
    GotoState('Spectating');
    PlayerReplicationInfo.bOnlySpectator = true;
    PlayerReplicationInfo.bIsSpectator = true;


    }



    and thats it ...now when you press E on the server it must get into spectator mode and you should be able to watch your clients move if they are connected..

    Comment

    Working...
    X