UnrealScript Game Programming Cookbook

(Chris Devlin) #1

Weapons


164

Animations=MeshSequenceA
Rotation=(Yaw=-16384)
FOV=60.0
End Object

// PickupMesh
Begin Object Name=PickupMesh
SkeletalMesh=
SkeletalMesh'WP_ShockRifle.Mesh.SK_WP_ShockRifle_3P'
End Object

// Attachment class
AttachmentClass=
class'UTGameContent.UTAttachment_ShockRifle'


  1. Next, we want to declare the type of projectile, the type of damage it does, and the
    frequency at which it can be fired. Moreover, we want to declare that each shot fired
    will only deplete one round from our inventory. We can declare how much ammo the
    weapon starts with too.
    // Defines the type of fire for each mode
    WeaponFireTypes(0)=EWFT_InstantHit
    WeaponFireTypes(1)=EWFT_Projectile
    WeaponProjectiles(1)=class'UTProj_Rocket'


// Damage types
InstantHitDamage(0)=45
FireInterval(0)=+1.0
FireInterval(1)=+1.3
InstantHitDamageTypes(0)=class'UTDmgType_ShockPrimary'
InstantHitDamageTypes(1)=None
// Not an instant hit weapon, so set to "None"

// How much ammo will each shot use?
ShotCost(0)=1
ShotCost(1)=1

// # of ammo gun should start with
AmmoCount=20

// Initial ammo count if weapon is locked
LockerAmmoCount=20

// Max ammo count
MaxAmmoCount=40
Free download pdf