UnrealScript Game Programming Cookbook
Miscellaneous Recipes 228 We then draw a debug line so that we can see the trace. The line takes our start trace and end trace a ...
Chapter 8 229 We set the crosshair to be in the center of the trace by taking its screen position and subtracting half of the cr ...
Miscellaneous Recipes 230 How it works... We need to set our base aim rotator to use our point of view. We do this by overriding ...
Chapter 8 231 CrosshairSize = 28 * (Canvas.ClipY / 768) * (Canvas.ClipX /1024); Canvas.SetDrawColor(100,100,128,255); // Crossha ...
Miscellaneous Recipes 232 Compile the project and see for yourself. If you run your crosshair over another pawn it will turn ye ...
Chapter 8 233 How to do it... Start by creating a new class which will be our actual debug menu. Have it extend from CheatManag ...
Miscellaneous Recipes 234 { CurrentPage = -1; // Starts on main page CurrentIndex = 0; bShowDebugMenu = !bShowDebugMenu; // Disa ...
Chapter 8 235 We define the maximum number of pages available, as shown by IndexMax, and changing its value depending on how far ...
Miscellaneous Recipes 236 else { ToggleDebug(); // Can't go any further, so back out } } } The following code should be added to ...
Chapter 8 237 foreach CommandDebugPages(page,index_array) { // For the currently selected item in the array... if (index_array = ...
Miscellaneous Recipes 238 TutorialHUD(H).DrawDebugText(index_array$": "@command.CommandName,vect2d(0,YPos), H.Canvas.Font,cmnd_c ...
Chapter 8 239 CommandDebugPages(2)=(PageName="Collision | Pathfinding", PageCommands[0]= (CommandName=" Show Collision",Command= ...
Miscellaneous Recipes 240 We need to create the DrawDebugText() function in our TestHUD class which is called by DrawDebugMenu( ...
Chapter 8 241 Compile the project and load your map. Hit the H key when it loads and take a look at your new debug menu! How i ...
Miscellaneous Recipes 242 Drawing a bounding box around pawns If you've ever played Eidos' excellent Deux Ex before, then you sh ...
Chapter 8 243 This occurs in our PostRender() function within our TutorialHUD class. Let's add the variables we'll need right n ...
Miscellaneous Recipes 244 Using the if (HitActor.IsA()) statement, we can place our bounding box around any actor in UDK. Replac ...
Chapter 8 245 ActualWidth = (ActorBB.Max.X - ActorBB.Min.X) * 0.4f; ActualHeight = (ActorBB.Max.Y - ActorBB.Min.Y) * 0.4f; /** D ...
Miscellaneous Recipes 246 The top-right corner sets our position to use the maximum X value from our ActorBB variable and subtra ...
Chapter 8 247 /* grabs the bounding box for the specified actor / Actor.GetComponentsBoundingBox(CompBBox); / X1, Y1 */ Bounding ...
«
5
6
7
8
9
10
11
12
13
14
»
Free download pdf