Announcement

Collapse
No announcement yet.

Quick Question...

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

    Quick Question...

    Where would I find the script that controls what weapons the player starts with? Or simply the variables that hold these values. I'm making an upgraded Assault Rifle (Accurate as heck and grenades are uber-fast both moving and charging), and I wanted to make a mutator that replaced the Assault Rifle with this AAR when you start out.

    Thanks in advance,
    Über Gööber

    #2
    Your mutator class should have something like the following in it:

    Code:
    function bool CheckReplacement( Actor Other, out byte bSuperRelevant )
    {
    	local int i;
    	local WeaponLocker L;
    
    	bSuperRelevant = 0;
        if ( xWeaponBase(Other) != None )
        {
    		if ( xWeaponBase(Other).WeaponType == class'XWeapons.RocketLauncher' )
    			xWeaponBase(Other).WeaponType = class'MiniCluster.MiniCluster';//This swaps what the player has possession of
    	}
    	else if ( RocketLauncherPickup(Other) != None )
    		ReplaceWith( Other, "MiniCluster.MiniClusterPickup");//this swaps any pickups laying around the map
    	else if ( WeaponLocker(Other) != None )
    	{
    		L = WeaponLocker(Other);
    		for (i = 0; i < L.Weapons.Length; i++)
    			if (L.Weapons[i].WeaponClass == class'RocketLauncher')
    				L.Weapons[i].WeaponClass = class'MiniCluster.MiniCluster';//This swaps weapons in weaponlockers
    		return true;
    	}
    	else
    		return true;
    	return false;
    }
    It's been a while since I've dealt with this, so hopefully if I'm incorrect, the regs here will point out the mistakes.

    Comment


      #3
      That will replace the pickups, to replace the default weapon I use:
      Code:
      function bool CheckReplacement( Actor Other, out byte bSuperRelevant )
      {
      	if (Other.isA('xPawn'))
      	{
      
      		if( Other.isA('Monster') ) return True;
      
      		xPawn(Other).RequiredEquipment[2] = "MyPackage.MyWepaon";
      	}
      
      	Return True;
      }
      RequiredEquipment[2] should be right, I think 0 is the xloc and 1 is the sheildgun

      Comment


        #4
        Thanks guys.

        Comment

        Working...
        X