Announcement

Collapse
No announcement yet.

horizontal lift problem

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

    horizontal lift problem

    I have this triggeropentimed lift that moves horizontally.
    The liftcenter, liftexits, and triggers are set correctly, the path lines also looks good.

    The problem is the bots will walk on the lift and won't stay put at the liftcenter.
    They will walk on the lift and jump off the lift before the lift can get to the other side.

    With vertical lifts it works fine, just not for horizontal lifts for some reason.

    #2
    Specify the positions explicitly in the LiftExits.

    Comment


      #3
      Originally posted by Wormbo View Post
      Specify the positions explicitly in the LiftExits.
      How do I do that?
      I tried setting the SuggestedKeyFrame of first liftexit to 0 and the 2nd to 1, didn't work either.

      Comment


        #4
        Bots will do stupid stuff if enemies are around. That may also happen on vertical lifts.

        But if you feel it's something in your setup, please post more information. Remember to build paths and check that the lift exits and center are really associated to the mover.

        Comment


          #5
          I think its the liftexit doesn't check horizontal distance, only vertical. The bots just jump off towards the destination's liftexit even though lift is too far away horizontally, but its at the same height.

          Here's the setup:
          bots stays on lift


          bot jumps off



          Does the code of liftexit class check horizontal distance?

          Code:
          function PostBeginPlay()
          {
          	Super.PostBeginPlay();
          
          	if ( bLiftJumpExit && (MyLift != None) )
          	{
          		if ( Level.Game.GameDifficulty < 4 )
          			ExtraCost = 10000000;
          		MyLift.bJumpLift = true;
          	}
          }
          
          function bool CanBeReachedFromLiftBy(Pawn Other)
          {
          	local float RealJumpZ;
          	
          	if ( bLiftJumpExit )
          	{
          		if ( (MyLift.Velocity.Z < 100) || (MyLift.KeyNum == 0)  )
          			return false;
          		RealJumpZ = Other.JumpZ;
          		if ( !bNoDoubleJump )
          			Other.JumpZ = Other.JumpZ * 1.5;
          		Other.JumpZ += MyLift.Velocity.Z;
          		Other.bWantsToCrouch = false;
          		Other.Controller.MoveTarget = self;
          		Other.Controller.Destination = Location;
          		Other.bNoJumpAdjust = true;
          		Other.Velocity = SuggestFallVelocity(Location + vect(0,0,100), Other.Location, Other.JumpZ, Other.GroundSpeed);
          		Other.Acceleration = vect(0,0,0);
          		Other.SetPhysics(PHYS_Falling);
          		Other.Controller.SetFall();
          		Other.DestinationOffset = CollisionRadius;
          		Other.JumpZ = RealJumpZ;
          		if ( !bNoDoubleJump )
          			Other.Controller.SetDoubleJump();
          		return true;
          	}
          	
          	return ( (Location.Z < Other.Location.Z + Other.CollisionHeight)
          			 && Other.LineOfSightTo(self) );
          }
          
          event bool SuggestMovePreparation(Pawn Other)
          {
          	local Controller C;
          	
          	if ( (MyLift == None) || (Other.Controller == None) )
          		return false;
          	if ( Other.Physics == PHYS_Flying )
          	{
          		if ( Other.AirSpeed > 0 )
          			Other.Controller.MoveTimer = 2+ VSize(Location - Other.Location)/Other.AirSpeed;
          		return false;
          	}
          	if ( (Other.Base == MyLift)
          			|| ((LiftCenter(Other.Anchor) != None) && (LiftCenter(Other.Anchor).MyLift == MyLift)
          				&& (Other.ReachedDestination(Other.Anchor))) )
          	{
          		// if pawn is on the lift, see if it can get off and go to this lift exit
          		if ( CanBeReachedFromLiftBy(Other) )
          			return false;
          
          		// make pawn wait on the lift
          		Other.DesiredRotation = rotator(Location - Other.Location);
          		Other.Controller.WaitForMover(MyLift);
          		return true;
          	}
          	else
          	{
          		for ( C=Level.ControllerList; C!=None; C=C.nextController )
          			if ( (C.Pawn != None) && (C.PendingMover == MyLift) && C.SameTeamAs(Other.Controller) && C.Pawn.ReachedDestination(self) )
          			{
          				Other.DesiredRotation = rotator(Location - Other.Location);
          				Other.Controller.WaitForMover(MyLift);
          				return true;
          			}
          	}
          	return false;
          }

          Comment

          Working...
          X