UnrealScript Game Programming Cookbook
Weapons 168 Load up your map with a few bots on it, hold your aiming reticule over it for a brief moment and when you hear the l ...
Chapter 6 169 First, we define the pawn that is being hit. Then, it takes the ProcessInstantHit() function and rather than have ...
Weapons 170 How it works... By overriding UTWeapon's ProcessInstantHit(), we remove its default functionality of performing dama ...
Chapter 6 171 How to do it... We're only going to add one function to this class. Just as we did with our healing weapon, we ne ...
Weapons 172 Next we use a standard SetTimer() function, which you will find is frequently used throughout UDK. We're telling the ...
Chapter 6 173 Our PoisonCoundown variable, which we created in the preceding code, is now being used as well. Each time the func ...
Weapons 174 Adding a flashlight to a weapon Flashlights have been man's best friend to combat darkness since the invention of el ...
Chapter 6 175 Start off by declaring a variable to reference our WeaponFlashlight. var WeaponFlashlight Flashlight; We also n ...
Weapons 176 UpdateEyeHeight() takes Deltatime as a parameter and updates each frame. With Flashlight.SetRotation() we set the ro ...
Chapter 6 177 ;-------------------------------------------------------- .Bindings=(Name="GBA_ToggleFlashlight" ,Command="ToggleF ...
Weapons 178 Getting ready Open your IDE and start by creating a new class called ExplosiveBarrel and have it extend from Dynamic ...
Chapter 6 179 var() SoundCue SoundOnDestroy; /** Particles to play when destroyed. */ var() ParticleSystem ParticlesOnDestroy; / ...
Weapons 180 simulated function RespawnDestructible() { // Turns off fire/smoke particles PSC.DeactivateSystem(); // Reset static ...
Chapter 6 181 } //Generate fire particle after object destruction if(ParticlesOnDestroy != None) { PSC = WorldInfo.MyEmitterPool ...
Weapons 182 This would be an excellent time to add more functionality to this, such as having the mesh fracture into pieces. UDK ...
Chapter 6 183 if( Vehicle(Other) != None ) { // If a vehicle touches it... if(bDestroyOnVehicleTouch) { // Explode Explode(); } ...
Weapons 184 SoundOnDestroy=SoundCue'A_Character_BodyImpacts. BodyImpacts.A_Character_RobotImpact_BodyExplosion_Cue' MeshOnDestro ...
Chapter 6 185 Like I mentioned earlier, we have hidden a number of properties from the barrel to make a slick interface for our ...
Weapons 186 How it works... We extend our barrel from DynamicSMActor, because we want players to be able to interact with it. Dy ...
Chapter 6 187 defaultproperties { bCollideActors=TRUE bProjTarget=TRUE bPathColliding=FALSE bNoDelete=TRUE Begin Object Name=MyL ...
«
5
6
7
8
9
10
11
12
13
14
»
Free download pdf