RuneStorm
http://www.runestorm.com/forums/

Make your own Junk Weapons tutorial
http://www.runestorm.com/forums/viewtopic.php?f=19&t=19608
Page 1 of 1

Author:  Captain Xavious [ Mon Nov 20, 2006 7:30 pm ]
Post subject:  Make your own Junk Weapons tutorial

I'll be updating this several times and it'll come in several installments, so check back every once in a while.

Take note: I am making this assuming you have a simple grasp of using the UT engine and the tools used to alter it. If anyone needs further explanation, tell me and I'll break down the steps more.

Also, I'm assuming you have Maya from the ECE UT2004.

Getting the Model into UEd
First, we take a model from Maya (for this example, I'll use an old chainsaw model I had for a while):
[br][img width=800 height=528]../../files/public/1164071909_164_FT0_maya_image_.jpg[/img][br]

The key to making this as simple as possible is to make the handle of your weapon as close to the origin as possible. This makes it much easier to get the lining of the staticmesh in game done quickly and easily.

Also, take note that you will more than likely have to scale your model up a bunch for it to be the proper size in UEd. Typicial I make all of my models about the same scale to each other and I generally am able to scale the models up to about 175 and they're close enough in size that I can easily fine tune the size in the default properties. Remember that if you change the scale, you'll probably have to relocate the handle, too.

After you get it lined up right you just click the export StaticMesh to UEd button (make sure Maya and UEd are opened up and liked together first). Under packages, I'll create a new one and name it JWExample. Under the options on the bottom of the page, check off the world space button, name the model, then click export.

You should probably make a pickup mesh too, but all you really need to do with that is just set the model so its laying flat, than export that one too (with a different name, of course).

To those that don't have a modeling program or just want to follow along step by step, download this package and throw it in your staticmesh folder. It's the exact same thing I am currently using to make this walkthrough. :)
[br]File: [url=../../files/public/1164072264_164_FT0_jw_example.zip]1164072264_164_FT0_jw_example.zip[/url]

Adding The Textures
Sorry, I can't really help you there, I'm horrible at texturing, but I could tell you how to get textures in if you want. So instead, I'll just slap on some default texyures that will more than likely look like crap. :D

Exporting the JunkWar package with UEd.
I exported the JunkWar package with UEd, leaving a folder called JunkWar in the UT2004 folder containing the classes. This should be about it.

If anyone needs me to explain this more, I will.

The coding. Yay. (Actually, this is the easiest part ;))
I used Unreal Development Environment (UDE) for the coding. For this chainsaw, I decided I'm going to use Scythe as a base the simply because similar hit effects for a what I want (they are not close to being perfect for a chainsaw, but the point is that it is easiest to base them around similar weapons, although it is not necessary).

Now to get to the coding. :)
To start out, you should see something like this:

class JO_Chainsaw extends JunkObject;

