Announcement

Collapse
No announcement yet.

Weapon>SetPosition&LagRot

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

    Weapon>SetPosition&LagRot

    Weapon & scripts: http://narod.ru/disk/26102760001/UDK_.rar.html or http://depositfiles.com/files/9hrgb827s
    Video: http://www.youtube.com/watch?v=xGiVN...eature=related

    Needs to be done smoothly sight, please help.

    Functions SetPosition & LagRot in script M4A1.uc


    For russian people > http://forums.epicgames.com/threads/...apon-Rotations

    #2
    Is there a question in here somewhere?

    Comment


      #3
      I want to make a smooth movement of arms

      Comment


        #4
        Put your files in some human site, because peoples don't know how to download from russian... things...

        Comment


          #5
          Originally posted by VendorX View Post
          Put your files in some human site, because peoples don't know how to download from russian... things...
          http://depositfiles.com/files/9hrgb827s

          Comment


            #6
            I made it!!! http://www.youtube.com/watch?v=GXuAeDlkdno and http://www.youtube.com/watch?v=5YZs0...ature=youtu.be

            Comment


              #7
              What did you do to fix?

              Comment


                #8


                Paste this code in your Class weapon

                simulated event SetPosition(UDKPawn Holder)
                {
                local vector DrawOffset, ViewOffset;
                local rotator NewRotation;

                if ( !Instigator.IsFirstPerson() )

                return;

                SetHidden( false );

                PlayerViewOffset.X = 0;
                PlayerViewOffset.Y = 0;
                PlayerViewOffset.Z = 0;

                DrawOffset = PlayerViewOffset;

                DrawOffset.Z = UTPawn(Holder).GetEyeHeight();

                SetLocation( Holder.Location + DrawOffset );

                NewRotation = (Holder.Controller == None ) ? Holder.Rotation : Holder.Controller.Rotation;

                NewRotation.Yaw = LagRot2(NewRotation.Yaw & 65535, Rotation.Yaw & 65535, MaxYawLag);
                NewRotation.Pitch = LagRot2(NewRotation.Pitch & 65535, Rotation.Pitch & 65535, MaxPitchLag);


                SetRotation(NewRotation);
                }


                simulated function int LagRot2(int NewValue, int OldValue, float MaxDiff)
                {
                if ( (NewValue) ClockWiseFrom (OldValue) )
                {
                if ( OldValue > NewValue )
                {
                OldValue -= 65535;
                }
                if ( NewValue - OldValue > MaxDiff )

                OldValue =( NewValue - MaxDiff);
                }
                else
                {
                if ( OldValue < NewValue )
                {
                NewValue -= 65535;
                }
                if ( OldValue - NewValue > MaxDiff )

                OldValue = (NewValue + MaxDiff);
                }
                return (OldValue + 0.6 * (NewValue - OldValue));
                }

                Comment


                  #9
                  Really thanks, worked fine.

                  Comment


                    #10
                    Can Anyone Help me?
                    how to use this Scripts?
                    Please Help

                    Comment

                    Working...
                    X