Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

UTGame.UTVehicle_DarkWalker


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
/**
 *
 * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved.
 */

class UTVehicle_DarkWalker extends UTVehicle_Walker
	native(Vehicle)
	abstract;

var repnotify byte TurretFlashCount;
var repnotify rotator TurretWeaponRotation;
var byte TurretFiringMode;

var particleSystem BeamTemplate;

/** Holds the Emitter for the Beam */
var ParticleSystemComponent BeamEmitter[2];

/** Where to attach the Beam */
var name BeamSockets[2];

/** The name of the EndPoint parameter */
var name EndPointParamName;

var protected AudioComponent BeamAmbientSound;
var SoundCue BeamFireSound;

var float WarningConeMaxRadius;
var float LengthDarkWalkerWarningCone;
var AudioComponent WarningConeSound;
var name ConeParam;

var ParticleSystemComponent EffectEmitter;

var actor LastHitActor;

var bool bIsBeamActive;

/** radius to allow players under this darkwalker to gain entry */
var float CustomEntryRadius;

/** When asleep, monitor distance below darkwalker to make sure it isn't in the air. */
var float LastSleepCheckDistance;

/** Disable aggressive sleeping behaviour. */
var bool bSkipAggresiveSleep;

var float CustomGravityScaling;

/** @hack: replicated copy of bHoldingDuck for clients */
var bool bIsDucking;

// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)

replication
{
	if (!bNetOwner)
		bIsDucking;
	if (!IsSeatControllerReplicationViewer(1) || bDemoRecording)
		TurretFlashCount, TurretWeaponRotation;
}

native simulated final function PlayWarningSoundIfInCone(Pawn Target);

simulated function PostBeginPlay()
{
	super.PostBeginPlay();
	AddBeamEmitter();
	SetTimer(1.0, TRUE, 'SleepCheckGroundDistance');
}

simulated event Destroyed()
{
	super.Destroyed();
	KillBeamEmitter();
	ClearTimer('SleepCheckGroundDistance');
}

simulated function SleepCheckGroundDistance()
{
	local vector HitLocation, HitNormal;
	local actor HitActor;
	local float SleepCheckDistance;

	bSkipAggresiveSleep = FALSE;

	if(!bDriving && !Mesh.RigidBodyIsAwake())
	{
		HitActor = Trace(HitLocation, HitNormal, Location - vect(0,0,1000), Location, TRUE);

		SleepCheckDistance = 1000.0;
		if(HitActor != None)
		{
			SleepCheckDistance = VSize(HitLocation - Location);
		}

		// If distance has changed, wake it
		if(Abs(SleepCheckDistance - LastSleepCheckDistance) > 10.0)
		{
			Mesh.WakeRigidBody();
			bSkipAggresiveSleep = TRUE;
			LastSleepCheckDistance = SleepCheckDistance;
		}
	}
}

simulated function AddBeamEmitter()
{
	local int i;
	if (WorldInfo.NetMode != NM_DedicatedServer)
	{
		for (i=0;i<2;i++)
		{
			if (BeamEmitter[i] == None)
			{
				if (BeamTemplate != None)
				{
					BeamEmitter[i] = new(Outer) class'UTParticleSystemComponent';
					BeamEmitter[i].SetTemplate(BeamTemplate);
					BeamEmitter[i].SecondsBeforeInactive=1.0f;
					BeamEmitter[i].SetHidden(true);
					Mesh.AttachComponentToSocket( BeamEmitter[i],BeamSockets[i] );
				}
			}
			else
			{
				BeamEmitter[i].ActivateSystem();
			}
		}
	}
}

simulated function KillBeamEmitter()
{
	local int i;
	for (i=0;i<2;i++)
	{
		if (BeamEmitter[i] != none)
		{
			//BeamEmitter[i].SetHidden(true);
			BeamEmitter[i].DeactivateSystem();
		}
	}
}

simulated function SetBeamEmitterHidden(bool bHide)
{
	local int i;

	if (bHide && EffectEmitter != None)
	{
		EffectEmitter.SetActive(false);
	}
	if ( WorldInfo.NetMode != NM_DedicatedServer )
	{
		if (bIsBeamActive != !bHide )
		{
			for (i=0; i<2; i++)
			{
					if (BeamEmitter[i] != none)
					{
						if(!bHide)
							BeamEmitter[i].SetHidden(bHide);
						else
							BeamEmitter[i].DeactivateSystem();
					}

					if (!bHide)
					{
						BeamAmbientSound.SoundCue = BeamFireSound;
						BeamAmbientSound.Play();
						BeamEmitter[i].ActivateSystem();
					}
					else
					{
						BeamAmbientSound.FadeOut(0.3f, 0.f);
					}
			}
		}
		bIsBeamActive = !bHide;
	}
}

