Announcement

Collapse
No announcement yet.

Weapon pickup switch

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

    Weapon pickup switch

    I have no idea as to hard this would be but i doubt it is impossible.

    A weapon replacement mutator with a twist. Instead of replacing a weapon with just one other weapon. You can replace it with up to three. The weapons would switch every minute (optional), as would the ammo.

    This would become more useful, the more custom weapons come out. Alowing you to play over thirty Guns in one map

    Another feature, would being able to save weapon sets. AKA: Realistic, futuristic, you get the general Idea.

    I personally think it is a pretty sweet Idea and i doubt it would be that hard to make... Hopefully.

    A similar mutator for vehicles would be great as well!

    Anyway! Say what you think of the idea, and if you are willing then please, please, please go ahead with the idea! I know I would be grateful.

    #2
    I very much like this idea.

    Comment


      #3
      Yeah... I wonder how hard it would be to do...

      Comment


        #4
        I bet it'd be hard, but it wouldn't be impossible. I'd love to see this.

        Comment


          #5
          With ballistic weapons back in 2k4 they had something like this... I wonder if they would be able to make it again

          Comment


            #6
            I think it could be done... I've been operating under the impression that, while they killed a lot of their gameplay in UT3, and took out some well loved mapping features (2D shape editor, Phys_Spider) the scripting language was much more sophisticated.

            Comment


              #7
              Are you saying you would be able to make it?

              Comment


                #8
                No, I can't code to save my life. I'm just saying that from what I've heard it sounds doable.

                Sorry, I wish I could.

                Comment


                  #9
                  Also wish I could code properly...I could also use something like this. Here's an example how how to use th weapon replacement mutator. Look at the bottom. Think one way this can be done is to use some randomize function in the end with a conditional.

                  Randomize
                  On Weapon Pickup Randomnumber=Random(2)
                  if 0
                  replace oldweapon(0) with original
                  if 1
                  replace oldweapon(0) with shotgun
                  if 2
                  replace oldweapon(0) with chainsaw

                  UTMutator_KillShotSettings(weapon replace)
                  Code:
                  class UTMutator_KillShotSettings extends UTMutator
                     config(KillShotSettings);
                  
                  var config float KsImpactHammerMom;
                  var config float KsImpactHammerVel;
                  var config float KsEnforcerMom;
                  var config float KsEnforcerVel;
                  var config float KsSniperMom;
                  var config float KsSniperVel;
                  
                  struct ReplacementInfo
                  {
                  	/** class name of the weapon we want to get rid of */
                  	var name OldClassName;
                  	/** fully qualified path of the class to replace it with */
                  	var string NewClassPath;
                  };
                  
                  var config array<ReplacementInfo> WeaponsToReplace;
                  var config array<ReplacementInfo> AmmoToReplace;
                  
                  function PostBeginPlay()
                  {
                  	local UTGame Game;
                  	local int i, Index;
                  
                  	Super.PostBeginPlay();
                  
                  	// replace default weapons
                  	Game = UTGame(WorldInfo.Game);
                  	if (Game != None)
                  	{
                  		for (i = 0; i < Game.DefaultInventory.length; i++)
                  		{
                  			if (Game.DefaultInventory[i] != None)
                  			{
                  				Index = WeaponsToReplace.Find('OldClassName', Game.DefaultInventory[i].Name);
                  				if (Index != INDEX_NONE)
                  				{
                  					if (WeaponsToReplace[Index].NewClassPath == "")
                  					{
                  						// replace with nothing
                  						Game.DefaultInventory.Remove(i, 1);
                  						i--;
                  					}
                  					Game.DefaultInventory[i] = class<UTWeapon>(DynamicLoadObject(WeaponsToReplace[Index].NewClassPath, class'Class'));
                  				}
                  			}
                  		}
                  
                  		if (Game.TranslocatorClass != None)
                  		{
                  			Index = WeaponsToReplace.Find('OldClassName', Game.TranslocatorClass.Name);
                  			if (Index != INDEX_NONE)
                  			{
                  				if (WeaponsToReplace[Index].NewClassPath == "")
                  				{
                  					// replace with nothing
                  					Game.TranslocatorClass = None;
                  				}
                  				else
                  				{
                  					Game.TranslocatorClass = class<UTWeapon>(DynamicLoadObject(WeaponsToReplace[Index].NewClassPath, class'Class'));
                  				}
                  			}
                  		}
                  	}
                  }
                  
                  function bool CheckReplacement(Actor Other)
                  {
                  	local UTWeaponPickupFactory WeaponPickup;
                  	local UTWeaponLocker Locker;
                  	local UTAmmoPickupFactory AmmoPickup, NewAmmo;
                  	local int i, Index;
                  	local class<UTAmmoPickupFactory> NewAmmoClass;
                  
                  	WeaponPickup = UTWeaponPickupFactory(Other);
                  	if (WeaponPickup != None)
                  	{
                  		if (WeaponPickup.WeaponPickupClass != None)
                  		{
                  			Index = WeaponsToReplace.Find('OldClassName', WeaponPickup.WeaponPickupClass.Name);
                  			if (Index != INDEX_NONE)
                  			{
                  				if (WeaponsToReplace[Index].NewClassPath == "")
                  				{
                  					// replace with nothing
                  					return false;
                  				}
                  				WeaponPickup.WeaponPickupClass = class<UTWeapon>(DynamicLoadObject(WeaponsToReplace[Index].NewClassPath, class'Class'));
                  				WeaponPickup.InitializePickup();
                  			}
                  		}
                  	}
                  	else
                  	{
                  		Locker = UTWeaponLocker(Other);
                  		if (Locker != None)
                  		{
                  			for (i = 0; i < Locker.Weapons.length; i++)
                  			{
                  				if (Locker.Weapons[i].WeaponClass != None)
                  				{
                  					Index = WeaponsToReplace.Find('OldClassName', Locker.Weapons[i].WeaponClass.Name);
                  					if (Index != INDEX_NONE)
                  					{
                  						if (WeaponsToReplace[Index].NewClassPath == "")
                  						{
                  							// replace with nothing
                  							Locker.ReplaceWeapon(i, None);
                  						}
                  						else
                  						{
                  							Locker.ReplaceWeapon(i, class<UTWeapon>(DynamicLoadObject(WeaponsToReplace[Index].NewClassPath, class'Class')));
                  						}
                  					}
                  				}
                  			}
                  		}
                  		else
                  		{
                  			AmmoPickup = UTAmmoPickupFactory(Other);
                  			if (AmmoPickup != None)
                  			{
                  				Index = AmmoToReplace.Find('OldClassName', AmmoPickup.Class.Name);
                  				if (Index != INDEX_NONE)
                  				{
                  					if (AmmoToReplace[Index].NewClassPath == "")
                  					{
                  						// replace with nothing
                  						return false;
                  					}
                  					NewAmmoClass = class<UTAmmoPickupFactory>(DynamicLoadObject(AmmoToReplace[Index].NewClassPath, class'Class'));
                  					if (NewAmmoClass == None)
                  					{
                  						// replace with nothing
                  						return false;
                  					}
                  					else if (NewAmmoClass.default.bStatic || NewAmmoClass.default.bNoDelete)
                  					{
                  						// transform the current ammo into the desired class
                  						AmmoPickup.TransformAmmoType(NewAmmoClass);
                  						return true;
                  					}
                  					else
                  					{
                  						// spawn the new ammo, link it to the old, then disable the old one
                  						NewAmmo = AmmoPickup.Spawn(NewAmmoClass);
                  						NewAmmo.OriginalFactory = AmmoPickup;
                  						AmmoPickup.ReplacementFactory = NewAmmo;
                  						return false;
                  					}
                  				}
                  			}
                  		}
                  	}
                  
                  	return true;
                  }
                  
                  
                  defaultproperties
                  {
                     			
                     WeaponsToReplace(0)=(OldClassName="UTWeap_Enforcer",NewClassPath ="KillShot.UTWeap_KsEnforcer")	
                     WeaponsToReplace(2)=(OldClassName="UTWeap_FlakCannon",NewClassPath="KillShot.UtWeap_KsFlakCannon")		    
                     WeaponsToReplace(6)=(OldClassName="UTWeap_ShockRifle",NewClassPath="KillShot.UTWeap_KsShockRifle")		
                     WeaponsToReplace(7)=(OldClassName="UTWeap_SniperRifle",NewClassPath ="KillShot.MKWeap_SniperRifle")
                     WeaponsToReplace(5)=(OldClassName="UTWeap_RocketLauncher",NewClassPath="KillShot.UTWeap_KsRocketLauncher")
                     WeaponsToReplace(3)=(OldClassName="UTWeap_LinkGun",NewClassPath="KillShot.UTWeap_KsLinkGun")
                  }

                  Comment


                    #10
                    Ill have a look around to see if anyone with any skill is interested... Unless you think you could have a go?

                    Comment


                      #11
                      might as well keep this noticable incase someone wants to have a go!

                      Comment

                      Working...
                      X