sega 500 the ut2k3 gunsmith jeff “ezeikeil” giles [email protected] jgiles

50
Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles [email protected]

Upload: edward-sullivan

Post on 17-Dec-2015

218 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Sega 500

The UT2K3 Gunsmith

Jeff “Ezeikeil” [email protected]://gamestudies.cdis.org/~jgiles

Page 2: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Last day

We wrapped up states & state programming.

Learned how objects can exist in different states & how they can have different functionality and effects for each.

Page 3: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Today

Were going to desend into the one of the core elements that makes UT2k3 what it is.

We’re going to build our own, unique, stand alone weapon.

Page 4: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

This is not for the faint of heart, after poking around the forums, this looks like it’s causing lots of people some headaches.

To top it off, the weapon functionality has *completely* changed from the previous version of Unreal Tournament.

Page 5: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

The previous version was fairly straight forward in that it had very limited dependencies on other classes.

Usually limited to the weapon, ammo and projectile classes…

Page 6: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

This is no longer the case. For UT2k3, by my count, to get a unique

stand alone weapon you require a minimum of 8 classes.

Yes…EIGHT!

Page 7: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

Now, it’s true that you can radically change the functionality of a weapon in less…but that’s now what we want here.

In order to truly understand what’s going on with the weapons, and have a unique toy to play with, we need to build it from scratch.

Page 8: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

So our goal for today is not to build all the functionality for a completely unique weapon, but to cover all the bases of what’s required to build one.

We’ll do that tomorrow.

Page 9: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

So why the heck then does UT need to have 8 classes to get a weapon to function.

Consider all the parts we have to reference. Weapon

Inventory & pickup Ammo

Inventory & pickup Projectile

Type, fire class & damage type Attachment class

Page 10: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Object dependencies for the weapon

The Parent class is in brackets

Page 11: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

With this many inter dependant classes, explaining how one relates to another is a bit tricky, so bare with me…

Page 12: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

So the first thing to look at is all the parent classes that we’ll need to derive from…

Starting with Weaponclass BoomStick extends Weapon;

This class contains all the core functionality for the weapon operate.

Page 13: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

It’s an abstract class, so one can never instantiate a “weapon”, we must deriver from it.

It’s also huge, open it up & you’ll find all the functionality which is common to and required by all weapons in UT.

Page 14: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

Cut & paste the defaults from the link gun and change some defaults