/**
 * Detect the transition from vehicle to ground and vice versus and handle it
 */

simulated function actor FindWeaponHitNormal(out vector HitLocation, out Vector HitNormal, vector End, vector Start, out TraceHitInfo HitInfo)
{
	local Actor NewHitActor;

	NewHitActor = Super.FindWeaponHitNormal(HitLocation, HitNormal, End, Start, HitInfo);
	if (NewHitActor != LastHitActor && EffectEmitter != None)
	{
		EffectEmitter.SetActive(false);
	}
	LastHitActor = NewHitActor;
	return NewHitActor;
}


simulated function SpawnImpactEmitter(vector HitLocation, vector HitNormal, const out MaterialImpactEffect ImpactEffect, int SeatIndex)
{
	local rotator TmpRot;

	TmpRot = rotator(HitNormal);
	TmpRot.Pitch = NormalizeRotAxis(TmpRot.Pitch - 16384);

	if (EffectEmitter == None)
	{
		EffectEmitter = new(self) class'ParticleSystemComponent';
		EffectEmitter.SetTemplate(ImpactEffect.ParticleTemplate);
		EffectEmitter.SetAbsolute(true, true, true);
		EffectEmitter.SetScale(0.7);
		AttachComponent(EffectEmitter);
	}

	EffectEmitter.SetTranslation(HitLocation);
	EffectEmitter.SetRotation(TmpRot);
	EffectEmitter.SetActive(true);
}

simulated function VehicleWeaponImpactEffects(vector HitLocation, int SeatIndex)
{
	local int i;

	Super.VehicleWeaponImpactEffects(HitLocation, SeatIndex);

	if ( SeatIndex == 0 )
	{
		SetBeamEmitterHidden(false);
		for(i=0;i<2;i++)
		{
			BeamEmitter[i].SetVectorParameter(EndPointParamName, HitLocation);
		}
	}
}

simulated function VehicleWeaponStoppedFiring( bool bViaReplication, int SeatIndex )
{
	if (SeatIndex == 0)
	{
		SetBeamEmitterHidden(true);
	}
}

/** notification from WalkerBody that foot just landed */
function TookStep(int LegIdx)
{
	EyeStepOffset = MaxEyeStepOffset * FMin(1.0,VSize(Velocity)/AirSpeed);
}

function PassengerLeave(int SeatIndex)
{
	Super.PassengerLeave(SeatIndex);

	SetDriving(NumPassengers() > 0);
}

function bool PassengerEnter(Pawn P, int SeatIndex)
{
	local bool b;

	b = Super.PassengerEnter(P, SeatIndex);
	SetDriving(NumPassengers() > 0);
	return b;
}

simulated function VehicleCalcCamera(float DeltaTime, int SeatIndex, out vector out_CamLoc, out rotator out_CamRot, out vector CamStart, optional bool bPivotOnly)
{
	local UTPawn P;

	if (SeatIndex == 1)
	{
		// Handle the fixed view
		P = UTPawn(Seats[SeatIndex].SeatPawn.Driver);
		if (P != None && P.bFixedView)
		{
			out_CamLoc = P.FixedViewLoc;
			out_CamRot = P.FixedViewRot;
			return;
		}

		out_CamLoc = GetCameraStart(SeatIndex);
		CamStart = out_CamLoc;
		out_CamRot = Seats[SeatIndex].SeatPawn.GetViewRotation();
		return;
	}

	Super.VehicleCalcCamera(DeltaTime, SeatIndex, out_CamLoc, out_CamRot, CamStart, bPivotOnly);
}


/**
*  Overloading this from SVehicle to avoid torquing the walker head.
*/
function AddVelocity( vector NewVelocity, vector HitLocation, class<DamageType> DamageType, optional TraceHitInfo HitInfo )
{
	// apply hit at location, not hitlocation
	Super.AddVelocity(NewVelocity, Location, DamageType, HitInfo);
}

