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.

ScalePawn?

Discussion in 'Programming' started by Delphi, Oct 17, 2004.

  1. Delphi

    Delphi New Member

    Joined:
    Aug 30, 2004
    Messages:
    36
    Likes Received:
    0
    Okay so I've got the ScalePawn working in the runtime okay and all, but how can I get it working in my mod? Especially if I don't want to use those ScaleBoy and ScaleGirl avatars.

    I've got a lovely subclass of Pawn, but it doesn't appear to be used as the getbigger and getsmaller commands are unrecognised.

    Any ideas people?
     
  2. porkmanii

    porkmanii New Member

    Joined:
    Sep 9, 2004
    Messages:
    129
    Likes Received:
    0
    Have you tried sub-classing a game-type and overriding GetDefaultPlayerClass to return your sub-class of pawn, or setting the game type's DefaultPlayerClassName?

    Also, are the getbigger and getsmaller commands the only things you've added? If they are, you could probably implement such functionality in a Mutator instead of a Pawn class, which would make it more compatible, as well as (probably) being easier to implement.
     
  3. Delphi

    Delphi New Member

    Joined:
    Aug 30, 2004
    Messages:
    36
    Likes Received:
    0
    That's a fair point. I think I've just got it working through a trigger so I can set/enforce a different pawn height for different maps. I'll need to do some further testing to make sure it's working okay.

    hmmm, okay so why are my feet in the floor?
     
  4. Call me Erdrik

    Call me Erdrik Arch Mage

    Joined:
    Nov 24, 1999
    Messages:
    334
    Likes Received:
    0
    probly becuase the center point of the pawns are a bit offset from the bottom of the model. so when it gets scaled it scales from the center point and it scales in both directions.
     
  5. Delphi

    Delphi New Member

    Joined:
    Aug 30, 2004
    Messages:
    36
    Likes Received:
    0
    Any fixes? I found someone refered to DrawPivot, but no clues as how to use it?

    Used WOTGreal to do a search for DrawPivot and it didn't find much apart from HUD references.
     
    Last edited: Oct 18, 2004
  6. Payback

    Payback Ive got a big stick

    Joined:
    Nov 21, 2002
    Messages:
    94
    Likes Received:
    0
    I think the value you need to play with is pawn.prepivot. Im messing with it at the moment to push my pawn out of the ground, although Im having trouble making it replicate at the moment so it only works for me offline (at the moment)
     
  7. Delphi

    Delphi New Member

    Joined:
    Aug 30, 2004
    Messages:
    36
    Likes Received:
    0
    Offline is okay. pawn.prepivot(vector) right? What vector do I need? A reference to the floor or what?
     
  8. Delphi

    Delphi New Member

    Joined:
    Aug 30, 2004
    Messages:
    36
    Likes Received:
    0
    kinda got it now. I upped the Z value of the PrePivot vector until the feet touched the floor again. With the Jakob pawn rescaling to 1.5, the Z value is around 14 or so. At the normal scale for UT2k4 the Z value is -5.0. It's all very hit and miss really? Or does someone have a nicer way of calculating the right adjustment?
     
  9. porkmanii

    porkmanii New Member

    Joined:
    Sep 9, 2004
    Messages:
    129
    Likes Received:
    0
    Have you changed the Pawn's collision size (CollisionHeight and CollisionRadius)? If you scale the collision size exactly as much as you scale the DrawScale, your feet should be just as close (proportionately) to the ground. For example:
    Code:
    Pawn.DrawScale += 0.25; // add 25%
    Pawn.SetCollisionSize(
      Pawn.Default.CollisionRadius / Pawn.Default.DrawScale * Pawn.DrawScale,
      Pawn.Default.CollisionHeight / Pawn.Default.DrawScale * Pawn.DrawScale);
    
    If you are setting the Pawn's DrawScale and not it's collision size, that would not only explain why your feet are in the ground, it would also mean the Pawn would look bigger, but would actually be the same size as before.

    Edit- If you are setting the collision size (to 1.5x), wouldn't that move the feet be 2.5 unreal units (if PrePivot.Z == -5)?
     
    Last edited: Oct 19, 2004
  10. Delphi

    Delphi New Member

    Joined:
    Aug 30, 2004
    Messages:
    36
    Likes Received:
    0
    Okay don't worry 'bout that, it's happy now. In the ScalePawn example it uses a Pawn.BaseMovementRate to scale the animation speed. I've done a search through the UT2k4 code and it don't exist.

    Is there another variable that does the same thing so that my pawn doesn't look like a fairy mincing along.
     
    Last edited: Oct 24, 2004
  11. porkmanii

    porkmanii New Member

    Joined:
    Sep 9, 2004
    Messages:
    129
    Likes Received:
    0
    I dont' think there are any variables for a Pawn's animation rate. I've come across the same problem before, and haven't found a solution. I'm almost certain the Pawn's animations are handled by native code (meaning we can't change the rate they are played at unless there are variables for rate of animation), as the only call to LoopAnim is for the DriveAnim, and the only calls to PlayAnim in Pawn are only executed on a dedicated server.

    Edit- the description for BaseMovementRate on the Unreal Wiki is:
    FIXME - temp - used for scaling movement
     
    Last edited: Oct 26, 2004
  12. Delphi

    Delphi New Member

    Joined:
    Aug 30, 2004
    Messages:
    36
    Likes Received:
    0
    oh well, hopefully the scale change wont be enough to make it too obvious that the animation is out. Thanks for your help.
     

Share This Page