DefaultProperties{ ItemName="BoomStick"

FireModeClass(0)=BoomFire //what we shoot FireModeClass(1)=BoomFire //the pickup item which spawns this to our inventory PickupClass=class'BoomStickPickup' ... Mesh=mesh'Weapons.LinkGun_1st' //which mesh to use… AttachmentClass=class'BoomAttach' //attachement class}

Page 15: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

From here, we’ll just step through the changes we made in the weapon defaults & see where it takes us.

The next change was the FireModeClass. Ours is very simple…

Page 16: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

In essence, defining what we shoot.

class BoomFire extends BioFire;

DefaultProperties{ AmmoClass=class'BoomAmmo' // what type of ammo to use ProjectileClass=class'Eze.BoomProj' //what projectile to spawn}

Page 17: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

Now, notice something rather important. There are 2 types for base fire classes, PojectileFire and Instantfire.

Using Instantfire is a bit more tricky, so we’re going to stick to projectiles for today.

Page 18: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

The next thing to set up is the ammo type we which to use:

class BoomAmmo extends Ammunition;

DefaultProperties{ ItemName="Boomstick shells" //our name IconMaterial=Material'InterfaceContent.Hud.SkinA' IconCoords=(X1=545,Y1=75,X2=644,Y2=149)

PickupClass=class'BoomAmmoPickup' // what our ammo pickup class is MaxAmmo=50 InitialAmount=20}

Page 19: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

And the ammo pickup class used by our weapon:

class BoomAmmoPickup extends UTAmmoPickup;

DefaultProperties{ InventoryType=class'BoomAmmo' //what item to create in inventory

PickupMessage="You picked up some BOOM-stick ammo" PickupSound=Sound'PickupSounds.FlakAmmoPickup' PickupForce="FlakAmmoPickup" // jdf… StaticMesh=StaticMesh'WeaponStaticMesh.BioAmmoPickup' //mesh to use DrawType=DT_StaticMesh}

Page 20: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

Recall how the inventory system works.

When you pickup an item, it spawns a different item in your inventory for use by the player.

Page 21: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

In this case:

This is why we have the double arrow in the diagram.

BoomAmmoPickup creates the BoomAmmo inventory item,

And the BoomAmmo knows what item creates it.

Page 22: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

Moving back to the projectilefire object, we also define a projectile type.

Essentially, not much more than what projectile to create.

class BoomProj extends BioGlob;

DefaultProperties{ //our damage class MyDamageType=class'DamTypeBoomStick‘}

Page 23: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

We now have our damage class which is specific to this projectile.

class DamTypeBoomStick extends WeaponDamageType;

defaultproperties{ //death messages to the player DeathString="%o bought %k's S-Mart special." MaleSuicide="%o ate his own boomstick" FemaleSuicide="%o ate her own boomstick"

//what weapon class causes this message WeaponClass=class'BoomStick'}

Page 24: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

This leads us back to the weapon, which has two other important classes.

The pickupclass,

and the attachement

Page 25: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

How the item appears in the world before pickup & what item it spawns into the players inventory

Page 26: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

class BoomStickPickup extends UTWeaponPickup;

DefaultProperties{ //item created in inventory InventoryType=class'BoomStick' //pickup message displayed to the player PickupMessage="BoomStick!!!" PickupSound=Sound'PickupSounds.FlakCannonPickup' PickupForce="BoomStickPickup"

MaxDesireability=+0.7 //mesh & draw type to use StaticMesh=StaticMesh'WeaponStaticMesh.LinkGunPickup' DrawType=DT_StaticMesh DrawScale=0.75}

Page 27: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

Finally, the attachment class

DefaultProperties

{

//how the weapon appears in 3rd person

Mesh=mesh'Weapons.LinkGun_3rd'

}

Page 28: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

Also in the ThirdPersonEffects function, I changed the muzzle flash type to

simulated event ThirdPersonEffects()

{ …//some code <snip>

MuzFlash3rd = Spawn(class'XEffects.RocketMuzFlash3rd');

Page 29: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

Okay, at this point we’ve templated out our weapon and (hopefully) covered all the bases.

We should get a customize linkgun which fires bioglobs (BoomProj actually…but we kept most of the functionality), has its own damage types and attachments to the pawn.

Page 30: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

Run UT, pull down the console and type:

You must call the pickup class, or nothing will appear.

Summon yourPackage.Boomstickpickup

Page 31: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

This is what should appear.

Yup! That the linkgun mesh…As expected.

Page 32: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

Walk over it like any other pickup.

Cool! It’s our pickup message from the BoomStickPickup class.

Page 33: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

Fire some goo

He-HEY! It works Now for the final test.

Suicide by my own hand.

Page 34: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

Even better, our own death messages.

Page 35: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

To summon the ammo pickups pull the console again & type

Summon yourPackage.BoomAmmoPickup

Your weapon now functions on it’s own ammo type…not the biogoo.

Page 36: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

However you can now also use the weapon placement items in the editor. It will appear there too.

Page 37: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

Using the editor…

Boomstick ammo xWeaponsBase which now acceptsThe Boomstick as a Valid weapon

Yes, they look like regular UT pickups…but they are ours

Page 38: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

Lastly, to be 100% complete, we need to set up our int’s so that our weapon appears in the menus.

Page 39: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

Starting with the weapon declaration in your packages int:

This will allow the weapon along with a description to be displayed in the menu.

[Public]Object=(Class=Class,MetaClass=Engine.Weapon,Name=eze.BoomStick, Description="Ezeikeil's custom boomstick... Shop smart... Shop S-mart.")

Page 40: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

For the ammo pickups:

[BoomAmmo]ItemName="Boomstick shells"

[BoomAmmoPickup]PickupMessage="You picked up some BOOM-stick ammo"

Page 41: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

The weapon itself:

[Boomstick]ItemName="Boomstick"

[BoomstickPickup]PickupMessage="Boomstick!!!"

Page 42: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

And the damage messages

[DamTypeBoomStick]DeathString="%o bought %k's S-Mart special."MaleSuicide="%o ate his own boomstick"FemaleSuicide="%o ate her own boomstick"

Page 43: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

This is important to know for 2 reasons.

First, the int file overrides the specified parameter listed in that class…

Page 44: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

Second, this provides an easy one-stop-shop to make changes to the messages displayed to the screen, without changing the code…handy for internationalization of the product.

Page 45: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

Exactly what is the int doing? Look at the boomstick, this can also be read as:

[Boomstick]

ItemName="Boomstick"

Class name

Variable nameValue

Page 46: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

This should make int files clear as mud right?

It’s just a matter of figuring out where things live.

The net result…

Page 47: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

My weapon

My weapon model

My description

Page 48: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

And all the other values we set will appear during gameplay.

Page 49: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Gunsmithing for UT

Ok, earth shattering functionality this isn’t, but look at what we do have…

We’ve mapped and templated all the basic steps that are required to create your own weapons in UT2k3.

Page 50: Sega 500 The UT2K3 Gunsmith Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

That’s a wrap

That’s all for today. However, customizing the weapons in UT

is sufficiently complicated that we’ll spend the rest of the class building our own.

Consider this an in class assignment. Tomorrow, we’ll start making some

changes to the weapons functionality.