/**
  * Let pawns standing under me get in, if I have a driver.
  */
function bool InCustomEntryRadius(Pawn P)
{
	return ( (P.Location.Z < Location.Z) && (VSize2D(P.Location - Location) < CustomEntryRadius)
		&& FastTrace(P.Location, Location) );
}

event WalkerDuckEffect();

simulated function BlowupVehicle()
{
	local vector Impulse;
	Super.BlowupVehicle();
	Impulse = Velocity; //LastTakeHitInfo;
	Impulse.Z = 0;
	if(IsZero(Impulse))
	{
		Impulse = vector(Rotation); // forward if no velocity.
	}
	Impulse *= 4000/VSize(Impulse);
	Mesh.SetRBLinearVelocity(Impulse);
	Mesh.SetRBAngularVelocity(VRand()*5, true);
	bStayUpright = false;
	bCanFlip=true;
}

simulated function bool ShouldClamp()
{
	return false;
}

//=================================
// AI Interface

function bool ImportantVehicle()
{
	return true;
}

function bool RecommendLongRangedAttack()
{
	return true;
}

defaultproperties
{
   LengthDarkWalkerWarningCone=7500.000000
   CustomEntryRadius=300.000000
   CustomGravityScaling=0.900000
   WheelSuspensionTravel(1)=600.000000
   WheelSuspensionTravel(3)=153.000000
   Begin Object Class=RB_Handle Name=RB_BodyHandle ObjName=RB_BodyHandle Archetype=RB_Handle'UTGame.Default__UTVehicle_Walker:RB_BodyHandle'
      LinearStiffness=99000.000000
      AngularDamping=100.000000
      AngularStiffness=99000.000000
      ObjectArchetype=RB_Handle'UTGame.Default__UTVehicle_Walker:RB_BodyHandle'
   End Object
   BodyHandle=RB_BodyHandle
   LegTraceZUpAmount=700.000000
   HoverAdjust(1)=-280.000000
   HoverAdjust(3)=-63.000000
   SuspensionTravelAdjustSpeed=250.000000
   MaxEyeStepOffset=48.000000
   EyeStepFadeRate=2.000000
   EyeStepBlendRate=2.000000
   bHasCustomEntryRadius=True
   bShouldAutoCenterViewPitch=False
   bFindGroundExit=False
   bIsNecrisVehicle=True
   Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment ObjName=MyLightEnvironment Archetype=DynamicLightEnvironmentComponent'UTGame.Default__UTVehicle_Walker:MyLightEnvironment'
      ObjectArchetype=DynamicLightEnvironmentComponent'UTGame.Default__UTVehicle_Walker:MyLightEnvironment'
   End Object
   LightEnvironment=MyLightEnvironment
   RespawnTime=45.000000
   MaxDesireability=1.250000
   ObjectiveGetOutDist=750.000000
   HornIndex=3
   VehicleIndex=1
   VehiclePositionString="in a Darkwalker"
   VehicleNameString="Darkwalker"
   NeedToPickUpAnnouncement=(AnnouncementText="Man the Darkwalker")
   HUDExtent=250.000000
   SpawnRadius=125.000000
   ChargeBarPosX=3.000000
   ChargeBarPosY=4.000000
   TeamBeaconOffset=(X=0.000000,Y=0.000000,Z=350.000000)
   LookForwardDist=40.000000
   HoverBoardAttachSockets(0)="HoverAttach00"
   HoverBoardAttachSockets(1)="HoverAttach01"
   ExtraReachDownThreshold=450.000000
   HeroBonus=2.000000
   GreedCoinBonus=6
   Begin Object Class=UTVehicleSimHover Name=SimObject ObjName=SimObject Archetype=UTVehicleSimHover'UTGame.Default__UTVehicleSimHover'
      bDisableWheelsWhenOff=False
      bCanClimbSlopes=True
      MaxThrustForce=600.000000
      MaxReverseForce=600.000000
      LongDamping=0.300000
      MaxStrafeForce=600.000000
      LatDamping=0.300000
      TurnTorqueFactor=9000.000000
      TurnTorqueMax=10000.000000
      TurnDamping=3.000000
      MaxYawRate=1.600000
      PitchTorqueMax=35.000000
      PitchDamping=0.100000
      RollTorqueMax=50.000000
      RollDamping=0.100000
      RandForceInterval=1000.000000
      bFullThrustOnDirectionChange=True
      bStabilizeStops=True
      HardLimitAirSpeedScale=1.500000
      WheelSuspensionStiffness=100.000000
      WheelSuspensionDamping=40.000000
      Name="SimObject"
      ObjectArchetype=UTVehicleSimHover'UTGame.Default__UTVehicleSimHover'
   End Object
   SimObj=SimObject
   Begin Object Class=UTHoverWheel Name=RThruster ObjName=RThruster Archetype=UTHoverWheel'UTGame.Default__UTHoverWheel'
      bCollidesVehicles=False
      SteerFactor=1.000000
      BoneName="BodyRoot"
      BoneOffset=(X=0.000000,Y=0.000000,Z=-20.000000)
      WheelRadius=70.000000
      SuspensionTravel=20.000000
      LongSlipFactor=0.000000
      LatSlipFactor=0.000000
      HandbrakeLongSlipFactor=0.000000
      HandbrakeLatSlipFactor=0.000000
      Name="RThruster"
      ObjectArchetype=UTHoverWheel'UTGame.Default__UTHoverWheel'
   End Object
   Wheels(0)=RThruster
   COMOffset=(X=0.000000,Y=0.000000,Z=150.000000)
   bStayUpright=True
   bUseSuspensionAxis=True
   Begin Object Class=RB_StayUprightSetup Name=MyStayUprightSetup_13 ObjName=MyStayUprightSetup_13 Archetype=RB_StayUprightSetup'UTGame.Default__UTVehicle_Walker:MyStayUprightSetup'
      Name="MyStayUprightSetup_13"
      ObjectArchetype=RB_StayUprightSetup'UTGame.Default__UTVehicle_Walker:MyStayUprightSetup'
   End Object
   StayUprightConstraintSetup=RB_StayUprightSetup'UTGame.Default__UTVehicle_DarkWalker:MyStayUprightSetup_13'
   Begin Object Class=RB_ConstraintInstance Name=MyStayUprightConstraintInstance_13 ObjName=MyStayUprightConstraintInstance_13 Archetype=RB_ConstraintInstance'UTGame.Default__UTVehicle_Walker:MyStayUprightConstraintInstance'
      Name="MyStayUprightConstraintInstance_13"
      ObjectArchetype=RB_ConstraintInstance'UTGame.Default__UTVehicle_Walker:MyStayUprightConstraintInstance'
   End Object
   StayUprightConstraintInstance=RB_ConstraintInstance'UTGame.Default__UTVehicle_DarkWalker:MyStayUprightConstraintInstance_13'
   bTurnInPlace=True
   bFollowLookDir=True
   bDuckObstacles=True
   bIgnoreStallZ=True
   bCanStrafe=True
   MeleeRange=-100.000000
   GroundSpeed=350.000000
   AirSpeed=350.000000
   BaseEyeHeight=0.000000
   EyeHeight=0.000000
   Health=1000
   Begin Object Class=SkeletalMeshComponent Name=SVehicleMesh ObjName=SVehicleMesh Archetype=SkeletalMeshComponent'UTGame.Default__UTVehicle_Walker:SVehicleMesh'
      RBCollideWithChannels=(Untitled1=True)
      ObjectArchetype=SkeletalMeshComponent'UTGame.Default__UTVehicle_Walker:SVehicleMesh'
   End Object
   Mesh=SVehicleMesh
   Begin Object Class=CylinderComponent Name=CollisionCylinder ObjName=CollisionCylinder Archetype=CylinderComponent'UTGame.Default__UTVehicle_Walker:CollisionCylinder'
      ObjectArchetype=CylinderComponent'UTGame.Default__UTVehicle_Walker:CollisionCylinder'
   End Object
   CylinderComponent=CollisionCylinder
   Components(0)=CollisionCylinder
   Components(1)=SVehicleMesh
   Components(2)=MyLightEnvironment
   Components(3)=RB_BodyHandle
   Components(4)=SimObject
   CollisionComponent=SVehicleMesh
   Name="Default__UTVehicle_DarkWalker"
   ObjectArchetype=UTVehicle_Walker'UTGame.Default__UTVehicle_Walker'
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: tr 31-1-2018 17:18:28.000 - Creation time: sk 18-3-2018 10:01:28.568 - Created with UnCodeX