UnrealScript Game Programming Cookbook
AI and Navigation 148 How it works... The major benefit of using NavMeshes is that they can provide for more natural movements. ...
6 Weapons In this chapter, we will be covering the following recipes: f Creating a gun that fires homing missiles f Creating a g ...
Weapons 150 Creating a gun that fires homing missiles UDK already has a homing rocket launcher packaged with the dev kit (UTWeap ...
Chapter 6 151 /* How far out should we be considering actors for a lock / var float LockRange; /* How long does the player need ...
Weapons 152 With our variables in place, we can now move onto the weapon's functionality. The InstantFireStartTrace() function ...
Chapter 6 153 return SocketLocation; } /******************************************************** * Overridden from UTWeapon.uc * ...
Weapons 154 We need to have a default state for our weapon to begin with, so we mark it as inactive. /**** Default state. Go ba ...
Chapter 6 155 If our weapon is destroyed or we are destroyed, then we want to prevent the weapon from continuing to lock onto a ...
Weapons 156 if ( Instigator.bNoWeaponFiring) // TRUE indicates that weapon firing is disabled for this pawn { // Used to adjust ...
Chapter 6 157 Immediately after that, we do a trace to see if our missile can hit the target, and check for anything that may be ...
Weapons 158 If we have a possible target, then we note its time mark for locking onto it. If we can lock onto it, then start th ...
Chapter 6 159 /** Otherwise check to see if we have been tracking the pending lock long enough */ else if (PendingLockedTarget = ...
Weapons 160 { if ( bTargetLockingActive && ( WorldInfo.TimeSeconds > LastTargetLockCheckTime + LockCheckTime ) ) { La ...
Chapter 6 161 if (NewLockTarget == None) { // Clear the lock if (bLockedOnTarget) { // No target LockedTarget = None; // Not loc ...
Weapons 162 LastValidTargetTime = 0; PendingLockedTarget = None; LastLockedOnTime = 0; PendingLockedTargetTime = 0; } With all ...
Chapter 6 163 // Otherwise... else { // Use our default projectile return WeaponProjectiles[CurrentFireMode]; } } If we don't ha ...
Weapons 164 Animations=MeshSequenceA Rotation=(Yaw=-16384) FOV=60.0 End Object // PickupMesh Begin Object Name=PickupMesh Skelet ...
Chapter 6 165 Our weapon will use a number of sounds that we didn't previously need, such as locking onto a pawn, as well as lo ...
Weapons 166 Our homing properties section is the bread and butter of our class. This is where you'll alter the default values f ...
Chapter 6 167 MuzzleFlashDuration=0.33 MuzzleFlashLightClass= class'UTGame.UTShockMuzzleFlashLight' CrossHairCoordinates=(U=256, ...
«
4
5
6
7
8
9
10
11
12
13
»
Free download pdf