Announcement

Collapse
No announcement yet.

Get the player's dodge double-click time?

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

    Get the player's dodge double-click time?

    I'm working on a vehicle that can dodge:


    The dodging is fine, but I'd like to synchronize the doubletap sensitivity with the Dodge Double-Click Time that the player selected in the Settings menu. I currently use a hardcoded 0.3 seconds.

    This value appears to be kept in PlayerController.PlayerInput, but it is private.

    Any suggestions?

    #2
    Code:
    ThePlayerController.InputClass.default.DoubleClickTimer
    Or alternatively
    Code:
    local playerinput pi;
    local playercontroller origcont;
    
    foreach AllObjects(Class'PlayerInput', pi)
    {
         if (pi.Outer == origcont)
              break;
    }

    Comment


      #3
      Oohh, that last one is nasty! Good catch, thanks! Hadn't thought of that. That this is even possible breaks just about all the object oriented programming rules.

      The first one would, I think, get me the default value of 0.25, which may or may not have been changed by the player in the meantime.

      Comment


        #4
        Originally posted by Xyx View Post
        The first one would, I think, get me the default value of 0.25, which may or may not have been changed by the player in the meantime.
        Indeed, but I just checked the menu code and it appears to work off of the default value too: (GUI2k4\Classes\UT2K4Tab_IForceSettings.uc)
        Code:
        if ( class'PlayerInput'.default.DoubleClickTime != FMax(0.0, fDodge) )
        {
        	class'PlayerInput'.default.DoubleClickTime = fDodge;
        	bInputSave = True;
        }
        So you should be safe enough with that but either one will do.

        Comment


          #5
          So indeed! So that's where to find all the menu stuff. Cool. Thanks again!

          EDIT: Works nicely!

          Comment

          Working...
          X