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 00302 00303 00304 00305 00306 00307 00308 00309 00310 00311 00312 00313 00314 00315 00316 00317 00318 00319 00320 00321 00322 00323 00324 00325 00326 00327 00328 00329 00330 00331 00332 00333 00334 00335 00336 00337 00338 00339 00340 00341 00342 00343 00344 00345 00346 00347 00348 00349 00350 00351 00352 00353 00354 00355 00356 00357 00358 00359 00360 00361 00362 00363 00364 00365 00366 00367 00368 00369 00370 00371 00372 00373 00374 00375 00376 00377 00378 00379 00380 00381 00382 00383 00384 00385 00386 00387 00388 00389 00390 00391 00392 00393 00394 00395 00396 00397 00398 00399 00400 00401 00402 00403 00404 00405 00406 00407 00408 00409 00410 00411 00412 00413 00414 00415 00416 00417 00418 00419 00420 00421 00422 00423 00424 00425 00426 00427 00428 00429 00430 00431 00432 00433 00434 00435 00436 00437 00438 00439 00440 00441 00442 00443 00444 00445 00446 00447 00448 00449 00450 00451 00452 00453 00454 00455 00456 00457 00458 00459 00460 00461 00462 00463 00464 00465 00466 00467 00468 00469 00470 00471 00472 00473 00474 00475 00476 00477 00478 00479 00480 00481 00482 00483 00484 00485 00486 00487 00488 00489 00490 00491 00492 |
//----------------------------------------------------------- // //----------------------------------------------------------- class ONSAttackCraft extends ONSChopperCraft placeable; #exec OBJ LOAD FILE=..\textures\VMVehicles-TX.utx var() float MaxPitchSpeed; var() array<vector> TrailEffectPositions; var class<ONSAttackCraftExhaust> TrailEffectClass; var array<ONSAttackCraftExhaust> TrailEffects; var() array<vector> StreamerEffectOffset; var class<ONSAttackCraftStreamer> StreamerEffectClass; var array<ONSAttackCraftStreamer> StreamerEffect; var() range StreamerOpacityRamp; var() float StreamerOpacityChangeRate; var() float StreamerOpacityMax; var float StreamerCurrentOpacity; var bool StreamerActive; // AI hint function bool FastVehicle() { return true; } function bool Dodge(eDoubleClickDir DoubleClickMove) { if ( FRand() < 0.7 ) { VehicleMovingTime = Level.TimeSeconds + 1; Rise = 1; } return false; } function KDriverEnter(Pawn P) { bHeadingInitialized = False; Super.KDriverEnter(P); } simulated function ClientKDriverEnter(PlayerController PC) { bHeadingInitialized = False; Super.ClientKDriverEnter(PC); } simulated function SpecialCalcBehindView(PlayerController PC, out actor ViewActor, out vector CameraLocation, out rotator CameraRotation ) { local vector CamLookAt, HitLocation, HitNormal, OffsetVector; local Actor HitActor; local vector x, y, z; if (DesiredTPCamDistance < TPCamDistance) TPCamDistance = FMax(DesiredTPCamDistance, TPCamDistance - CameraSpeed * (Level.TimeSeconds - LastCameraCalcTime)); else if (DesiredTPCamDistance > TPCamDistance) TPCamDistance = FMin(DesiredTPCamDistance, TPCamDistance + CameraSpeed * (Level.TimeSeconds - LastCameraCalcTime)); GetAxes(PC.Rotation, x, y, z); ViewActor = self; CamLookAt = GetCameraLocationStart() + (TPCamLookat >> Rotation) + TPCamWorldOffset; OffsetVector = vect(0, 0, 0); OffsetVector.X = -1.0 * TPCamDistance; CameraLocation = CamLookAt + (OffsetVector >> PC.Rotation); HitActor = Trace(HitLocation, HitNormal, CameraLocation, Location, true, vect(40, 40, 40)); if ( HitActor != None && (HitActor.bWorldGeometry || HitActor == GetVehicleBase() || Trace(HitLocation, HitNormal, CameraLocation, Location, false, vect(40, 40, 40)) != None) ) CameraLocation = HitLocation; CameraRotation = Normalize(PC.Rotation + PC.ShakeRot); CameraLocation = CameraLocation + PC.ShakeOffset.X * x + PC.ShakeOffset.Y * y + PC.ShakeOffset.Z * z; } function Died(Controller Killer, class<DamageType> damageType, vector HitLocation) { local int i; if(Level.NetMode != NM_DedicatedServer) { for(i=0;i<TrailEffects.Length;i++) TrailEffects[i].Destroy(); TrailEffects.Length = 0; for(i=0; i<StreamerEffect.Length; i++) StreamerEffect[i].Destroy(); StreamerEffect.Length = 0; } Super.Died(Killer, damageType, HitLocation); } simulated function Destroyed() { local int i; if(Level.NetMode != NM_DedicatedServer) { for(i=0;i<TrailEffects.Length;i++) TrailEffects[i].Destroy(); TrailEffects.Length = 0; for(i=0; i<StreamerEffect.Length; i++) StreamerEffect[i].Destroy(); StreamerEffect.Length = 0; } Super.Destroyed(); } simulated event DrivingStatusChanged() { local vector RotX, RotY, RotZ; local int i; Super.DrivingStatusChanged(); if (bDriving && Level.NetMode != NM_DedicatedServer && !bDropDetail) { GetAxes(Rotation,RotX,RotY,RotZ); if (TrailEffects.Length == 0) { TrailEffects.Length = TrailEffectPositions.Length; for(i=0;i<TrailEffects.Length;i++) if (TrailEffects[i] == None) { TrailEffects[i] = spawn(TrailEffectClass, self,, Location + (TrailEffectPositions[i] >> Rotation) ); TrailEffects[i].SetBase(self); TrailEffects[i].SetRelativeRotation( rot(0,32768,0) ); } } if (StreamerEffect.Length == 0) { StreamerEffect.Length = StreamerEffectOffset.Length; for(i=0; i<StreamerEffect.Length; i++) if (StreamerEffect[i] == None) { StreamerEffect[i] = spawn(StreamerEffectClass, self,, Location + (StreamerEffectOffset[i] >> Rotation) ); StreamerEffect[i].SetBase(self); } } } else { if (Level.NetMode != NM_DedicatedServer) { for(i=0;i<TrailEffects.Length;i++) TrailEffects[i].Destroy(); TrailEffects.Length = 0; for(i=0; i<StreamerEffect.Length; i++) StreamerEffect[i].Destroy(); StreamerEffect.Length = 0; } } } simulated function Tick(float DeltaTime) { local float EnginePitch, DesiredOpacity, DeltaOpacity, MaxOpacityChange, ThrustAmount; local TrailEmitter T; local int i; local vector RelVel; local bool NewStreamerActive, bIsBehindView; local PlayerController PC; if(Level.NetMode != NM_DedicatedServer) { EnginePitch = 64.0 + VSize(Velocity)/MaxPitchSpeed * 32.0; SoundPitch = FClamp(EnginePitch, 64, 96); RelVel = Velocity << Rotation; PC = Level.GetLocalPlayerController(); if (PC != None && PC.ViewTarget == self) bIsBehindView = PC.bBehindView; else bIsBehindView = True; // Adjust Engine FX depending on being drive/velocity if (!bIsBehindView) { for(i=0; i<TrailEffects.Length; i++) TrailEffects[i].SetThrustEnabled(false); } else { ThrustAmount = FClamp(OutputThrust, 0.0, 1.0); for(i=0; i<TrailEffects.Length; i++) { TrailEffects[i].SetThrustEnabled(true); TrailEffects[i].SetThrust(ThrustAmount); } } // Update streamer opacity (limit max change speed) DesiredOpacity = (RelVel.X - StreamerOpacityRamp.Min)/(StreamerOpacityRamp.Max - StreamerOpacityRamp.Min); DesiredOpacity = FClamp(DesiredOpacity, 0.0, StreamerOpacityMax); MaxOpacityChange = DeltaTime * StreamerOpacityChangeRate; DeltaOpacity = DesiredOpacity - StreamerCurrentOpacity; DeltaOpacity = FClamp(DeltaOpacity, -MaxOpacityChange, MaxOpacityChange); if(!bIsBehindView) StreamerCurrentOpacity = 0.0; else StreamerCurrentOpacity += DeltaOpacity; if(StreamerCurrentOpacity < 0.01) NewStreamerActive = false; else NewStreamerActive = true; for(i=0; i<StreamerEffect.Length; i++) { if(NewStreamerActive) { if(!StreamerActive) { T = TrailEmitter(StreamerEffect[i].Emitters[0]); T.ResetTrail(); } StreamerEffect[i].Emitters[0].Disabled = false; StreamerEffect[i].Emitters[0].Opacity = StreamerCurrentOpacity; } else { StreamerEffect[i].Emitters[0].Disabled = true; StreamerEffect[i].Emitters[0].Opacity = 0.0; } } StreamerActive = NewStreamerActive; } Super.Tick(DeltaTime); } function float ImpactDamageModifier() { local float Multiplier; local vector X, Y, Z; GetAxes(Rotation, X, Y, Z); if (ImpactInfo.ImpactNorm Dot Z > 0) Multiplier = 1-(ImpactInfo.ImpactNorm Dot Z); else Multiplier = 1.0; return Super.ImpactDamageModifier() * Multiplier; } function bool RecommendLongRangedAttack() { return true; } //FIXME Fix to not be specific to this class after demo function bool PlaceExitingDriver() { local int i; local vector tryPlace, Extent, HitLocation, HitNormal, ZOffset; Extent = Driver.default.CollisionRadius * vect(1,1,0); Extent *= 2; Extent.Z = Driver.default.CollisionHeight; ZOffset = Driver.default.CollisionHeight * vect(0,0,1); if (Trace(HitLocation, HitNormal, Location + (ZOffset * 6), Location, false, Extent) != None) return false; //avoid running driver over by placing in direction perpendicular to velocity if ( VSize(Velocity) > 100 ) { tryPlace = Normal(Velocity cross vect(0,0,1)) * (CollisionRadius + Driver.default.CollisionRadius ) * 1.25 ; if ( FRand() < 0.5 ) tryPlace *= -1; //randomly prefer other side if ( (Trace(HitLocation, HitNormal, Location + tryPlace + ZOffset, Location + ZOffset, false, Extent) == None && Driver.SetLocation(Location + tryPlace + ZOffset)) || (Trace(HitLocation, HitNormal, Location - tryPlace + ZOffset, Location + ZOffset, false, Extent) == None && Driver.SetLocation(Location - tryPlace + ZOffset)) ) return true; } for( i=0; i<ExitPositions.Length; i++) { if ( ExitPositions[0].Z != 0 ) ZOffset = Vect(0,0,1) * ExitPositions[0].Z; else ZOffset = Driver.default.CollisionHeight * vect(0,0,2); if ( bRelativeExitPos ) tryPlace = Location + ( (ExitPositions[i]-ZOffset) >> Rotation) + ZOffset; else tryPlace = ExitPositions[i]; // First, do a line check (stops us passing through things on exit). if ( bRelativeExitPos && Trace(HitLocation, HitNormal, tryPlace, Location + ZOffset, false, Extent) != None ) continue; // Then see if we can place the player there. if ( !Driver.SetLocation(tryPlace) ) continue; return true; } return false; } static function StaticPrecache(LevelInfo L) { Super.StaticPrecache(L); L.AddPrecacheStaticMesh(StaticMesh'ONSDeadVehicles-SM.RAPTORexploded.RaptorWing'); L.AddPrecacheStaticMesh(StaticMesh'ONSDeadVehicles-SM.RAPTORexploded.RaptorTailWing'); L.AddPrecacheStaticMesh(StaticMesh'ONSDeadVehicles-SM.RAPTORexploded.RaptorGun'); L.AddPrecacheStaticMesh(StaticMesh'AW-2004Particles.Debris.Veh_Debris2'); L.AddPrecacheStaticMesh(StaticMesh'AW-2004Particles.Debris.Veh_Debris1'); L.AddPrecacheStaticMesh(StaticMesh'WeaponStaticMesh.RocketProj'); L.AddPrecacheMaterial(Material'AW-2004Particles.Energy.SparkHead'); L.AddPrecacheMaterial(Material'ExplosionTex.Framed.exp2_frames'); L.AddPrecacheMaterial(Material'ExplosionTex.Framed.exp1_frames'); L.AddPrecacheMaterial(Material'ExplosionTex.Framed.we1_frames'); L.AddPrecacheMaterial(Material'AW-2004Particles.Weapons.SmokePanels2'); L.AddPrecacheMaterial(Material'AW-2004Particles.Fire.NapalmSpot'); L.AddPrecacheMaterial(Material'EpicParticles.Fire.SprayFire1'); L.AddPrecacheMaterial(Material'VMVehicles-TX.AttackCraftGroup.RaptorColorRed'); L.AddPrecacheMaterial(Material'VMVehicles-TX.AttackCraftGroup.RaptorColorBlue'); L.AddPrecacheMaterial(Material'VMVehicles-TX.AttackCraftGroup.AttackCraftNoColor'); L.AddPrecacheMaterial(Material'AW-2004Particles.Weapons.TrailBlura'); L.AddPrecacheMaterial(Material'Engine.GRADIENT_Fade'); L.AddPrecacheMaterial(Material'VMVehicles-TX.AttackCraftGroup.raptorCOLORtest'); L.AddPrecacheMaterial(Material'AW-2004Particles.Fire.SmokeFragment'); } simulated function UpdatePrecacheStaticMeshes() { Level.AddPrecacheStaticMesh(StaticMesh'ONSDeadVehicles-SM.RAPTORexploded.RaptorWing'); Level.AddPrecacheStaticMesh(StaticMesh'ONSDeadVehicles-SM.RAPTORexploded.RaptorTailWing'); Level.AddPrecacheStaticMesh(StaticMesh'ONSDeadVehicles-SM.RAPTORexploded.RaptorGun'); Level.AddPrecacheStaticMesh(StaticMesh'AW-2004Particles.Debris.Veh_Debris2'); Level.AddPrecacheStaticMesh(StaticMesh'AW-2004Particles.Debris.Veh_Debris1'); Level.AddPrecacheStaticMesh(StaticMesh'WeaponStaticMesh.RocketProj'); Super.UpdatePrecacheStaticMeshes(); } simulated function UpdatePrecacheMaterials() { Level.AddPrecacheMaterial(Material'AW-2004Particles.Energy.SparkHead'); Level.AddPrecacheMaterial(Material'ExplosionTex.Framed.exp2_frames'); Level.AddPrecacheMaterial(Material'ExplosionTex.Framed.exp1_frames'); Level.AddPrecacheMaterial(Material'ExplosionTex.Framed.we1_frames'); Level.AddPrecacheMaterial(Material'AW-2004Particles.Weapons.SmokePanels2'); Level.AddPrecacheMaterial(Material'AW-2004Particles.Fire.NapalmSpot'); Level.AddPrecacheMaterial(Material'EpicParticles.Fire.SprayFire1'); Level.AddPrecacheMaterial(Material'VMVehicles-TX.AttackCraftGroup.RaptorColorRed'); Level.AddPrecacheMaterial(Material'VMVehicles-TX.AttackCraftGroup.RaptorColorBlue'); Level.AddPrecacheMaterial(Material'VMVehicles-TX.AttackCraftGroup.AttackCraftNoColor'); Level.AddPrecacheMaterial(Material'AW-2004Particles.Weapons.TrailBlura'); Level.AddPrecacheMaterial(Material'Engine.GRADIENT_Fade'); Level.AddPrecacheMaterial(Material'VMVehicles-TX.AttackCraftGroup.raptorCOLORtest'); Level.AddPrecacheMaterial(Material'AW-2004Particles.Fire.SmokeFragment'); Super.UpdatePrecacheMaterials(); } defaultproperties { MaxPitchSpeed=2000.000000 TrailEffectPositions(0)=(X=-148.000000,Y=-26.000000,Z=51.000000) TrailEffectPositions(1)=(X=-148.000000,Y=26.000000,Z=51.000000) TrailEffectClass=Class'Onslaught.ONSAttackCraftExhaust' StreamerEffectOffset(0)=(X=-219.000000,Y=-35.000000,Z=57.000000) StreamerEffectOffset(1)=(X=-219.000000,Y=35.000000,Z=57.000000) StreamerEffectOffset(2)=(X=-52.000000,Y=-24.000000,Z=142.000000) StreamerEffectOffset(3)=(X=-52.000000,Y=24.000000,Z=142.000000) StreamerEffectClass=Class'Onslaught.ONSAttackCraftStreamer' StreamerOpacityRamp=(Min=1200.000000,Max=1600.000000) StreamerOpacityChangeRate=1.000000 StreamerOpacityMax=0.700000 UprightStiffness=500.000000 UprightDamping=300.000000 MaxThrustForce=100.000000 LongDamping=0.050000 MaxStrafeForce=80.000000 LatDamping=0.050000 MaxRiseForce=50.000000 UpDamping=0.050000 TurnTorqueFactor=600.000000 TurnTorqueMax=200.000000 TurnDamping=50.000000 MaxYawRate=1.500000 PitchTorqueFactor=200.000000 PitchTorqueMax=35.000000 PitchDamping=20.000000 RollTorqueTurnFactor=450.000000 RollTorqueStrafeFactor=50.000000 RollTorqueMax=50.000000 RollDamping=30.000000 StopThreshold=100.000000 MaxRandForce=3.000000 RandForceInterval=0.750000 DriverWeapons(0)=(WeaponClass=Class'Onslaught.ONSAttackCraftGun',WeaponBone="PlasmaGunAttachment") RedSkin=Shader'VMVehicles-TX.AttackCraftGroup.AttackCraftChassisFinalRED' BlueSkin=Shader'VMVehicles-TX.AttackCraftGroup.AttackCraftChassisFInalBLUE' IdleSound=Sound'ONSVehicleSounds-S.AttackCraft.AttackCraftIdle' StartUpSound=Sound'ONSVehicleSounds-S.AttackCraft.AttackCraftStartUp' ShutDownSound=Sound'ONSVehicleSounds-S.AttackCraft.AttackCraftShutDown' StartUpForce="AttackCraftStartUp" ShutDownForce="AttackCraftShutDown" DestroyedVehicleMesh=StaticMesh'ONSDeadVehicles-SM.AttackCraftDead' DestructionEffectClass=Class'Onslaught.ONSVehicleExplosionEffect' DisintegrationEffectClass=Class'Onslaught.ONSVehDeathAttackCraft' DestructionLinearMomentum=(Min=50000.000000,Max=150000.000000) DestructionAngularMomentum=(Min=100.000000,Max=300.000000) DamagedEffectOffset=(X=-120.000000,Y=10.000000,Z=65.000000) ImpactDamageMult=0.001000 HeadlightCoronaOffset(0)=(X=76.000000,Y=14.000000,Z=-24.000000) HeadlightCoronaOffset(1)=(X=76.000000,Y=-14.000000,Z=-24.000000) HeadlightCoronaMaterial=Texture'EpicParticles.Flares.FlashFlare1' HeadlightCoronaMaxSize=60.000000 VehicleMass=4.000000 bTurnInPlace=Wahr bShowDamageOverlay=Wahr bDriverHoldsFlag=Falsch bCanCarryFlag=Falsch ExitPositions(0)=(Y=-165.000000,Z=100.000000) ExitPositions(1)=(Y=165.000000,Z=100.000000) EntryPosition=(X=-40.000000) EntryRadius=210.000000 TPCamDistance=500.000000 TPCamLookat=(X=0.000000,Z=0.000000) TPCamWorldOffset=(Z=200.000000) DriverDamageMult=0.000000 VehiclePositionString="in a Raptor" VehicleNameString="Raptor" RanOverDamageType=Class'Onslaught.DamTypeAttackCraftRoadkill' CrushedDamageType=Class'Onslaught.DamTypeAttackCraftPancake' MaxDesireability=0.600000 FlagBone="PlasmaGunAttachment" FlagOffset=(Z=80.000000) FlagRotation=(Yaw=32768) HornSounds(0)=Sound'ONSVehicleSounds-S.Horns.Horn03' HornSounds(1)=Sound'ONSVehicleSounds-S.Horns.Horn07' GroundSpeed=2000.000000 HealthMax=300.000000 Health=300 Mesh=SkeletalMesh'ONSVehicles-A.AttackCraft' SoundVolume=160 CollisionRadius=150.000000 CollisionHeight=70.000000 Begin Object Class=KarmaParamsRBFull Name=KParams0 KInertiaTensor(0)=1.000000 KInertiaTensor(3)=3.000000 KInertiaTensor(5)=3.500000 KCOMOffset=(X=-0.250000) KLinearDamping=0.000000 KAngularDamping=0.000000 KStartEnabled=Wahr bKNonSphericalInertia=Wahr KActorGravScale=0.000000 bHighDetailOnly=Falsch bClientOnly=Falsch bKDoubleTickRate=Wahr bKStayUpright=Wahr bKAllowRotate=Wahr bDestroyOnWorldPenetrate=Wahr bDoSafetime=Wahr KFriction=0.500000 KImpactThreshold=300.000000 End Object KParams=KarmaParamsRBFull'Onslaught.ONSAttackCraft.KParams0' } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |