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.

UE3 - UDK Problem with GBA_StrafeLeft and GBA_TurnLeft Inputs

Discussion in 'Programming' started by skylermaki, Aug 19, 2012.

  1. skylermaki

    skylermaki New Member

    Joined:
    Aug 19, 2012
    Messages:
    1
    Likes Received:
    0
    Hi,
    I have a little problem. I would use the GBA_StrateLeft and the GBA_TurnLeft on the same bind and put a condition. I want to use only the GBA_StrateLeft while my CameraStyle == 'ThirdPerson' and only GBA_TurnLeft while my while my CameraStyle == 'FreeCam'.

    I've tried all that i can do but i didnt found the answer.

    I would find something like that :

    Code:
    exec function GBA_StrafeLeft()
    {
        if (YourGameCamera(PlayerCamera).CameraStyle == 'FreeCam')
        {
            return;
    
        }
    }
        
    exec function GBA_TurnLeft()
    {
        if (YourGameCamera(PlayerCamera).CameraStyle == 'ThirdPerson')
        {
            return;
        }
    }  
    Here is my full PlayerController:

    Code:
    class YourGamePlayerController extends GamePlayerController;
    
    var float PreDist; //tore our previous camera distance so that when we switch back to the normal camera, we'll be at our original setting.
    
    exec function NextWeapon()
    {
        if (PlayerCamera.FreeCamDistance < 512)
        {
            PlayerCamera.FreeCamDistance += 64*(PlayerCamera.FreeCamDistance/256); 
        }
    }
    
    exec function PrevWeapon()
    {
        if (PlayerCamera.FreeCamDistance > 64) //Checking if the distance is at our minimum distance
        {
            PlayerCamera.FreeCamDistance -= 64*(PlayerCamera.FreeCamDistance/256); //Once again scaling the zoom for distance
        }
    }
    
    
    exec function GBA_StrafeLeft()
    {
        if (YourGameCamera(PlayerCamera).CameraStyle == 'FreeCam')
        {
            return;
    
        }
    }
    
    exec function GBA_TurnLeft()
    {
        if (YourGameCamera(PlayerCamera).CameraStyle == 'ThirdPerson')
        {
            return;
        }
    }    
            
        
    
    exec function ShoulderCam() 
    {
        PreDist = PlayerCamera.FreeCamDistance; //Storing our previous camera distance...
        YourGameCamera(PlayerCamera).CameraStyle = 'ThirdPerson'; //Type casting our camera script to access the variable CameraStyle
    }
    
    exec function ReturnCam()
    {
        PlayerCamera.FreeCamDistance = PreDist; // Restoring the previous camera distance
        YourGameCamera(PlayerCamera).CameraStyle = 'FreeCam'; // Restoring the previous camera style
    }
    
    DefaultProperties
    {
        CameraClass=class 'YourGameCamera' //Telling the player controller to use your custom camera script
        DefaultFOV=90.f //Telling the player controller what the default field of view (FOV) should be
    }
    Thanks for you help.
     
  2. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,910
    Likes Received:
    35
    I don't think you're supposed to create exec functions for GBA_* binds. Those are actually aliases defined in the input section of the configuration files as well. Look them up to see which functions you actually need to override.
     

Share This Page