![]() |
|
|
#1 |
|
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;
}
}
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
}
|
|
|
|
|
|
#2 |
|
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 | 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!" |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|