@elhant1
if i separate the following PZ commands for the roll pitch and yaw, UDK will read them as bad expressions.
I dont see anything wrong with this now but UDK still doesnt read these codes correctly. The PZ commands always shows up as bad expression..
Maybe you could suggest a better coding for my vehicle.uc? maybe i should delete some of those? And yes, its for the mouse.
if i separate the following PZ commands for the roll pitch and yaw, UDK will read them as bad expressions.
Code:
class UTVehicle_SpaceShip extends UTAirVehicle; /* etc */ var float AR_MaxLift, AR_TurnSpeed, AR_Speed, AR_CurrentForward, AR_AddedLiftSpeed, AR_Acceleration; /* etc */ simulated function AirRaidKinematics(float DeltaTime) { local Vector AR_ForceApplication, AR_ForceRotation, AR_ForwardsNormal, AR_UpwardsNormal, AR_SidewardsNormal; local Vector AR_ForceRotationVectX, AR_ForceRotationVectY, AR_ForceRotationVectZ; local float AR_Lift, AR_ForwardSpeed, AR_NewRise; // While there is a player in the biplane: if (PlayerController(Controller) != None) { GetAxes(Rotation, AR_ForwardsNormal, AR_SidewardsNormal, AR_UpwardsNormal); // Roll PZ_ForceRotationVectX *= 800 * Rise; // PZ_NewRise is between -1 and 1 // Pitch PZ_ForceRotationVectY *= 30 * -PlayerController(Controller).PlayerInput.aMouseY / 100; // Yaw PZ_ForceRotationVectZ *= 30 * PlayerController(Controller).PlayerInput.aMouseX / 100; // The magic happens here ---- Forward PZ_ForceApplication = PZ_ForwardsNormal * Throttle * 6000; AR_CurrentForward += AR_Acceleration * Throttle; AR_ForwardSpeed = AR_CurrentForward * 2.2; // AR_ForwardSpeed is not necessarily true - I'd optimally need to use some // calculation based off Velocity and current forwards direction Vector... // Calculate lift for the biplane: AR_Lift = (AR_ForwardSpeed + AR_AddedLiftSpeed) * Abs(Cos(Rotation.Pitch)); if (AR_Lift > AR_MaxLift) AR_Lift = AR_MaxLift; // This gives lift upwards relative to its up-axis and push forwards relative to its forward-axis: AR_ForceApplication.X = AR_UpwardsNormal.X * AR_Lift + AR_CurrentForward * AR_ForwardsNormal.X; AR_ForceApplication.Y = AR_UpwardsNormal.Y * AR_Lift + AR_CurrentForward * AR_ForwardsNormal.Y; AR_ForceApplication.Z = AR_UpwardsNormal.Z * AR_Lift + AR_CurrentForward * AR_ForwardsNormal.Z; // Add forces and rotations Mesh.AddForce(AR_ForceApplication); Mesh.AddTorque(AR_ForceRotation); } else { AR_CurrentForward = AR_Speed; // Biplane propellor thrust sets to default } } simulated function Tick(float DeltaTime) { AirRaidKinematics(DeltaTime); Super.Tick(DeltaTime); } /* etc */ defaultproperties { Begin Object Class=UDKVehicleSimChopper Name=SimObject MaxThrustForce=700.0 MaxReverseForce=700.0 LongDamping=0.6 MaxStrafeForce=680.0 LatDamping=0.7 MaxRiseForce=1000.0 UpDamping=0.7 TurnTorqueFactor=7000.0 TurnTorqueMax=10000.0 TurnDamping=1.2 MaxYawRate=1.8 PitchTorqueFactor=450.0 PitchTorqueMax=60.0 PitchDamping=0.3 RollTorqueTurnFactor=700.0 RollTorqueStrafeFactor=100.0 RollTorqueMax=300.0 RollDamping=0.1 MaxRandForce=30.0 RandForceInterval=0.5 StopThreshold=100 bShouldCutThrustMaxOnImpact=true End Object SimObj=SimObject Components.Add(SimObject) COMOffset=(X=-40,Z=-50.0) BaseEyeheight=30 Eyeheight=30 bRotateCameraUnderVehicle=false CameraLag=0.05 LookForwardDist=290.0 bLimitCameraZLookingUp=true AirSpeed=2000.0 GroundSpeed=1600.0 UprightLiftStrength=30.0 UprightTorqueStrength=30.0 bStayUpright=true StayUprightRollResistAngle=5.0 StayUprightPitchResistAngle=5.0 StayUprightStiffness=1200 StayUprightDamping=20 bRollToDesired = true // ## VITAL CODE: enables rolling of the pawn AirSpeed = 380.0 // maximum speed AccelRate = 800.0 // acceleration speed SpawnRadius=180.0 RespawnTime=45.0 bOverrideAVRiLLocks=true PushForce=50000.0 HUDExtent=140.0 HornIndex=0 }
Maybe you could suggest a better coding for my vehicle.uc? maybe i should delete some of those? And yes, its for the mouse.
Comment