defaultproperties
{
PickupMesh=StaticMesh'JunkWarHardware.Junk.ScytheLD'
PickupDrawScale=0.400000
SpawnPivot=(Pitch=768)
SpawnOffset=(Z=2.000000)
PickupMessage="You got the Scythe, reaper style"
ThirdPersonDrawScale=0.250000
ThirdPersonMesh=StaticMesh'JunkWarHardware.Junk.Scythe'
HandStyle=HS_TwoHanded
RightGripStyle=GS_DualAverage
LeftGripStyle=GS_DualAverage
PullOutRate=1.500000
PullOutStyle=AS_DualAverage
IdleStyle=AS_DualAverage
PutAwayRate=1.500000
PutAwayStyle=AS_DualAverage
AttachOffset=(X=0.500000,Y=-0.250000,Z=4.000000)
AttachPivot=(Roll=-700)
Begin Object Class=JunkMeleeFireInfo Name=JunkFireInfo0
MeleeRange=(Min=160.000000,Max=160.000000)
SwipeHitWallPoint=3
SwipePoints(0)=(Weight=1,offset=(Pitch=3000,Yaw=6000))
SwipePoints(1)=(Weight=3,offset=(Pitch=2000,Yaw=4000))
SwipePoints(2)=(Weight=5,offset=(Pitch=1000,Yaw=2000))
SwipePoints(3)=(Weight=6)
SwipePoints(4)=(Weight=4,offset=(Pitch=-1000,Yaw=-2000))
SwipePoints(5)=(Weight=2,offset=(Pitch=-2000,Yaw=-4000))
SwipePoints(6)=(offset=(Pitch=-3000,Yaw=-6000))
ImpactManager=Class'JunkWar.IM_JunkScythe'


Damage=(head=(Min=75.000000,Max=110.000000),Limb=(Min=15.000000,Max=25.000000),

Misc=(Min=35.000000,Max=50.000000))
KickForce=12000
DamageType=Class'JunkWar.DTJunkScythe'
RefireTime=0.750000
AnimRate=1.200000
Sound=(Sound=SoundGroup'JunkWarSounds.Icepick.Icepick-Swing')
Anims(0)="Avg2Hit1"
Anims(1)="Avg2Hit2"
Anims(2)="Avg2Hit3"
AnimTimedFire=ATS_Timed
bAnimTimedSound=True
End Object
MeleeAFireInfo=JunkMeleeFireInfo'JunkWar.JO_Scythe.JunkFireInfo0'

Begin Object Class=JunkMeleeFireInfo Name=JunkFireInfo1
MeleeRange=(Min=160.000000,Max=160.000000)
SwipeHitWallPoint=4
SwipePoints(0)=(Weight=7,offset=(Pitch=6000,Yaw=8000))
SwipePoints(1)=(Weight=6,offset=(Pitch=4500,Yaw=6000))
SwipePoints(2)=(Weight=5,offset=(Pitch=3000,Yaw=4000))
SwipePoints(3)=(Weight=4,offset=(Pitch=1500,Yaw=2000))
SwipePoints(4)=(Weight=3)
SwipePoints(5)=(Weight=2,offset=(Pitch=-1500,Yaw=-2000))
SwipePoints(6)=(Weight=1,offset=(Pitch=-3000,Yaw=-4000))
SwipePoints(7)=(offset=(Pitch=-3000,Yaw=-6000))
ImpactManager=Class'JunkWar.IM_JunkScythe'


Damage=(head=(Min=95.000000,Max=125.000000),Limb=(Min=25.000000,Max=30.000000),

Misc=(Min=40.000000,Max=60.000000))
KickForce=35000
DamageType=Class'JunkWar.DTJunkScythe'
RefireTime=0.800000
AnimRate=1.350000
Sound=(Sound=SoundGroup'JunkWarSounds.Icepick.Icepick-Swing')
Anims(0)="Avg2Attack"
PreFireAnims(0)="Avg2PrepAttack"
bFireOnRelease=True
AnimTimedFire=ATS_Timed
End Object
MeleeBFireInfo=JunkMeleeFireInfo'JunkWar.JO_Scythe.JunkFireInfo1'

SelectSound=(Sound=SoundGroup'JunkWarSounds.Misc.Pullout-Avg')
FriendlyName="Scythe"
InventoryGroup=4
MeleeRating=120.000000
RangeRating=0.000000
bDisallowShield=True
PainThreshold=60
NoUseThreshold=110
BlockLeftAnim="Avg2BlockLeft"
BlockRightAnim="Avg2BlockRight"
BlockStartAnim="Avg2PrepBlock"
BlockEndAnim="Avg2EndBlock"
BlockIdleAnim="Avg2BlockIdle"
StaticMesh=StaticMesh'JunkWarHardware.Junk.Scythe'
DrawScale=0.800000
}


Well, that all fine and dandy if you want another Scythe, but thats not what we want, is it? ;)

Here's what we do. First off, we want it to look right, so we'll start by changing

PickupMesh=StaticMesh'JunkWarHardware.Junk.ScytheLD' into

PickupMesh=StaticMesh'JWExample.Chainsaw.ChainsawPickup'.

Basically, this just makes the pickup load as the chainsaw pickup mesh instead of the scythe.
We'll do the same for the other two instances;

ThirdPersonMesh=StaticMesh'JunkWarHardware.Junk.Scythe' to ThirdPersonMesh=StaticMesh'JWExample.Chainsaw.Chainsaw' and StaticMesh=StaticMesh'JunkWarHardware.Junk.Scythe' to ThirdPersonMesh=StaticMesh'JWExample.Chainsaw.Chainsaw'.

Author:  Captain Xavious [ Mon Nov 20, 2006 8:28 pm ]
Post subject:  Make your own Junk Weapons tutorial

Next installment! !lol

Ok, now we should have the chainsaw looking right, so now we can get into some more details.

First off, we need to change the FriendlyName. What this is is basically a label applied to weapon. I'm not sure if it has a profound effect on the coding, but it is used primarily for the users' convienence. Probably oughta change that to something like Chainsaw. Also, change the pickup message to something more fitting too. You can use your imaginaition on this, as this makes no difference other than to add a bit of spice to the game.

