Announcement

Collapse
No announcement yet.

Player rotation not showing up on other clients

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

  • Player rotation not showing up on other clients

    I'm working on a mutator (well gametype really) to make thieves a bit more acrobatic. I'm subclassing ThieveryPPawn and rotate the actors' pitch during certain actions. This works great for the player, but the rotation does not show up on any other players' systems. Is this a replication issue or perhaps the rotation is being overridden later in the tick by the mouse input? Any ideas/suggestions?

  • #2
    Well, they prolly excluded rotation pitch and roll in the playerpawn replication to save bandwidth...
    ]V[]V[

    Comment


    • #3
      From Pawn:

      [code:1:debb212e00]function ClientSetLocation( vector NewLocation, rotator NewRotation )
      {
      local Pawn P;

      ViewRotation = NewRotation;
      If ( (ViewRotation.Pitch > RotationRate.Pitch) && (ViewRotation.Pitch < 65536 - RotationRate.Pitch) )
      {
      If (ViewRotation.Pitch < 32768)
      NewRotation.Pitch = RotationRate.Pitch;
      else
      NewRotation.Pitch = 65536 - RotationRate.Pitch;
      }

      NewRotation.Roll = 0;
      SetRotation( NewRotation );
      SetLocation( NewLocation );
      }

      function ClientSetRotation( rotator NewRotation )
      {
      local Pawn P;

      ViewRotation = NewRotation;
      NewRotation.Pitch = 0;
      NewRotation.Roll = 0;
      SetRotation( NewRotation );
      }[/code:1:debb212e00]

      UT Script Gods Reasoning: Well, people are always upright, aren't they?

      Redefine these (and other similar functions) in your upgraded ThieveryPPawn, but be careful to check the higher up classes incase they redefine them as well.

      One other note while I remember: On servers, a players rotation is their ViewRotation, while on clients a players rotation is their actual Rotation. This can be seen from the way players spin around on servers when looking around with scouting orbs while on clients they stay still.
      Immortius' Forge

      Comment


      • #4
        One other note while I remember: On servers, a players rotation is their ViewRotation, while on clients a players rotation is their actual Rotation. This can be seen from the way players spin around on servers when looking around with scouting orbs while on clients they stay still.
        Ugh! Somehow I knew you were going to say that. That is not good at all. In a nutshell my gametype gives thieves ninja-like abilities.

        Flips:
        1. Thief jumps like normal
        2. If thief jumps a second time he gets a boost in height and flips forward/backward depending on his movement direction. It even has a cheesy martial arts movie whooshing sound every half second.

        This works beautifully on the client end. When in the second jump, I use SetRotation() to gradually increase/decrease the pitch. I did try setting ViewRotation instead, but the resulting vertigo and inability to aim/mantle/see anything ruled this option out.

        Any suggestions on how to proceed without making players dizzy?

        Comment


        • #5
          Model animations. But me likes vertigo.
          ]V[]V[

          Comment


          • #6
            You misunderstand me. The scouting orb problem is completely opposite to yours - it is server side, not client side, and I only mentioned it before I forgot. It is still possible that it can work.

            The problem is that pitch and roll rotations are nullified on the client side. With a little effort it should be possible to get it working. If you are using a state for jumping, add the code below into it.

            [code:1:36044d5cde]
            function ClientSetRotation (rotator NewRotator)
            {
            SetRotation(NewRotation);
            }
            [/code:1:36044d5cde]

            Otherwise add the following code (though I don't think it will work as well if at all):

            [code:1:36044d5cde]
            replication {
            reliable if (role < ROLE_Authority)
            ClientSetRotationForJumping;
            }

            function ClientSetRotationForJumping (rotator NewRotator)
            {
            SetRotation(NewRotation);
            }
            [/code:1:36044d5cde]

            No guarantee of correctness because I'm at uni and UnrealEd is at home.

            Incedently, the resetting of a players rotation is just one of the problems facing in creating wierd gravity effects.
            Immortius' Forge

            Comment


            • #7
              Thanks for the suggestions.

              I opted for the latter solution. By itself, ClientSetRotationForJumping() wouldn't show any flipping on the client. Once I added an extra SetRotation() I was in business. I just got done testing it on two clients simultaneously and it works great over the network. Now on to wall jumps!

              Comment


              • #8
                Originally posted by Oie
                ...By itself, ClientSetRotationForJumping() wouldn't show any flipping on the client...
                Err, yeah. I meant to say you would need to reference it in some way, preferably in a way that only happens while jumping (who knows what code depends on ClientSetRotation's special "features"). If you're just redefining SetRotation to call ClientSetRotationForJumping() instead of ClientSetRotation() you might as well just redefine ClientSetRotation(). Whatever works though.
                Immortius' Forge

                Comment


                • #9
                  In case you may find this interesting Oie - my implementation of quad-jumping for TUT .

                  [code:1:afa26352e5]//================================================== =======
                  // ThQuadJumpPPawn.
                  //================================================== =======
                  class ThQuadJumpPPawn expands ThieveryPPawn;

                  var int NumJumps;

                  function DoJump( optional float F ) {
                  local string TextureSoundString,stringjump;
                  local sound TextureJumpSound;
                  if ( CarriedDecoration != None || bOnParalysed )
                  return;
                  if ( (Physics == PHYS_Walking) )
                  {
                  NumJumps = 1;
                  PlayInAir();
                  InhibitFootsteps=0;
                  if ( bCountJumps && (Role == ROLE_Authority) && (Inventory != None) )
                  Inventory.OwnerJumped();
                  Velocity.Z = JumpZ;
                  if (bIsCrouching) Velocity.Z*=0.6;
                  Velocity.X *= 1.2; // add some forwards momentum
                  Velocity.Y *= 1.2;
                  if ( (Base != Level) && (Base != None) )
                  Velocity.Z += Base.Velocity.Z;
                  SetPhysics(PHYS_Falling);
                  bJumping=true;
                  }
                  else if (NumJumps < 4 && (Physics == PHYS_Falling) && bJumping)
                  {
                  NumJumps++;
                  PlayInAir();
                  Velocity.Z += JumpZ;
                  if (Velocity.Z > JumpZ*1.2)
                  Velocity.Z = JumpZ*1.2;
                  if ( (Base != Level) && (Base != None) )
                  Velocity.Z += Base.Velocity.Z;
                  }
                  }[/code:1:afa26352e5]
                  Immortius' Forge

                  Comment

                  Working...
                  X