PDA

View Full Version : CheckReplacement



SwaTz0rs
11-19-2007, 04:33 PM
Hey there.

anyone here who can help me with replacing the sniper Rifle / and ammo and the shock rifle / and ammo with a custom rifle


function bool CheckReplacement(Actor Other)
{
if (Other.IsA('UTWeaponPickupFactory') && Other.IsA('UTAmmoPickupFactory'))
{

}
}

Taboen
11-19-2007, 04:52 PM
I happen to have a UT2004 mutator for this for replacing the minigun with minigunHE.


function bool CheckReplacement( Actor Other, out byte bSuperRelevant )
{
local int i;
local WeaponLocker L;

bSuperRelevant = 0;

if ( xWeaponBase(Other) != None )
{
if ( string( xWeaponBase(Other).WeaponType ) ~= "XWeapons.Minigun" )
{
xWeaponBase(Other).WeaponType = class'MutMinigunHE.MinigunHE';
return false;
}
}

else if ( WeaponPickup(Other) != None )
{
if ( string(Other.Class) ~= "XWeapons.MinigunPickup" )
{
ReplaceWith( Other, "MutMinigunHE.MinigunHEPickup" );
return false;
}
}

else if ( WeaponLocker(Other) != None )
{
L = WeaponLocker(Other);

for (i = 0; i < L.Weapons.Length; i++)
{
if ( string( L.Weapons[i].WeaponClass ) ~= "XWeapons.Minigun" )
L.Weapons[i].WeaponClass = class'MutMinigunHE.MinigunHE';
}
}

return true;
}

It is probably a bit different in UT3 though. This might just give a hint on how to do it.

SwaTz0rs
11-20-2007, 11:36 AM
i decided to use the weaponsreplacement mutator.

thanks anyways