UE3 - UDK Problem with GBA_StrafeLeft and GBA_TurnLeft Inputs

  • 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.

skylermaki

New Member
Aug 19, 2012
1
0
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.
 

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
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.