1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

UE2 - UT2kX Jumppads that require the player to jump

Discussion in 'Mapping' started by xMurphyx, Feb 15, 2010.

  1. xMurphyx

    xMurphyx New Member

    Joined:
    Jun 2, 2008
    Messages:
    1,503
    Likes Received:
    0
    Hi,
    how can I make UC2 style jumppads that require the player to press jump before they throw him?
     
  2. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,910
    Likes Received:
    35
    You could make a special inventory item that monitors the owner event for jumping, like jump boots do. But instead of playing the jump boots sound, you check for whether the player touches your special jump pad and let it toss the player in the direction you want.
     
  3. xMurphyx

    xMurphyx New Member

    Joined:
    Jun 2, 2008
    Messages:
    1,503
    Likes Received:
    0
    I need it to work with a few different directions. Do I need an inventory item for all of them?
    I can make triggered Jumppads instead (unreal wiki has a page about it), which would be much more convenient. It just would be a lot more intuitive for players if they responded to the Jump button rather than the Use button.

    Can a trigger be altered to react to the Jump button instead of the Use button?
     
  4. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,910
    Likes Received:
    35
    No, unlike the Use feature, jumping does not notify any touching actors.

    My idea would consist of a custom jumppad and a special inventory like this:
    Code:
    class JumpPadNotifier extends Inventory;
    
    function OwnerEvent(name EventName)
    {
      local TouchJumpPad Other;
    
      foreach Owner.TouchingActors(class'TouchJumpPad', Other)
        Other.PlayerJumped(Pawn(Owner));
    }
    
    Code:
    class TouchJumpPad extends UTJumpPad;
    
    function PlayerJumped(Pawn Other)
    {
      PostTouch(Other); // or something like that
    }
    
    function Touch(Actor Other)
    {
      local JumpPadNotifier Notifier;
    
      if (UnrealPawn(Other) != None && UnrealPawn(Other).IsHumanControlled()) {
        // ensure player has the inventory
        Notifier = JumpPadNotifier(UnrealPawn(Other).FindInventoryType(class'JumpPadNotifier');
        if (Notifier == None) {
          UnrealPawn(Other).CreateInventory(string(class'JumpPadNotifier'));
        }
      }
      else {
        // for bots, fall back to default logic
        Super.Touch(Other);
      }
    }
    
     

Share This Page