UnrealScript Game Programming Cookbook
...
4 Crafting Pickups In this chapter, we will be covering the following recipes: f Creating our first pickup f Creating a base for ...
Crafting Pickups 90 Moving is one of the categories in which actions for AI fall into, while the other is anything that is not m ...
Chapter 4 91 Fortunately, UDK has provided a great template for us to work from, so we'll be using what they've provided and mak ...
Crafting Pickups 92 Creating our first pickup We're going to create our first pickup by extending from one of the excellent ones ...
Chapter 4 93 How to do it... In the defaultproperties block at the bottom of your class, add the following code: // How many ro ...
Crafting Pickups 94 Next, we need to add the light environment for our pickup. Write this code in your defaultproperties block: ...
Chapter 4 95 Compile the code and launch the editor. Within the Actor Classes browser, make sure that none of the boxes are che ...
Crafting Pickups 96 With that done we now have a pickup that we can drag-and-drop into an editor. Drag your archetype onto the ...
Chapter 4 97 Adding a base mesh to a pickup is a great way to emphasize that a particular pickup is important. By adding a base ...
Crafting Pickups 98 Beneath that block, let's add some code for our particle effect: defaultproperties { .... /** Particle cla ...
Chapter 4 99 How it works... All game-related objects are derived from the base class, Actor, in the Unreal Engine. ActorCompone ...
Crafting Pickups 100 /** How fast should it bob */ BobSpeed=1.0 /** How far to bob. It will go from +/- this number */ BobOffset ...
Chapter 4 101 How to do it... This is a bit more complicated than our previous recipes. We'll have to create a new pickup class ...
Crafting Pickups 102 Finally, we're going to add the static mesh code for the pickup and the base, along with the particle syst ...
Chapter 4 103 Search for the name of our new pickup class, Tut_HealthPickup, and when it appears, right-click on it to see the ...
Crafting Pickups 104 With our newly created archetype ready, we can now drag-and-drop it into the editor's window and see the r ...
Chapter 4 105 Allowing vehicles to use a pickup By default, vehicles in UDK cannot make use of pickups. If you had a game that r ...
Crafting Pickups 106 /** Vehicle's skeletal mesh. What you actually see in the game and editor */ Begin Object Name=SVehicleMesh ...
Chapter 4 107 MaxDesireability=0.700000 /** How much this pickup will heal the vehicle for */ HealingAmount=20 /** The sound eff ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf