MukiHyena
12-09-2008, 01:39 AM
Hey all, noob here, trying to make my first couple of modified weapons for a mutator.
Basically what I'm trying to make are three weapons; a shotgun, an SMG, and a three-round burst rifle using the standard Enforcer.
Here's what I'm trying to accomplish:
SMG style Enforcer (replaces starting enforcer):
Primary - 0.66 FireInterval, spread of 4 degrees
Secondary - Disabled
Burst-rifle style Enforcer (replacing sniper rifle):
Primary - 0.66 burstfire of 3 shots, 0.4 cooldown, 1.5 headshot multiplier, perfect accuracy
Secondary - 2x zoom
Shotgun style enforcer (replacing flak cannon):
Primary 1 FireInterval, spread of 10 degrees, 15 pellets
Secondary - Disabled
I've followed a tutorial on making my first mutator, and I've had success in some areas, but not others. I've managed to up the firing rate and starting/maximum ammo. However, I haven't figured out how to make multiple projectiles come out at once (IE shotgun), nor have I figured out how to modify the cone of bullet spread.
Here is what I have so far:
class FirstMutator extends UTMutator;
function InitMutator(string Options, out string ErrorMessage)
{
if (UTGame(WorldInfo.Game) != None)
{
UTGame(WorldInfo.Game).DefaultInventory[0] = class'FirstMutator.UTWeap_EnforcerPlusOne';
}
Super.InitMutator(Options, ErrorMessage);
}
function bool CheckReplacement(Actor Other)
{
if (Other.IsA('UTWeap_Enforcer') && !Other.IsA('UTWeap_EnforcerPlusOne'))
{
ReplaceWith(Other, "UTWeap_EnforcerPlusOne");
}
return true;
}
DefaultProperties
{
}
class UTWeap_EnforcerPlusOne extends UTWeap_Enforcer;
/**
* Adds any fire spread offset to the passed in rotator
* @param BaseAim the base aim direction
* @return the adjusted aim direction
*/
simulated function rotator AddSpread(rotator BaseAim)
{
local float SpreadMod;
SpreadMod = PendingFire(1) ? 1.3 : 1.0;
if ( WorldInfo.TimeSeconds - LastFireTime > 0.8/CustomTimeDilation )
{
Spread[CurrentFireMode] = Default.Spread[CurrentFireMode];
}
else
{
if ( DualMode == EDM_Dual )
{
Spread[0] = FMin(Spread[0]+0.015,0.075);
Spread[1] = FMin(Spread[1]+0,0);
}
else
{
Spread[0] = FMin(Spread[0]+0.015,0.075);
Spread[1] = FMin(Spread[1]+0,0);
}
Spread[0] *= SpreadMod;
Spread[1] *= SpreadMod;
}
return Super.AddSpread(BaseAim);
}
DefaultProperties
{
BurstCoolDownTime=0.35
AmmoCount=120
LockerAmmoCount=120
MaxAmmoCount=240
InstantHitDamage(0) = 12
InstantHitDamage(1) = 12
FireInterval(0)=0.066
FireInterval(1)=0.066
aimerror=0.000000
Spread(0)=0.000000
Spread(1)=0.000000
}
Keep in mind I have very little experience with scripting and programming in general, so I would appreciate details on any changes I'd have to make, as well as what I'm changing and why.
What I have now is an enforcer with a firing rate of .066 for the primary and alternate fire, a full-auto primary, burst secondary. Unfortunately my modification of the spread and aimerror seem to have done nothing to the accuracy.
Thanks in advance for any help.
Basically what I'm trying to make are three weapons; a shotgun, an SMG, and a three-round burst rifle using the standard Enforcer.
Here's what I'm trying to accomplish:
SMG style Enforcer (replaces starting enforcer):
Primary - 0.66 FireInterval, spread of 4 degrees
Secondary - Disabled
Burst-rifle style Enforcer (replacing sniper rifle):
Primary - 0.66 burstfire of 3 shots, 0.4 cooldown, 1.5 headshot multiplier, perfect accuracy
Secondary - 2x zoom
Shotgun style enforcer (replacing flak cannon):
Primary 1 FireInterval, spread of 10 degrees, 15 pellets
Secondary - Disabled
I've followed a tutorial on making my first mutator, and I've had success in some areas, but not others. I've managed to up the firing rate and starting/maximum ammo. However, I haven't figured out how to make multiple projectiles come out at once (IE shotgun), nor have I figured out how to modify the cone of bullet spread.
Here is what I have so far:
class FirstMutator extends UTMutator;
function InitMutator(string Options, out string ErrorMessage)
{
if (UTGame(WorldInfo.Game) != None)
{
UTGame(WorldInfo.Game).DefaultInventory[0] = class'FirstMutator.UTWeap_EnforcerPlusOne';
}
Super.InitMutator(Options, ErrorMessage);
}
function bool CheckReplacement(Actor Other)
{
if (Other.IsA('UTWeap_Enforcer') && !Other.IsA('UTWeap_EnforcerPlusOne'))
{
ReplaceWith(Other, "UTWeap_EnforcerPlusOne");
}
return true;
}
DefaultProperties
{
}
class UTWeap_EnforcerPlusOne extends UTWeap_Enforcer;
/**
* Adds any fire spread offset to the passed in rotator
* @param BaseAim the base aim direction
* @return the adjusted aim direction
*/
simulated function rotator AddSpread(rotator BaseAim)
{
local float SpreadMod;
SpreadMod = PendingFire(1) ? 1.3 : 1.0;
if ( WorldInfo.TimeSeconds - LastFireTime > 0.8/CustomTimeDilation )
{
Spread[CurrentFireMode] = Default.Spread[CurrentFireMode];
}
else
{
if ( DualMode == EDM_Dual )
{
Spread[0] = FMin(Spread[0]+0.015,0.075);
Spread[1] = FMin(Spread[1]+0,0);
}
else
{
Spread[0] = FMin(Spread[0]+0.015,0.075);
Spread[1] = FMin(Spread[1]+0,0);
}
Spread[0] *= SpreadMod;
Spread[1] *= SpreadMod;
}
return Super.AddSpread(BaseAim);
}
DefaultProperties
{
BurstCoolDownTime=0.35
AmmoCount=120
LockerAmmoCount=120
MaxAmmoCount=240
InstantHitDamage(0) = 12
InstantHitDamage(1) = 12
FireInterval(0)=0.066
FireInterval(1)=0.066
aimerror=0.000000
Spread(0)=0.000000
Spread(1)=0.000000
}
Keep in mind I have very little experience with scripting and programming in general, so I would appreciate details on any changes I'd have to make, as well as what I'm changing and why.
What I have now is an enforcer with a firing rate of .066 for the primary and alternate fire, a full-auto primary, burst secondary. Unfortunately my modification of the spread and aimerror seem to have done nothing to the accuracy.
Thanks in advance for any help.