News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 19th Aug 2012, 02:03 PM   #1
skylermaki
Registered User
 
Join Date: Aug. 19th, 2012
Posts: 1
Problem with GBA_StrafeLeft and GBA_TurnLeft Inputs

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.
skylermaki is offline   Reply With Quote
Old 20th Aug 2012, 12:21 AM   #2
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,771
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.
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| UnrealScript security considerations
<elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
<TNSe> nono
<TNSe> its always funny to find code a week later you dont even remember writing
<Pfhoenix> what's worse is when you have a Star Wars moment
<Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
Wormbo is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 06:36 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer