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 00248 00249 00250 00251 00252 00253 00254 00255 00256 00257 00258 00259 00260 00261 00262 00263 00264 00265 00266 00267 00268 00269 00270 00271 00272 00273 00274 00275 00276 00277 00278 00279 00280 00281 00282 00283 00284 00285 00286 00287 00288 00289 00290 00291 00292 00293 00294 00295 00296 00297 00298 00299 00300 00301 |
/** * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved. */ class UTVehicle_StealthBender extends UTStealthVehicle native(Vehicle) abstract; /** One material for each team on the 'tail' section of the stealthbender */ var MaterialInterface SecondaryTeamSkins[2]; simulated event PostBeginPlay() { super.PostBeginPlay(); PlayVehicleAnimation('Inactive'); } simulated function CreateDamageMaterialInstance() { //Damaged MIC for the 'tail' DamageMaterialInstance[1] = Mesh.CreateAndSetMaterialInstanceConstant(1); super.CreateDamageMaterialInstance(); } /** * This function returns the aim for the weapon * overloaded here to take into account the stealthbender turret is not near the camera */ function rotator GetWeaponAim(UTVehicleWeapon VWeapon) { local vector SocketLocation, CameraLocation, RealAimPoint, DesiredAimPoint, HitLocation, HitRotation, DirA, DirB; local rotator CameraRotation, SocketRotation, ControllerAim, AdjustedAim; local float DiffAngle, MaxAdjust; local Controller C; local PlayerController PC; local Quat Q; if ( VWeapon != none ) { C = Seats[VWeapon.SeatIndex].SeatPawn.Controller; PC = PlayerController(C); if (PC != None) { PC.GetPlayerViewPoint(CameraLocation, CameraRotation); DesiredAimPoint = CameraLocation + Vector(CameraRotation) * 2.0 * VWeapon.GetTraceRange(); if (Trace(HitLocation, HitRotation, DesiredAimPoint, CameraLocation) != None) { DesiredAimPoint = HitLocation; } } else if (C != None) { DesiredAimPoint = C.FocalPoint; } if ( Seats[VWeapon.SeatIndex].GunSocket.Length>0 ) { GetBarrelLocationAndRotation(VWeapon.SeatIndex, SocketLocation, SocketRotation); if(VWeapon.bIgnoreSocketPitchRotation || ((DesiredAimPoint.Z - Location.Z)<0 && VWeapon.bIgnoreDownwardPitch)) { SocketRotation.Pitch = Rotator(DesiredAimPoint - Location).Pitch; } } else { SocketLocation = Location; SocketRotation = Rotator(DesiredAimPoint - Location); } RealAimPoint = SocketLocation + Vector(SocketRotation) * VWeapon.GetTraceRange(); DirA = normal(DesiredAimPoint - SocketLocation); DirB = normal(RealAimPoint - SocketLocation); DiffAngle = ( DirA dot DirB ); MaxAdjust = VWeapon.GetMaxFinalAimAdjustment(); if ( DiffAngle >= MaxAdjust ) { // bit of a hack here to make bot aiming and single player autoaim work ControllerAim = (C != None) ? C.Rotation : Rotation; AdjustedAim = VWeapon.GetAdjustedAim(SocketLocation); if (AdjustedAim == VWeapon.Instigator.GetBaseAimRotation() || AdjustedAim == ControllerAim) { // no adjustment return rotator(DesiredAimPoint - SocketLocation); } else { // FIXME: AdjustedAim.Pitch = Instigator.LimitPitch(AdjustedAim.Pitch); return AdjustedAim; } } else { Q = QuatFromAxisAndAngle(Normal(DirB cross DirA), ACos(MaxAdjust)); return Rotator( QuatRotateVector(Q,DirB)); } } else { return Rotation; } } /** * function cloaks or decloaks the vehicle. */ simulated function ToggleCloak() { //Cloak the tail piece of the vehicle if ( WorldInfo.NetMode != NM_DedicatedServer ) { // cloaking! if(bIsVehicleCloaked && Mesh.Materials[1] != CloakedBodyMIC) { //Same material as the main body Mesh.SetMaterial(1, CloakedBodyMIC); UpdateShadowSettings( FALSE ); DynamicLightEnvironmentComponent(Mesh.LightEnvironment).bCastShadows = FALSE; } // decloaking else if(!bIsVehicleCloaked && Mesh.Materials[1] != DamageMaterialInstance[1]) { //Back to secondary material for the tail Mesh.SetMaterial(1, DamageMaterialInstance[1]); UpdateShadowSettings(!class'Engine'.static.IsSplitScreen() && class'UTPlayerController'.Default.PawnShadowMode == SHADOW_All); DynamicLightEnvironmentComponent(Mesh.LightEnvironment).bCastShadows = TRUE; } } super.ToggleCloak(); } /** Override set inputs so get direct information when deployed. */ simulated function SetInputs(float InForward, float InStrafe, float InUp) { if(IsDeployed()) { Super(Vehicle).SetInputs(InForward,InStrafe,InUp); } else { Super(UTVehicle).SetInputs(InForward,InStrafe,InUp); } } simulated function TeamChanged() { local MaterialInterface NewMaterial; if (WorldInfo.NetMode != NM_DedicatedServer) { if (Team < 2 && SecondaryTeamSkins[Team] != None) { NewMaterial = SecondaryTeamSkins[Team]; } else if (SecondaryTeamSkins[0] != None) { NewMaterial = SecondaryTeamSkins[0]; } //Always reparent the DamageMIC if (NewMaterial != None) { if (DamageMaterialInstance[1] != None) { DamageMaterialInstance[1].SetParent(NewMaterial); } } //If we aren't cloaked, set the 'visible' skin if(Mesh.Materials[1] != CloakedBodyMIC) { Mesh.SetMaterial(1, DamageMaterialInstance[1]); } } super.TeamChanged(); } defaultproperties { VisibleGroundSpeed=900.000000 VisibleAirSpeed=1000.000000 VisibleMaxSpeed=1300.000000 CloakedSpeedModifier=0.450000 SlowSpeed=300.000000 DeployCheckDistance=375.000000 bStickDeflectionThrottle=True bLookSteerOnNormalControls=True bLookSteerOnSimpleControls=True bReducedFallingCollisionDamage=True DeflectionReverseThresh=-0.300000 Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment ObjName=MyLightEnvironment Archetype=DynamicLightEnvironmentComponent'UTGame.Default__UTStealthVehicle:MyLightEnvironment' ObjectArchetype=DynamicLightEnvironmentComponent'UTGame.Default__UTStealthVehicle:MyLightEnvironment' End Object LightEnvironment=MyLightEnvironment RespawnTime=45.000000 ObjectiveGetOutDist=1500.000000 HornIndex=1 VehicleIndex=12 LookSteerSensitivity=2.200000 LookSteerDamping=0.040000 ConsoleSteerScale=0.900000 StolenAnnouncementIndex=5 VehiclePositionString="in a StealthBender" VehicleNameString="StealthBender" NeedToPickUpAnnouncement=(AnnouncementText="Man the StealthBender") SpawnRadius=125.000000 TeamBeaconOffset=(X=0.000000,Y=0.000000,Z=60.000000) Begin Object Class=UTVehicleSimHellbender Name=SimObject ObjName=SimObject Archetype=UTVehicleSimHellbender'UTGame.Default__UTVehicleSimHellbender' Name="SimObject" ObjectArchetype=UTVehicleSimHellbender'UTGame.Default__UTVehicleSimHellbender' End Object SimObj=SimObject Begin Object Class=UTVehicleHellbenderWheel Name=RRWheel ObjName=RRWheel Archetype=UTVehicleHellbenderWheel'UTGame.Default__UTVehicleHellbenderWheel' SkelControlName="Rt_Rear_Control" BoneName="Rt_Rear_Tire" BoneOffset=(X=0.000000,Y=42.000000,Z=0.000000) LatSlipFactor=2.000000 Name="RRWheel" ObjectArchetype=UTVehicleHellbenderWheel'UTGame.Default__UTVehicleHellbenderWheel' End Object Wheels(0)=RRWheel Begin Object Class=UTVehicleHellbenderWheel Name=LRWheel ObjName=LRWheel Archetype=UTVehicleHellbenderWheel'UTGame.Default__UTVehicleHellbenderWheel' SkelControlName="Lt_Rear_Control" BoneName="Lt_Rear_Tire" BoneOffset=(X=0.000000,Y=-42.000000,Z=0.000000) LatSlipFactor=2.000000 Name="LRWheel" ObjectArchetype=UTVehicleHellbenderWheel'UTGame.Default__UTVehicleHellbenderWheel' End Object Wheels(1)=LRWheel Begin Object Class=UTVehicleHellbenderWheel Name=RFWheel ObjName=RFWheel Archetype=UTVehicleHellbenderWheel'UTGame.Default__UTVehicleHellbenderWheel' SteerFactor=1.000000 SkelControlName="RT_Front_Control" BoneName="Rt_Front_Tire" BoneOffset=(X=0.000000,Y=42.000000,Z=0.000000) LatSlipFactor=2.000000 HandbrakeLongSlipFactor=0.800000 HandbrakeLatSlipFactor=0.800000 Name="RFWheel" ObjectArchetype=UTVehicleHellbenderWheel'UTGame.Default__UTVehicleHellbenderWheel' End Object Wheels(2)=RFWheel Begin Object Class=UTVehicleHellbenderWheel Name=LFWheel ObjName=LFWheel Archetype=UTVehicleHellbenderWheel'UTGame.Default__UTVehicleHellbenderWheel' SteerFactor=1.000000 SkelControlName="Lt_Front_Control" BoneName="Lt_Front_Tire" BoneOffset=(X=0.000000,Y=-42.000000,Z=0.000000) LatSlipFactor=2.000000 HandbrakeLongSlipFactor=0.800000 HandbrakeLatSlipFactor=0.800000 Name="LFWheel" ObjectArchetype=UTVehicleHellbenderWheel'UTGame.Default__UTVehicleHellbenderWheel' End Object Wheels(3)=LFWheel COMOffset=(X=0.000000,Y=0.000000,Z=-55.000000) bCanFlip=True Begin Object Class=RB_StayUprightSetup Name=MyStayUprightSetup_7 ObjName=MyStayUprightSetup_7 Archetype=RB_StayUprightSetup'UTGame.Default__UTStealthVehicle:MyStayUprightSetup' Name="MyStayUprightSetup_7" ObjectArchetype=RB_StayUprightSetup'UTGame.Default__UTStealthVehicle:MyStayUprightSetup' End Object StayUprightConstraintSetup=RB_StayUprightSetup'UTGame.Default__UTVehicle_StealthBender:MyStayUprightSetup_7' Begin Object Class=RB_ConstraintInstance Name=MyStayUprightConstraintInstance_7 ObjName=MyStayUprightConstraintInstance_7 Archetype=RB_ConstraintInstance'UTGame.Default__UTStealthVehicle:MyStayUprightConstraintInstance' Name="MyStayUprightConstraintInstance_7" ObjectArchetype=RB_ConstraintInstance'UTGame.Default__UTStealthVehicle:MyStayUprightConstraintInstance' End Object StayUprightConstraintInstance=RB_ConstraintInstance'UTGame.Default__UTVehicle_StealthBender:MyStayUprightConstraintInstance_7' HeavySuspensionShiftPercent=0.200000 MaxSpeed=1300.000000 UprightLiftStrength=500.000000 UprightTorqueStrength=400.000000 bSeparateTurretFocus=True bHasHandbrake=True MomentumMult=1.000000 NonPreferredVehiclePathMultiplier=2.000000 GroundSpeed=900.000000 AirSpeed=1000.000000 BaseEyeHeight=0.000000 EyeHeight=0.000000 Health=600 Begin Object Class=SkeletalMeshComponent Name=SVehicleMesh ObjName=SVehicleMesh Archetype=SkeletalMeshComponent'UTGame.Default__UTStealthVehicle:SVehicleMesh' ObjectArchetype=SkeletalMeshComponent'UTGame.Default__UTStealthVehicle:SVehicleMesh' End Object Mesh=SVehicleMesh Begin Object Class=CylinderComponent Name=CollisionCylinder ObjName=CollisionCylinder Archetype=CylinderComponent'UTGame.Default__UTStealthVehicle:CollisionCylinder' ObjectArchetype=CylinderComponent'UTGame.Default__UTStealthVehicle:CollisionCylinder' End Object CylinderComponent=CollisionCylinder ViewPitchMin=-13000.000000 Components(0)=CollisionCylinder Components(1)=SVehicleMesh Components(2)=MyLightEnvironment Components(3)=SimObject CollisionComponent=SVehicleMesh Name="Default__UTVehicle_StealthBender" ObjectArchetype=UTStealthVehicle'UTGame.Default__UTStealthVehicle' } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |