https://www.oldunreal.com/cgi-bin/yabb2 ... 1374313749
I know that there is another UTWeapons mod in OldUnreal page that exists for Unreal 1 but it has too many visual glitches. So i decided to use its mutator code as a base to make the mutator for BotPack mod.
Here is the code of the original mutator inside UTWeapons.u mod:
Code: Select all
//=============================================================================
// UTWeapons.
// Coded by .:..:
//=============================================================================
class UTWeapons expands Mutator;
#exec OBJ LOAD FILE=Classes\UT.u PACKAGE=UTWeapons
#exec OBJ LOAD FILE=Classes\UT2.u PACKAGE=UTWeapons
var bool bShouldReplace;
function PostBeginPlay()
{
SetTimer(0.1,false);
}
function Timer()
{
bShouldReplace = True;
}
function Class<Weapon> MyDefaultWeapon()
{
Return class'ImpactHammer';
}
function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
if( !bShouldReplace )
{
if( Weapon(Other)!=None )
{
if( DispersionPistol(Other)!=None && ReplaceWith(Other,string(class'ImpactHammer')) )
Return False;
else if( Automag(Other)!=None && ReplaceWith(Other,string(class'Enforcer')) )
Return False;
else if( Stinger(Other)!=None && ReplaceWith(Other,string(class'PulseGun')) )
Return False;
else if( ASMD(Other)!=None && ReplaceWith(Other,string(class'ShockRifle')) )
Return False;
else if( Eightball(Other)!=None && ReplaceWith(Other,string(class'UT_Eightball')) )
Return False;
else if( FlakCannon(Other)!=None && ReplaceWith(Other,string(class'UT_FlakCannon')) )
Return False;
else if( Razorjack(Other)!=None && ReplaceWith(Other,string(class'Ripper')) )
Return False;
else if( GESBioRifle(Other)!=None && ReplaceWith(Other,string(class'UT_BioRifle')) )
Return False;
else if( Rifle(Other)!=None && ReplaceWith(Other,string(class'SniperRifle')) )
Return False;
else if( Minigun(Other)!=None )
{
if( FRand()<0.9 && ReplaceWith(Other,string(class'Minigun2')) )
Return False;
else if( ReplaceWith(Other,string(class'WarheadLauncher')) )
Return False;
}
}
else if( Ammo(Other)!=None )
{
if( Other.Class==Class'ASMDAmmo' && ReplaceWith(Other,string(class'ShockCore')) )
Return False;
else if( FlakBox(Other)!=None && ReplaceWith(Other,string(class'FlakAmmo')) )
Return False;
else if( RazorAmmo(Other)!=None && ReplaceWith(Other,string(class'BladeHopper')) )
Return False;
else if( RifleAmmo(Other)!=None && ReplaceWith(Other,string(class'BulletBox')) )
Return False;
else if( RocketCan(Other)!=None && ReplaceWith(Other,string(class'RocketPack')) )
Return False;
else if( ShellBox(Other)!=None && ReplaceWith(Other,string(class'Miniammo')) )
Return False;
else if( Sludge(Other)!=None && ReplaceWith(Other,string(class'BioAmmo')) )
Return False;
else if( StingerAmmo(Other)!=None && ReplaceWith(Other,string(class'PAmmo')) )
Return False;
}
else if( WeaponPowerUp(Other)!=None && ReplaceWith(Other,string(class'ChainSaw')) )
Return False;
}
if( Other.bIsPawn && SkaarjTrooper(Other)!=None )
{
if( SkaarjTrooper(Other).WeaponType==class'DispersionPistol' )
{
if( FRand()<0.4 )
SkaarjTrooper(Other).WeaponType=class'ImpactHammer';
else if( FRand()<0.3 )
SkaarjTrooper(Other).WeaponType=class'ChainSaw';
else SkaarjTrooper(Other).WeaponType=class'Translocator';
}
else if( SkaarjTrooper(Other).WeaponType==class'Automag' )
SkaarjTrooper(Other).WeaponType=class'Enforcer';
else if( SkaarjTrooper(Other).WeaponType==class'Stinger' )
SkaarjTrooper(Other).WeaponType=class'PulseGun';
else if( SkaarjTrooper(Other).WeaponType==class'ASMD' )
SkaarjTrooper(Other).WeaponType=class'ShockRifle';
else if( SkaarjTrooper(Other).WeaponType==class'Eightball' )
SkaarjTrooper(Other).WeaponType=class'UT_Eightball';
else if( SkaarjTrooper(Other).WeaponType==class'FlakCannon' )
SkaarjTrooper(Other).WeaponType=class'UT_FlakCannon';
else if( SkaarjTrooper(Other).WeaponType==class'Razorjack' )
SkaarjTrooper(Other).WeaponType=class'Ripper';
else if( SkaarjTrooper(Other).WeaponType==class'GESBioRifle' )
SkaarjTrooper(Other).WeaponType=class'UT_BioRifle';
else if( SkaarjTrooper(Other).WeaponType==class'Rifle' )
SkaarjTrooper(Other).WeaponType=class'SniperRifle';
else if( SkaarjTrooper(Other).WeaponType==class'Minigun' )
SkaarjTrooper(Other).WeaponType=class'Minigun2';
}
else if( Decoration(Other)!=None && Decoration(Other).contents!=None )
{
if( Decoration(Other).contents==Class'DispersionPistol' )
Decoration(Other).contents = Class'ImpactHammer';
else if( Decoration(Other).contents==Class'Stinger' )
Decoration(Other).contents = Class'PulseGun';
else if( Decoration(Other).contents==Class'ASMD' )
Decoration(Other).contents = Class'ShockRifle';
else if( Decoration(Other).contents==Class'Eightball' )
Decoration(Other).contents = Class'UT_Eightball';
else if( Decoration(Other).contents==Class'FlakCannon' )
Decoration(Other).contents = Class'UT_FlakCannon';
else if( Decoration(Other).contents==Class'Razorjack' )
Decoration(Other).contents = Class'Ripper';
else if( Decoration(Other).contents==Class'GESBioRifle' )
Decoration(Other).contents = Class'UT_BioRifle';
else if( Decoration(Other).contents==Class'Rifle' )
Decoration(Other).contents = Class'SniperRifle';
else if( Decoration(Other).contents==Class'Minigun' )
Decoration(Other).contents = Class'Minigun2';
else if( Decoration(Other).contents==Class'ASMDAmmo' )
Decoration(Other).contents = Class'ShockCore';
else if( Decoration(Other).contents==Class'FlakBox' )
Decoration(Other).contents = Class'FlakAmmo';
else if( Decoration(Other).contents==Class'RazorAmmo' )
Decoration(Other).contents = Class'BladeHopper';
else if( Decoration(Other).contents==Class'RifleAmmo' || Decoration(Other).contents==Class'RifleRound' )
Decoration(Other).contents = Class'BulletBox';
else if( Decoration(Other).contents==Class'RocketCan' )
Decoration(Other).contents = Class'RocketPack';
else if( Decoration(Other).contents==Class'ShellBox' || Decoration(Other).contents==Class'Clip' )
Decoration(Other).contents = Class'MiniAmmo';
else if( Decoration(Other).contents==Class'Sludge' )
Decoration(Other).contents = Class'BioAmmo';
else if( Decoration(Other).contents==Class'StingerAmmo' )
Decoration(Other).contents = Class'PAmmo';
}
return true;
}
Code: Select all
[Public]
Object=(Name=UTWeapons.UTWeapons,Class=Class,MetaClass=Engine.Mutator,Description="UT Weapons,Replace original Unreal weapons with Unreal Tournament ones.")
What i did was that i copied/added the mutator code to BotPack.u and changed the "UTWeapons.UTWeapons" in UTWeapons.int to "BotPack.UTWeapons" but it didn't work. Can anyone help me what to change in mutator code to make it work.