Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 00101 00102 00103 00104 00105 00106 00107 00108 00109 00110 00111 00112 00113 00114 00115 00116 00117 00118 00119 00120 00121 00122 00123 00124 00125 00126 00127 00128 00129 00130 00131 00132 00133 00134 00135 00136 00137 00138 00139 00140 00141 00142 00143 00144 00145 00146 00147 00148 00149 00150 00151 00152 00153 00154 00155 00156 00157 00158 00159 00160 00161 00162 00163 00164 00165 00166 00167 00168 00169 00170 00171 00172 00173 00174 00175 00176 00177 00178 00179 00180 00181 00182 00183 00184 00185 00186 00187 00188 00189 00190 00191 00192 00193 00194 00195 00196 00197 00198 00199 00200 00201 00202 00203 00204 00205 00206 00207 00208 00209 00210 00211 00212 00213 00214 00215 00216 00217 00218 00219 00220 00221 00222 00223 00224 00225 00226 00227 00228 00229 00230 00231 00232 00233 00234 00235 00236 00237 00238 00239 00240 00241 00242 00243 00244 00245 00246 00247 |
/** * * Copyright 1998-2011 Epic Games, Inc. All Rights Reserved. */ class UTConsolePlayerController extends UTPlayerController config(Game); /** Whether TargetAdhesion is enabled or not **/ var() config bool bTargetAdhesionEnabled; var config protected bool bDebugTargetAdhesion; // @todo amitt update this to work with version 2 of the controller UI mapping system struct native ProfileSettingToUE3BindingDatum { var name ProfileSettingName; var name UE3BindingName; }; var array<ProfileSettingToUE3BindingDatum> ProfileSettingToUE3BindingMapping360; var array<ProfileSettingToUE3BindingDatum> ProfileSettingToUE3BindingMappingPS3; /** * We need to override this function so we can do our adhesion code. * * Would be nice to have have a function or something be able to be inserted between the set up * and processing. **/ function UpdateRotation( float DeltaTime ) { local Rotator DeltaRot, NewRotation, ViewRotation; ViewRotation = Rotation; if (Pawn!=none) { Pawn.SetDesiredRotation(ViewRotation); //save old rotation } // Calculate Delta to be applied on ViewRotation DeltaRot.Yaw = PlayerInput.aTurn; DeltaRot.Pitch = PlayerInput.aLookUp; // NOTE: we probably only want to ApplyTargetAdhesion when we are moving as it hides the Adhesion a lot better if( ( bTargetAdhesionEnabled ) && ( Pawn != none ) && ( PlayerInput.aForward != 0 ) ) { UTConsolePlayerInput(PlayerInput).ApplyTargetAdhesion( DeltaTime, UTWeapon(Pawn.Weapon), DeltaRot.Yaw, DeltaRot.Pitch ); } ProcessViewRotation( DeltaTime, ViewRotation, DeltaRot ); SetRotation( ViewRotation ); ViewShake( DeltaTime ); NewRotation = ViewRotation; NewRotation.Roll = Rotation.Roll; if( Pawn != None ) { Pawn.FaceRotation(NewRotation, DeltaTime); } } function bool AimingHelp(bool bInstantHit) { // bUsingGamepad is updated every time we do an input based on what was used to make that input //return PlayerInput.bUsingGamepad; // @fixme this needs to eventually use the above line and also have some client to server communication where // the client tells the server if they have ever used a keyboard/mouse. The idea being: once they have "cheated" then // they never will get aiming help again. Doing it this way reduces the amount of server messages we need to have return true; } /** * @returns the distance from the collision box of the target to accept aiming help (for instant hit shots) */ function float AimHelpModifier() { return (FOVAngle < DefaultFOV - 8) ? 0.75 : 1.0; } simulated function bool PerformedUseAction() { if ( Super.PerformedUseAction() ) { return true; } else if ( (Role == ROLE_Authority) && !bJustFoundVehicle ) { // console smart use - bring out hoverboard if no other use possible ClientSmartUse(); return true; } return false; } unreliable client function ClientSmartUse() { ToggleTranslocator(); } reliable client function ClientRestart(Pawn NewPawn) { Super.ClientRestart(NewPawn); // we never want the tilt thing on when using UTPawns if (UTPawn(NewPawn) != None) { SetOnlyUseControllerTiltInput(false); SetUseTiltForwardAndBack(true); SetControllerTiltActive(false); } } exec function PrevWeapon() { if (Pawn == None || Vehicle(Pawn) != None) { if ( UDKVehicleBase(Pawn) != None ) { UDKVehicleBase(Pawn).AdjacentSeat(-1, self); } } else if (!Pawn.IsInState('FeigningDeath')) { Super.PrevWeapon(); } } exec function NextWeapon() { if (Pawn == None || Vehicle(Pawn) != None) { if ( UDKVehicleBase(Pawn) != None ) { UDKVehicleBase(Pawn).AdjacentSeat(1, self); } } else if (!Pawn.IsInState('FeigningDeath')) { Super.NextWeapon(); } } function ResetPlayerMovementInput() { local UTConsolePlayerInput ConsoleInput; Super.ResetPlayerMovementInput(); ConsoleInput = UTConsolePlayerInput(PlayerInput); if (ConsoleInput != None) { ConsoleInput.ForcedDoubleClick = DCLICK_None; } } // Player movement. // Player Standing, walking, running, falling. state PlayerWalking { ignores SeePlayer, HearNoise, Bump; /** * needs to support switching from wall dodge attempt to double jump with air control */ function ProcessMove(float DeltaTime, vector NewAccel, eDoubleClickDir DoubleClickMove, rotator DeltaRot) { if ( (DoubleClickMove == DCLICK_Active) && (Pawn.Physics == PHYS_Falling) ) DoubleClickDir = DCLICK_Active; else if ( (DoubleClickMove != DCLICK_None) && (DoubleClickMove < DCLICK_Active) ) { if ( UTPawn(Pawn).Dodge(DoubleClickMove) ) { DoubleClickDir = DCLICK_Active; } else if ( Pawn.Physics == PHYS_Falling ) { // allow double jump while air controlling bPressedJump = true; } } Super.ProcessMove(DeltaTime,NewAccel,DoubleClickMove,DeltaRot); } } defaultproperties { InputClass=class'UTGame.UTConsolePlayerInput' VehicleCheckRadiusScaling=1.5 // @todo amitt update this to work with version 2 of the controller UI mapping system ProfileSettingToUE3BindingMapping360(0)=(ProfileSettingName="GamepadBinding_ButtonA",UE3BindingName="XboxTypeS_A") ProfileSettingToUE3BindingMapping360(1)=(ProfileSettingName="GamepadBinding_ButtonB",UE3BindingName="XboxTypeS_B") ProfileSettingToUE3BindingMapping360(2)=(ProfileSettingName="GamepadBinding_ButtonX",UE3BindingName="XboxTypeS_X") ProfileSettingToUE3BindingMapping360(3)=(ProfileSettingName="GamepadBinding_ButtonY",UE3BindingName="XboxTypeS_Y") ProfileSettingToUE3BindingMapping360(4)=(ProfileSettingName="GamepadBinding_Back",UE3BindingName="XboxTypeS_Back") ProfileSettingToUE3BindingMapping360(5)=(ProfileSettingName="GamepadBinding_Start",UE3BindingName="XboxTypeS_Start") ProfileSettingToUE3BindingMapping360(6)=(ProfileSettingName="GamepadBinding_RightBumper",UE3BindingName="XboxTypeS_RightTrigger") ProfileSettingToUE3BindingMapping360(7)=(ProfileSettingName="GamepadBinding_LeftBumper",UE3BindingName="XboxTypeS_LeftTrigger") ProfileSettingToUE3BindingMapping360(8)=(ProfileSettingName="GamepadBinding_RightTrigger",UE3BindingName="XboxTypeS_RightShoulder") ProfileSettingToUE3BindingMapping360(9)=(ProfileSettingName="GamepadBinding_LeftTrigger",UE3BindingName="XboxTypeS_LeftShoulder") ProfileSettingToUE3BindingMapping360(10)=(ProfileSettingName="GamepadBinding_RightThumbstickPressed",UE3BindingName="XboxTypeS_RightThumbstick") ProfileSettingToUE3BindingMapping360(11)=(ProfileSettingName="GamepadBinding_LeftThumbstickPressed",UE3BindingName="XboxTypeS_LeftThumbstick") ProfileSettingToUE3BindingMapping360(12)=(ProfileSettingName="GamepadBinding_DPadUp",UE3BindingName="XboxTypeS_DPad_Up") ProfileSettingToUE3BindingMapping360(13)=(ProfileSettingName="GamepadBinding_DPadDown",UE3BindingName="XboxTypeS_DPad_Down") ProfileSettingToUE3BindingMapping360(14)=(ProfileSettingName="GamepadBinding_DPadLeft",UE3BindingName="XboxTypeS_DPad_Left") ProfileSettingToUE3BindingMapping360(15)=(ProfileSettingName="GamepadBinding_DPadRight",UE3BindingName="XboxTypeS_DPad_Right") ProfileSettingToUE3BindingMappingPS3(0)=(ProfileSettingName="GamepadBinding_ButtonA",UE3BindingName="XboxTypeS_A") ProfileSettingToUE3BindingMappingPS3(1)=(ProfileSettingName="GamepadBinding_ButtonB",UE3BindingName="XboxTypeS_B") ProfileSettingToUE3BindingMappingPS3(2)=(ProfileSettingName="GamepadBinding_ButtonX",UE3BindingName="XboxTypeS_X") ProfileSettingToUE3BindingMappingPS3(3)=(ProfileSettingName="GamepadBinding_ButtonY",UE3BindingName="XboxTypeS_Y") ProfileSettingToUE3BindingMappingPS3(4)=(ProfileSettingName="GamepadBinding_Back",UE3BindingName="XboxTypeS_Back") ProfileSettingToUE3BindingMappingPS3(5)=(ProfileSettingName="GamepadBinding_Start",UE3BindingName="XboxTypeS_Start") ProfileSettingToUE3BindingMappingPS3(6)=(ProfileSettingName="GamepadBinding_RightBumper",UE3BindingName="XboxTypeS_RightShoulder") ProfileSettingToUE3BindingMappingPS3(7)=(ProfileSettingName="GamepadBinding_LeftBumper",UE3BindingName="XboxTypeS_LeftShoulder") ProfileSettingToUE3BindingMappingPS3(8)=(ProfileSettingName="GamepadBinding_RightTrigger",UE3BindingName="XboxTypeS_RightTrigger") ProfileSettingToUE3BindingMappingPS3(9)=(ProfileSettingName="GamepadBinding_LeftTrigger",UE3BindingName="XboxTypeS_LeftTrigger") ProfileSettingToUE3BindingMappingPS3(10)=(ProfileSettingName="GamepadBinding_RightThumbstickPressed",UE3BindingName="XboxTypeS_RightThumbstick") ProfileSettingToUE3BindingMappingPS3(11)=(ProfileSettingName="GamepadBinding_LeftThumbstickPressed",UE3BindingName="XboxTypeS_LeftThumbstick") ProfileSettingToUE3BindingMappingPS3(12)=(ProfileSettingName="GamepadBinding_DPadUp",UE3BindingName="XboxTypeS_DPad_Up") ProfileSettingToUE3BindingMappingPS3(13)=(ProfileSettingName="GamepadBinding_DPadDown",UE3BindingName="XboxTypeS_DPad_Down") ProfileSettingToUE3BindingMappingPS3(14)=(ProfileSettingName="GamepadBinding_DPadLeft",UE3BindingName="XboxTypeS_DPad_Left") ProfileSettingToUE3BindingMappingPS3(15)=(ProfileSettingName="GamepadBinding_DPadRight",UE3BindingName="XboxTypeS_DPad_Right") bConsolePlayer=true } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |