PDA

View Full Version : Assault Rifle



legacy-Cataclysm
01-16-2006, 09:47 AM
Hello,

I've been working on an Assault Rifle mod for the thing I am working on. For some reason, very bizarre things are going on when I play it in Arena mode. First, it doesn't give me ammo when I pickup the ammo packs lying around. Also, whenever I pickup a health vial, armor, amp, or adrenaline pill, it gives me ammo for the weapon. Here's the code:


//================================================
// MomentumAssaultRifle
// This is the Inventory Class
//================================================
class MomentumAssaultRifle extends AssaultRifle;

defaultproperties
{
ItemName="Momentum Assault Rifle"

FireModeClass(0)=MomentumAssaultFire
FireModeClass(1)=none
PickupClass=class'MomentumAssaultRiflePickup'
}


//================================================
// MomentumAssaultFire
// This is the Fire Class
//================================================
class MomentumAssaultFire extends AssaultFire;

defaultproperties
{
AmmoClass=class'MomentumAssaultRifle.MomentumAssau ltAmmo'
AmmoPerFire=1
DamageMin=5
DamageMax=5
Momentum=0.0

FireRate=.15
}



//================================================
// MomentumAssaultRiflePickup
// This is the Pickup Class
//================================================
class MomentumAssaultRiflePickup extends AssaultRiflePickup;

defaultproperties
{
InventoryType=class'MomentumAssaultRifle.MomentumA ssaultRifle'

PickupMessage="You got the Momentum Assault Rifle."

}


//================================================
// MomentumAssaultAmmo
// This is the Ammo Class
//================================================
class MomentumAssaultAmmo extends AssaultAmmo;

defaultproperties
{
PickupClass=class'MomentumAssaultRifle.MomentumAss aultAmmoPickup'
MaxAmmo=300
InitialAmount=150
}


//================================================
// MomentumAssaultAmmoPickup
// This is the Pickup Class
//================================================
class MomentumAssaultAmmoPickup extends AssaultAmmoPickup;

defaultproperties
{
InventoryType=class'MomentumAssaultRifle.MomentumA ssaultAmmo'

AmmoAmount=50

}

Got any ideas?

legacy-pcmods
01-16-2006, 11:40 AM
Just a thought, try changing the name of your class from MomentumAssaultRifle to may be Momentum_Assault_Rifle as your have a class and an actor with the same name....

Also, try place just the class name in the default properties like:

InventoryType=class'MomentumAssaultRifle.MomentumA ssaultAmmo'

to

InventoryType=MomentumAssaultAmmo

UT2004 will reference from your class, you don't need to reference the base actor.

If that don't help, then it all looks OK, and I can't help any more.

legacy-Cataclysm
01-16-2006, 12:57 PM
I made the changes you suggested and when I went to play the weapon, there was no weapon. No weapon at all to shoot with. Funky...

legacy-pcmods
01-16-2006, 07:58 PM
I have no idea then, your code looks right, I will copy it l8r and try it.

Angel_Mapper
01-16-2006, 08:14 PM
You're not referencing your custom firemode in your weapon class.

legacy-Cataclysm
01-17-2006, 12:24 PM
I made the addition you mentioned Angel and still fubared. =/

Jrubzjeknf
01-17-2006, 12:48 PM
I suggest to comment out lines, so the original class is used. That way you can find out where the problem is.

legacy-Cataclysm
01-17-2006, 03:08 PM
I know how to comment lines, but how can that tell me what the problem is?