Now for getting the animations right. You should see several properties that say something like AS_DualAverage, GS_DualAverage and HS_TwoHanded. Delete the lines that contain them.

Block animations should be fine as is.

Now, under the first weapon info block, you should see the following lines:
Anims(0)="Avg2Hit1"
Anims(1)="Avg2Hit2"
Anims(2)="Avg2Hit3


Change them to:
Anims(0)="WideHit1"
Anims(1)="WideHit2"
Anims(2)="WideHit3"


This'll give them a bigger swing arc, makes it look a bit better.

At the end of that block you'll see the following line:
MeleeAFireInfo=JunkMeleeFireInfo'JunkWar.JO_Scythe.JunkFireInfo0'

You want to change this so it references the current package, so change it to:
MeleeAFireInfo=JunkMeleeFireInfo'JWExample.JO_Chainsaw.JunkFireInfo0'

Go into the second block and change the animations for that one to the appropriate ones. (just change Avg2 into Wide)

You can fiddle with the damage and timing yourself, its pretty self explanitory. One thing that might be of interest though, is the swipe points. This basically defines the path that the weapon will do damage to. I didn't really mess with these much, so I can't say I can be much help yet, but I suggest for now just use the swipe points for weapons with similar swings.

For now, don't worry about the impact manager and damage type. I can't garuntee I'll be able to help you with those yet, either.

Ok, so this looks like its ready to compile. So, compile it, get frustrated for a couple hours over an error only to find out you missed a quotation mark somewhere, and lets get to adding this to the game.

For comparison, this is what you should see:

class JO_Chainsaw extends JunkObject;

defaultproperties
{
PickupMesh=StaticMesh'JWExample.Chainsaw.ChainsawPickup'
PickupDrawScale=0.400000
SpawnPivot=(Pitch=768)
SpawnOffset=(Z=2.000000)
PickupMessage="Chainsaw! Find some meat!"
ThirdPersonDrawScale=0.250000
ThirdPersonMesh=StaticMesh'JWExample.Chainsaw.Chainsaw'
HandStyle=HS_TwoHanded
RightGripStyle=GS_DualAverage
LeftGripStyle=GS_DualAverage
PullOutRate=2.000000
PullOutStyle=AS_DualAverage
IdleStyle=AS_DualAverage
PutAwayRate=1.500000
PutAwayStyle=AS_DualAverage
AttachOffset=(X=0.500000,Y=-0.250000,Z=4.000000)
AttachPivot=(Roll=-700)
Begin Object Class=JunkMeleeFireInfo Name=JunkFireInfo0
MeleeRange=(Min=160.000000,Max=160.000000)
SwipeHitWallPoint=3
SwipePoints(0)=(Weight=1,offset=(Pitch=3000,Yaw=6000))
SwipePoints(1)=(Weight=3,offset=(Pitch=2000,Yaw=4000))
SwipePoints(2)=(Weight=5,offset=(Pitch=1000,Yaw=2000))
SwipePoints(3)=(Weight=6)
SwipePoints(4)=(Weight=4,offset=(Pitch=-1000,Yaw=-2000))
SwipePoints(5)=(Weight=2,offset=(Pitch=-2000,Yaw=-4000))
SwipePoints(6)=(offset=(Pitch=-3000,Yaw=-6000))
ImpactManager=Class'JunkWar.IM_JunkScythe'
Damage=(head=(Min=75.000000,Max=110.000000),Limb=(Min=15.000000,Max=25.000000),Misc=(Min=35.000000,Max=50.000000))
KickForce=12000
DamageType=Class'JunkWar.DTJunkScythe'
RefireTime=0.750000
AnimRate=1.200000
Sound=(Sound=SoundGroup'JunkWarSounds.Icepick.Icepick-Swing')
Anims(0)="Avg2Hit1"
Anims(1)="Avg2Hit2"
Anims(2)="Avg2Hit3"
AnimTimedFire=ATS_Timed
bAnimTimedSound=True
End Object
MeleeAFireInfo=JunkMeleeFireInfo'JunkWar.JO_Scythe.JunkFireInfo0'

Begin Object Class=JunkMeleeFireInfo Name=JunkFireInfo1
MeleeRange=(Min=160.000000,Max=160.000000)
SwipeHitWallPoint=4
SwipePoints(0)=(Weight=7,offset=(Pitch=6000,Yaw=8000))
SwipePoints(1)=(Weight=6,offset=(Pitch=4500,Yaw=6000))
SwipePoints(2)=(Weight=5,offset=(Pitch=3000,Yaw=4000))
SwipePoints(3)=(Weight=4,offset=(Pitch=1500,Yaw=2000))
SwipePoints(4)=(Weight=3)
SwipePoints(5)=(Weight=2,offset=(Pitch=-1500,Yaw=-2000))
SwipePoints(6)=(Weight=1,offset=(Pitch=-3000,Yaw=-4000))
SwipePoints(7)=(offset=(Pitch=-3000,Yaw=-6000))
ImpactManager=Class'JunkWar.IM_JunkScythe'
Damage=(head=(Min=95.000000,Max=125.000000),Limb=(Min=25.000000,Max=30.000000),Misc=(Min=40.000000,Max=60.000000))
KickForce=35000
DamageType=Class'JunkWar.DTJunkScythe'
RefireTime=0.800000
AnimRate=1.350000
Sound=(Sound=SoundGroup'JunkWarSounds.Icepick.Icepick-Swing')
Anims(0)="WideAttack"
PreFireAnims(0)="WidePrepAttack"
bFireOnRelease=True
AnimTimedFire=ATS_Timed
End Object
MeleeBFireInfo=JunkMeleeFireInfo'JunkWar.JO_Scythe.JunkFireInfo1'

SelectSound=(Sound=SoundGroup'JunkWarSounds.Misc.Pullout-Avg')
FriendlyName="Chainsaw"
InventoryGroup=4
MeleeRating=120.000000
RangeRating=0.000000
bDisallowShield=True
PainThreshold=60
NoUseThreshold=110
BlockLeftAnim="Avg2BlockLeft"
BlockRightAnim="Avg2BlockRight"
BlockStartAnim="Avg2PrepBlock"
BlockEndAnim="Avg2EndBlock"
BlockIdleAnim="Avg2BlockIdle"
StaticMesh=StaticMesh'JWExample.Chainsaw.Chainsaw'
DrawScale=0.800000
}


