Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

CheckReplacement

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • CheckReplacement

    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

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

  • #2
    I happen to have a UT2004 mutator for this for replacing the minigun with minigunHE.

    Code:
    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.

    Comment


    • #3
      i decided to use the weaponsreplacement mutator.

      thanks anyways

      Comment

      Working...
      X