Announcement

Collapse
No announcement yet.

Rotating pick-ups

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

  • Rotating pick-ups

    I have created some objective items and would like to make them rotate while waiting to be picked-up. My attempts to do so thus far have failed. Anyone know how I would do this? Thanks.
    Give some taffer fire, and you'll keep him warm for the night with one less reason to cause trouble for the master.
    Set a taffer on fire, and he will be warm for the rest of his life, and have no need to bother the master.

  • #2
    You could try seeing how it's done for some of the weapon pickups in UT. Many of them rotate.

    Comment


    • #3
      Thanks, but I tried by comparing my object to the UT objects (at least for the paramaters they have in common). Also, looked at what was done with the book in DE. Was still unable to to make it work. I know it can be done, but there is probably one parameter I missed.
      Give some taffer fire, and you'll keep him warm for the night with one less reason to cause trouble for the master.
      Set a taffer on fire, and he will be warm for the rest of his life, and have no need to bother the master.

      Comment


      • #4
        The book in DE isn't rotating. It's simply floating because GulloneFox put it that high.
        JM

        Comment


        • #5
          You'll need a new script. And also, remember that there's 65535 units in a full rotation in unreal.
          ]V[]V[

          Comment


          • #6
            Can't you just set the rotation rate in the movement section of the actor?
            It's not my fault everything you like is terrible.

            Comment


            • #7
              Well, that might work.
              ]V[]V[

              Comment


              • #8
                Originally posted by BiG_D
                Can't you just set the rotation rate in the movement section of the actor?
                Thats what I intially thought- but so far it has not worked.
                Give some taffer fire, and you'll keep him warm for the night with one less reason to cause trouble for the master.
                Set a taffer on fire, and he will be warm for the rest of his life, and have no need to bother the master.

                Comment


                • #9
                  Originally posted by Thebos
                  Originally posted by BiG_D
                  Can't you just set the rotation rate in the movement section of the actor?
                  Thats what I intially thought- but so far it has not worked.
                  I believe rotation rate only effects how fast things rotate to achieve their DesiredRotation.

                  Try setting bRotatingPickup under the Inventory preferences to true. (Yes, I know it doesn't work).
                  Immortius' Forge

                  Comment


                  • #10
                    Originally posted by immortius
                    I believe rotation rate only effects how fast things rotate to achieve their DesiredRotation.
                    Are you sure? Check out the meteors in the skybox in CTF-Face... I'm pretty sure its the rotation rate thats making them go 'round, and the DesiredRotation isn't set.
                    It's not my fault everything you like is terrible.

                    Comment


                    • #11
                      The same variables can be recycled for other purposes. The point is that rotation rate by itself doesn't cause things to rotate, and is generally used as to how fast things rotate if they are somehow told to do so. If you look at the rotation rate for ThPickupObjective for instance, it is set to 5000 yaw by default (I think), but that doesn't make them rotate.
                      Immortius' Forge

                      Comment


                      • #12
                        As long as the physics mode is PHYS_Rotating, and a rotation rate is set, (say, yaw 5000) the object should rotate no problem. At least thats how it works with most UT actors, and movers.
                        It's not my fault everything you like is terrible.

                        Comment


                        • #13
                          Well thats not what happens with watchers (for instance). Until the desired rotation is set, even though they have a rotation rate and are PHYS_Rotating, they don't rotate.

                          For that matter normal movers don't automatically rotate if they have non-zero rotation rates. Rotating Movers have a special variable for their rotation, for instance.

                          Bah, I'll look into it when I get home and see if I can work it out. I can say I couldn't get a thievery object to rotate, even with PHYS_Rotating set, bRotatingPickup set and a RotationRate set.
                          Immortius' Forge

                          Comment


                          • #14
                            It would seem that the call to SetPhysics is important in getting an object to actually rotate. In ThieveryPickup, the lines that set a pickup to spin if bRotatingPickup is true are commented out. To make an objective that can spin (if you are experienced enough, ignore my indepth explanations):

                            1. Subclass ThPickupObjectiveItem

                            Right click on ThPickupObjectiveItem and select New. Name the new class ThPickupObjectiveItemRotatable and name the package MyLevel (so that it is stored in your map).

                            2. Add the following into its script:

                            [code:1:d0081a7022]auto state Pickup
                            {
                            function Touch( actor Other )
                            {
                            local Inventory Copy;

                            //log(self$" touch by "$Other);
                            /*
                            if ( ValidTouch(Other) )
                            {
                            Copy = SpawnCopy(Pawn(Other));
                            if (Level.Game.LocalLog != None)
                            Level.Game.LocalLog.LogPickup(Self, Pawn(Other));
                            if (Level.Game.WorldLog != None)
                            Level.Game.WorldLog.LogPickup(Self, Pawn(Other));
                            if (bActivatable && Pawn(Other).SelectedItem==None)
                            Pawn(Other).SelectedItem=Copy;
                            if (bActivatable && bAutoActivate && Pawn(Other).bAutoActivate) Copy.Activate();
                            if ( PickupMessageClass == None )
                            Pawn(Other).ClientMessage(PickupMessag e, 'Pickup');
                            else
                            Pawn(Other).ReceiveLocalizedMessage( PickupMessageClass, 0, None, None, Self.Class );
                            PlaySound (PickupSound,,2.0);
                            Pickup(Copy).PickupFunction(Pawn(O ther));
                            }*/
                            }

                            function frob (Actor Other, Actor FrobItem) {
                            local ThieveryPickup Copy, i;
                            local ThieveryPPawn tpp;

                            if (FrobItem!=none) return;

                            if (bAlreadyFrobbed) return;

                            if (MyParticleSystem!=none) MyParticleSystem.destroy();
                            i=ThieveryPickup(Pawn(other).FindInven toryType(class));
                            if (i!=none) {
                            if (i.NumCopies>=MaxCarried-1) {
                            Pawn(Other).ClientMessage("You are carrying too many of those.");
                            tpp=ThieveryPPawn(Other);
                            if ( (tpp!=none) && (bQuietPickupSound) )
                            ThieveryPPawn(Other).ClientPlayFrobSound&# 40;PickupSound);
                            else
                            PlaySound (PickupSound,,2.0);
                            return;
                            }
                            }

                            bAlreadyFrobbed=true;

                            if ( ValidTouch(Other) )
                            {
                            StolenBy=Pawn(Other); // record that this guy stole this thing
                            Copy = ThieveryPickup(SpawnCopy(Pawn(Other&#4 1;));
                            Copy.SetOwner(Other);
                            if (Level.Game.LocalLog != None)
                            Level.Game.LocalLog.LogPickup(Self, Pawn(Other));
                            if (Level.Game.WorldLog != None)
                            Level.Game.WorldLog.LogPickup(Self, Pawn(Other));
                            //if (bActivatable && Pawn(Other).SelectedItem==None)
                            //Pawn(Other).SelectedItem=Copy;
                            if (bActivatable && bAutoActivate && Pawn(Other).bAutoActivate) Copy.Activate();
                            if ( PickupMessageClass == None )
                            Pawn(Other).ClientMessage(PickupMessag e, 'Pickup');
                            else
                            Pawn(Other).ReceiveLocalizedMessage( PickupMessageClass, 0, None, None, Self.Class );

                            tpp=ThieveryPPawn(Other);
                            if ( (tpp!=none) && (bQuietPickupSound) )
                            ThieveryPPawn(Other).ClientPlayFrobSound&# 40;PickupSound);
                            else
                            PlaySound (PickupSound,,2.0);

                            Copy.PickupFunction(Pawn(Other));
                            //log("[ThieveryPickup] frob() Setting useful vars");
                            Copy.bOnlyOwnerSee = true;
                            Copy.bCarriedItem = true;
                            Copy.AmbientGlow = 0;
                            Copy.bUnlit=true;
                            //Copy.DrawScale*=0.1;
                            Copy.SetPhysics(PHYS_Rotating);
                            Copy.bStasis = false;
                            Copy.Mesh=default.Mesh;
                            Copy.LightType=LT_None;
                            //Copy.OriginalPickup=self;
                            //log("** Frobbed:"$self$" Copy.inventory="$Copy.Inventory);
                            //Copy.ClientLogInventory();
                            if (Copy.MyParticleSystem!=none) Copy.MyParticleSystem.destroy();
                            Copy.bDontCreateParticleSystem=true;
                            if ( (ObjectivePoints>0) && (Other.IsA('ThieveryPPawn')) ) {
                            ThieveryPPawn(Other).Stats.ObjectivePoints +=ObjectivePoints;
                            if (bOnlyAwardObjectivePointsOnce) {
                            ObjectivePoints=0;
                            }
                            }
                            }
                            }

                            function Timer()
                            {
                            if ( RemoteRole != ROLE_SimulatedProxy )
                            {
                            NetPriority = 1.4;
                            RemoteRole = ROLE_SimulatedProxy;
                            /*if ( bHeldItem )
                            {
                            if ( bTossedOut )
                            SetTimer(15.0, false);
                            else
                            SetTimer(40.0, false);
                            }*/
                            return;
                            }
                            /*
                            if ( bHeldItem )
                            {
                            if ( (FRand() < 0.1) || !PlayerCanSeeMe() )
                            Destroy();
                            else
                            SetTimer(3.0, true);
                            }*/
                            }

                            // play surface dependant hitsound when land
                            function Landed(Vector HitNormal)
                            {
                            local texture tex;
                            local TextureTracer Tracer;
                            local vector EndTrace;
                            local byte h;


                            Tracer=ThieveryDeathmatchPlus(Level.Game). GetTextureTracer();
                            //log("tracer="$Tracer);
                            if (Tracer!=none) {
                            EndTrace=Location+Velocity*10;

                            tex=Tracer.TextureTrace(EndTrace,Location) ;

                            h=HitSoundScheme;
                            class'ThieveryHitSounds'.static.PlayHitSound(s elf, FMin(2.0,VSize(Velocity)/300.0), tex, h, true);
                            }

                            super.Landed(HitNormal);
                            }


                            event ZoneChange( ZoneInfo NewZone ) {
                            // if in killzone, respawn the father
                            if (bDropToGroundWhenDead && Region.Zone.bKillZone) {
                            if (Father!=none) { // Father is the original mapper placed pickup that led to spawning this dropped copy
                            Father.BecomePickup();
                            Father.StolenBy=none;
                            }
                            }
                            super.ZoneChange(NewZone);
                            }

                            function BeginState()
                            {
                            Super.BeginState();
                            NumCopies = 0;
                            bAlreadyFrobbed=false;
                            //log("Pickup begin state");
                            }

                            Begin:
                            //log("pickup begin");
                            Mesh = PickupViewMesh;
                            DrawScale = PickupViewScale;
                            if ( bRotatingPickup && (Physics != PHYS_Falling) )
                            SetPhysics(PHYS_Rotating);
                            Dropped:
                            //if( bAmbientGlow )
                            //AmbientGlow=255;
                            if( bSleepTouch )
                            CheckTouching();
                            }[/code:1:d0081a7022]

                            Double click on ThPickupObjectiveItemRotatable, copy and paste. Then click compile changed scripts.

                            3. Then add instances in your level setting all its settings as you will, but making sure bRotatingPickup is set to true. Enjoy.
                            Immortius' Forge

                            Comment


                            • #15
                              But why make it so complicated? Since the object is level-specific, a little hax doesn't really matter:

                              [code:1:574444acdc]simulated function Tick( float DeltaTime )
                              {
                              SetRotation( Rotation + ( RotationRate * DeltaTime ));
                              }[/code:1:574444acdc]

                              Then use RotationRate to decide the speed in UUs per second.
                              ]V[]V[

                              Comment

                              Working...
                              X