Now, go into your system folder, and find the file named JunkWar.int
Add the following line at the bottom of the list:

Object=(Class=Class,MetaClass=JunkWar.JunkObject,Name=JWExample.JO_Chainsaw)

Save the file, start the game, enable the weapon in JW, and lets see how it works!

Author:  Mr.UglyPants [ Mon Nov 20, 2006 9:30 pm ]
Post subject:  Make your own Junk Weapons tutorial

wonderfully detailed, though i figure i'll never be able to work with the Unreal Engine, nonetheless a great tutorial.

Author:  Captain Xavious [ Tue Nov 21, 2006 4:19 am ]
Post subject:  Make your own Junk Weapons tutorial

Well, thanks! :D It's really easy stuff, UglyPants. You just gotta get to know the programs a bit.

Also, if one followed my tutorial, they'll notice thats there's a horrible mistake with how the chainsaw looks. I... uh... did that on purpose... yeah, on purpose so you guys can have a chance to figure out how to fix a mistake typically found when you're working on this late into the night. ;)

So, post your ideas on how to fix this, and I'll post the code of the fixed version later when I feel like there's been a long enough time spent.

Also, feedback is plenty welcome. Tell me if you are having troubles with any step of the way, and I'll see if I can help you through it.

And, if you absolutely can not get any part of this other than modeling to work, you could try sending me the model and I'll compile it for you, but do this only as a last resort, as I do have other things to do... kind of.

Next week: A Maya PLE tutorial! !amazed
Maybe. !mistrust

Author:  Sargeant Smash [ Tue Nov 21, 2006 11:58 am ]
Post subject:  Make your own Junk Weapons tutorial

yeah ill read this at home when i have the time to look at it. very nice and very detailed im gonna look later and use it because im lacking in the knowlege of the ut engine.

Author:  ShadowBlade [ Wed Nov 22, 2006 5:01 pm ]
Post subject:  Make your own Junk Weapons tutorial

great work!!

Author:  Captain Xavious [ Wed Nov 22, 2006 5:15 pm ]
Post subject:  Make your own Junk Weapons tutorial

Thanks! Now to see if anyone else is paying attention. ;)

Author:  Captain Xavious [ Thu Nov 30, 2006 12:08 pm ]
Post subject:  Make your own Junk Weapons tutorial

Well, I'm a bit disappointed...

But anyways, whats wrong is that the chainsaw will be ridiculously too big. Just guessing, I'd say that you'd want to put the drawscales down to 0.2, instead of what they are right now.

Also, a few other problems are still there that I'll address later.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/