UnrealScript Game Programming Cookbook
HUD 208 How it works... This is almost identical to our DrawHealthText() function. We add one variable to our DrawAmmoText() fun ...
Chapter 7 209 We need a function to draw the player's name on the screen. /*************************************************** ...
HUD 210 { super.DrawHUD(); DrawHealthText(); DrawPawnNameText(); DrawAmmoText(); } The final step is to add some information pe ...
Chapter 7 211 How it works... This is very similar to our DrawHealthText() and DrawAmmoText() functions. We add two functions to ...
HUD 212 /** Holds the image to use for the crosshair */ var Texture2D CrosshairImage; /** Various colors */ var const color Blac ...
Chapter 7 213 We start by setting the weapon and the weapon's target distance. This is simply used for the Z value when we call ...
HUD 214 Let's add those default properties now. /* Crosshairs - from UTWeapon / // Crosshair image CrosshairImage=Texture2D'UI_ ...
Chapter 7 215 // Crosshair image CrosshairImage=Texture2D'UI_HUD.HUD.UTCrossHairs' // Crosshair location CrossHairCoordinates=(U ...
HUD 216 How it works... We start by declaring a few variables that we'll use on our crosshair. Within our DrawWeaponCrosshair() ...
8 Miscellaneous Recipes In this chapter, we will be covering the following recipes: f Creating an army of companions f Having en ...
Miscellaneous Recipes 218 Getting ready Start by having your IDE open and ready to make some changes. We won't have to create an ...
Chapter 8 219 PostBeginPlay() { .... /** called from UTPawn, spawns the default controller */ SpawnDefaultController(); .... } ...
Miscellaneous Recipes 220 That's all there is to it! Compile the project and watch what happens when you spawn. You'll have thr ...
Chapter 8 221 Having enemies flash quickly as their health decreases Gamers require some sort of feedback each time something ha ...
Miscellaneous Recipes 222 We really only need to add two new functions here, and alter another pre-existing one. Let's add our ...
Chapter 8 223 *****************************************************************/ function PlayHit(float Damage, Controller Insti ...
Miscellaneous Recipes 224 How it works... We create a function called FlashDmgTimer(), which is really just a series of if state ...
Chapter 8 225 local rotator POVRot; // If we have no controller, we simply use our rotation POVRot = Rotation; // If our Pitch i ...
Miscellaneous Recipes 226 // We simply use our rotation POVRot = Rotation; // If our Pitch is 0, then use RemoveViewPitch if( PO ...
Chapter 8 227 We start by defining our local variables. We set MyPawnOwner to be the pawn that the HUD is currently drawn for. O ...
«
5
6
7
8
9
10
11
12
13
14
»
Free download pdf