Trouble with simple weaon mutator--fixed and a link
OK, I'm making a mutator much like the HE chaingun tut does in the Wiki:
http://wiki.beyondunreal.com/wiki/Weapon_Mutator_Tutorial
basically, what I want to do is cause a redeemer explosion when an assaultrifle grenade is supposed to explode. I sublcassed the assaultriflegrenade class to change the projectile to a redeemer projectile and I also spawned a redeemer projectile (did this after just changing the default properties to redeemer projectile didn't work) instead of the grenade in the spawn function of the assaultriflegrenade class.
I know all the subclassing in the world won't make the code run in the game, so I followed the tutorial's way of making the mutator to replace the weapon in the game. Everything compiled except the mutator subclass I made b/c it had a problem with the 'config(user);' part. I took it out, then compiled fine, but, no redeemer explosion in the game. I think this is the root of the problem, but I don't know how else to replace the weapon w/ the new weaponsubclass I made.
here is the code that I have for what I'm trying to do (for some its easier than my long ass description):
any help would be great...again..I think it is a problem w/ the mutator subclass not pointing to my weapon subclass...
OK, I'm making a mutator much like the HE chaingun tut does in the Wiki:
http://wiki.beyondunreal.com/wiki/Weapon_Mutator_Tutorial
basically, what I want to do is cause a redeemer explosion when an assaultrifle grenade is supposed to explode. I sublcassed the assaultriflegrenade class to change the projectile to a redeemer projectile and I also spawned a redeemer projectile (did this after just changing the default properties to redeemer projectile didn't work) instead of the grenade in the spawn function of the assaultriflegrenade class.
I know all the subclassing in the world won't make the code run in the game, so I followed the tutorial's way of making the mutator to replace the weapon in the game. Everything compiled except the mutator subclass I made b/c it had a problem with the 'config(user);' part. I took it out, then compiled fine, but, no redeemer explosion in the game. I think this is the root of the problem, but I don't know how else to replace the weapon w/ the new weaponsubclass I made.
here is the code that I have for what I'm trying to do (for some its easier than my long ass description):
Code:
class AssaultRifleN extends AssaultRifle;
defaultproperties
{
FireModeClass(1)=Class'assaultrifleN.AssaultGrenadeN'
PickupClass=Class'assaultrifleN.AssaultRiflePickupN'
}
Code:
class AssaultRiflePickupN extends AssaultRiflePickup;
defaultproperties
{
InventoryType=class'assaultrifleN.AssaultRifleN'
PickupMessage="You have some good ****"
}
Code:
class AssaultGrenadeN extends AssaultGrenade;
function projectile SpawnProjectile(Vector Start, Rotator Dir)
{
local RedeemerProjectile g;
local vector X, Y, Z;
local float pawnSpeed;
g = Spawn(class'RedeemerProjectile', self,, Start, Dir);
if (g != None)
{
Weapon.GetViewAxes(X,Y,Z);
pawnSpeed = X dot Instigator.Velocity;
if ( Bot(Instigator.Controller) != None )
g.Speed = mHoldSpeedMax;
else
g.Speed = mHoldSpeedMin + HoldTime*mHoldSpeedGainPerSec;
g.Speed = FClamp(g.Speed, mHoldSpeedMin, mHoldSpeedMax);
g.Speed = pawnSpeed + g.Speed;
//g.Speed = FClamp(g.Speed, mSpeedMin, mSpeedMax);
g.Velocity = g.Speed * Vector(Dir);
g.Damage *= DamageAtten;
}
return g;
}
defaultproperties
{
ProjectileClass=Class'XWeapons.RedeemerProjectile'
}
Code:
class grenadearena extends Mutator
config(user);
function bool CheckReplacement( Actor Other, out byte bSuperRelevant )
{
bSuperRelevant = 0;
if ( xWeaponBase(Other) != None )
{
if ( xWeaponBase(Other).WeaponType == class'AssaultRifle' )
xWeaponBase(Other).WeaponType = class'AssaultRifleN';
else
return true;
}
else if ( WeaponPickup(Other) != None )
{
if ( string(Other.Class) ~= "xWeapons.AssaultRiflePickup" )
ReplaceWith( Other, "assaultrifleN.AssaultRiflePickupN");
else
return true;
}
else
return true;
return false;
}
defaultproperties
{
GroupName="grenadearena"
FriendlyName="grenadearena"
Description="you got some good ****"
}
any help would be great...again..I think it is a problem w/ the mutator subclass not pointing to my weapon subclass...
Last edited: