Announcement

Collapse
No announcement yet.

Custom death/pickup messages for cooked mutator.

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

    #16
    Running this code
    Code:
    class zippylabsmutut3zero extends UTMutator;
    
    // Based on UTMutator_WeaponReplacement
    
    var class<UTWeapon>  WeaponClassOld;
    var class<UTWeapon>  WeaponClassNew;
    
    var class<UTWeapon>  AmmoClassOld;
    var class<UTWeapon>  AmmoClassNew;
    
    function PostBeginPlay()
    {
        local UTGame Game;
        local int i;
    
        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 && ClassIsChildOf(Game.DefaultInventory[i], WeaponClassOld))
                {
                    if (WeaponClassNew == none)
                    {
                        // replace with nothing
                        Game.DefaultInventory.Remove(i, 1);
                        i--;
                    }
                    Game.DefaultInventory[i] = WeaponClassNew;
                }
            }
        }
    }
    
    function bool CheckReplacement(Actor Other)
    {
        local UTWeaponPickupFactory WeaponPickup;
        local UTWeaponLocker Locker;
        local UTAmmoPickupFactory AmmoPickup, NewAmmo;
        local int i;
    
        WeaponPickup = UTWeaponPickupFactory(Other);
        if (WeaponPickup != None)
        {
            if (WeaponPickup.WeaponPickupClass != None && ClassIsChildOf(WeaponPickup.WeaponPickupClass, WeaponClassOld))
            {
                if (WeaponClassNew == none)
                {
                    // replace with nothing
                    return false;
                }
                WeaponPickup.WeaponPickupClass = WeaponClassNew;
                WeaponPickup.InitializePickup();
            }
        }
        else
        {
            Locker = UTWeaponLocker(Other);
            if (Locker != None)
            {
                for (i = 0; i < Locker.Weapons.length; i++)
                {
                    if (Locker.Weapons[i].WeaponClass != None && ClassIsChildOf(Locker.Weapons[i].WeaponClass, WeaponClassOld))
                    {
                        if (WeaponClassNew == none)
                        {
                            // replace with nothing
                            Locker.ReplaceWeapon(i, None);
                        }
                        else
                        {
                            Locker.ReplaceWeapon(i, WeaponClassNew);
                        }
                    }
                }
            }
            else
            {
                AmmoPickup = UTAmmoPickupFactory(Other);
                if (AmmoPickup != None && ClassIsChildOf(AmmoPickup.Class, AmmoClassOld))
                {
                    if (AmmoClassNew == None)
                    {
                        // replace with nothing
                        return false;
                    }
                    else if (AmmoClassNew.default.bStatic || AmmoClassNew.default.bNoDelete)
                    {
                        // transform the current ammo into the desired class
                        AmmoPickup.TransformAmmoType(AmmoClassNew);
                        return true;
                    }
                    else
                    {
                        // spawn the new ammo, link it to the old, then disable the old one
                        NewAmmo = AmmoPickup.Spawn(AmmoClassNew);
                        NewAmmo.OriginalFactory = AmmoPickup;
                        AmmoPickup.ReplacementFactory = NewAmmo;
                        return false;
                    }
                }
            }
        }
    
        return true;
    }
    
    defaultproperties
    {
        WeaponClassOld=class'UTWeap_Enforcer'
        WeaponClassNew=class'UTWeap_zippylabut3spunisher'
    
        AmmoClassOld=class'UTAmmo_Enforcer'
        AmmoClassNew=class'UTAmmo_zippylabsut3punisher'
    }
    Got this error
    C:\Games\Steam\steamapps\common\Unreal Tournament 3\Development\Src\Zippylabsut3\Classes\zippylabsmu tut3zero.uc(93) : Error, Type mismatch in Call to 'Transform
    AmmoType', parameter 1

    Comment


      #17
      My fault. Copy-paste ^^.

      Instead of...
      Code:
      var class<UTWeapon>  AmmoClassOld;
      var class<UTWeapon>  AmmoClassNew;
      ... write:
      Code:
      var class<UTAmmoPickupFactory>  AmmoClassOld;
      var class<UTAmmoPickupFactory>  AmmoClassNew;

      Comment


        #18
        Alright everything is working but the texture >< I think it might be what settings I use when I import it.

        Again thanks so much!!!

        Comment


          #19
          Ran into a snag, if I want to add another weapon and ammo pickup how do you? This complies but dose not work


          Here it is
          Code:
          class zippylabsmutut3zero extends UTMutator;
          
          // Based on UTMutator_WeaponReplacement
          
          var class<UTWeapon>  WeaponClassOld;
          var class<UTWeapon>  WeaponClassNew;
          
          var class<UTAmmoPickupFactory>  AmmoClassOld;
          var class<UTAmmoPickupFactory>  AmmoClassNew;
          
          var class<UTWeapon>  WeaponClassOld1;
          var class<UTWeapon>  WeaponClassNew1;
          
          var class<UTAmmoPickupFactory>  AmmoClassOld1;
          var class<UTAmmoPickupFactory>  AmmoClassNew1;
          
          function PostBeginPlay()
          {
              local UTGame Game;
              local int i;
          
              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 && ClassIsChildOf(Game.DefaultInventory[i], WeaponClassOld))
          			   if (Game.DefaultInventory[i] != None && ClassIsChildOf(Game.DefaultInventory[i], WeaponClassOld1))
                      {
                          if (WeaponClassNew == none)
          				if (WeaponClassNew1 == none)
          				 
                          {
                              // replace with nothing
                              Game.DefaultInventory.Remove(i, 1);
                              i--;
                          }
                          Game.DefaultInventory[i] = WeaponClassNew;
          				Game.DefaultInventory[i] = WeaponClassNew1;
                      }
                  }
              }
          }
          
          function bool CheckReplacement(Actor Other)
          {
              local UTWeaponPickupFactory WeaponPickup;
              local UTWeaponLocker Locker;
              local UTAmmoPickupFactory AmmoPickup, NewAmmo;
              local int i;
          
              WeaponPickup = UTWeaponPickupFactory(Other);
              if (WeaponPickup != None)
              {
                  if (WeaponPickup.WeaponPickupClass != None && ClassIsChildOf(WeaponPickup.WeaponPickupClass, WeaponClassOld))
                  if (WeaponPickup.WeaponPickupClass != None && ClassIsChildOf(WeaponPickup.WeaponPickupClass, WeaponClassOld1))
          		{ 
                      if (WeaponClassNew == none)
                      {
                          // replace with nothing
                          return false;
                      }
                      WeaponPickup.WeaponPickupClass = WeaponClassNew;
          			WeaponPickup.WeaponPickupClass = WeaponClassNew1;
                      WeaponPickup.InitializePickup();
                  }
              }
              else
              {
                  Locker = UTWeaponLocker(Other);
                  if (Locker != None)
                  {
                      for (i = 0; i < Locker.Weapons.length; i++)
                      {
                          if (Locker.Weapons[i].WeaponClass != None && ClassIsChildOf(Locker.Weapons[i].WeaponClass, WeaponClassOld))
          				if (Locker.Weapons[i].WeaponClass != None && ClassIsChildOf(Locker.Weapons[i].WeaponClass, WeaponClassOld1))
          				
                          {
                              if (WeaponClassNew == none)
          					if (WeaponClassNew1 == none)
                              {
                                  // replace with nothing
                                  Locker.ReplaceWeapon(i, None);
                              }
                              else
                              {
                                  Locker.ReplaceWeapon(i, WeaponClassNew);
          						Locker.ReplaceWeapon(i, WeaponClassNew1);
                              }
                          }
                      }
                  }
                  else
                  {
                      AmmoPickup = UTAmmoPickupFactory(Other);
                      if (AmmoPickup != None && ClassIsChildOf(AmmoPickup.Class, AmmoClassOld))
                      if (AmmoPickup != None && ClassIsChildOf(AmmoPickup.Class, AmmoClassOld1))
          			{
                          if (AmmoClassNew == None)
          				if (AmmoClassNew1 == None)
                          {
                              // replace with nothing
                              return false;
                          }
                          else if (AmmoClassNew.default.bStatic || AmmoClassNew.default.bNoDelete)
          				 if (AmmoClassNew1.default.bStatic || AmmoClassNew1.default.bNoDelete)
                          {
                              // transform the current ammo into the desired class
                              AmmoPickup.TransformAmmoType(AmmoClassNew);
                              return true;
                          }
                          else
                          {
                              // spawn the new ammo, link it to the old, then disable the old one
                              NewAmmo = AmmoPickup.Spawn(AmmoClassNew);
          					 NewAmmo = AmmoPickup.Spawn(AmmoClassNew1);
                              NewAmmo.OriginalFactory = AmmoPickup;
                              AmmoPickup.ReplacementFactory = NewAmmo;
                              return false;
                          }
                      }
                  }
              }
          
              return true;
          }
          
          defaultproperties
          {
              WeaponClassOld=class'UTWeap_Enforcer'
              WeaponClassNew=class'UTWeap_zippylabut3spunisher'
          
              AmmoClassOld=class'UTAmmo_Enforcer'
              AmmoClassNew=class'UTAmmo_zippylabsut3punisher'
          	
          	
          	    WeaponClassOld1=class'UTWeap_Stinger'
              WeaponClassNew1=class'UTWeap_zippylabsut3stoner'
          
              AmmoClassOld1=class'UTAmmo_Stinger'
              AmmoClassNew1=class'UTAmmo_zippylabsut3stoner'
          	
          }
          Thanks for any help!

          Comment


            #20
            Check UTMutator_WeaponReplacement. Copy-pase it and configure it (or subclass it).

            Comment


              #21
              Okay now I am getting array warnings. Out of bound array default properties.

              Code:
              class zippylabsmutut3zero extends UTMutator;
              
              // Based on UTMutator_WeaponReplacement
              
              
              var class<UTWeapon>  WeaponClassOld;
              var class<UTWeapon>  WeaponClassNew;
              
              var class<UTAmmoPickupFactory>  AmmoClassOld;
              var class<UTAmmoPickupFactory>  AmmoClassNew;
              
              function PostBeginPlay()
              {
                  local UTGame Game;
                  local int i;
              
                  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 && ClassIsChildOf(Game.DefaultInventory[i], WeaponClassOld))
                          {
                              if (WeaponClassNew == none)
                              {
                                  // replace with nothing
                                  Game.DefaultInventory.Remove(i, 1);
                                  i--;
                              }
                              Game.DefaultInventory[i] = WeaponClassNew;
                          }
                      }
                  }
              }
              
              function bool CheckReplacement(Actor Other)
              {
                  local UTWeaponPickupFactory WeaponPickup;
                  local UTWeaponLocker Locker;
                  local UTAmmoPickupFactory AmmoPickup, NewAmmo;
                  local int i;
              
                  WeaponPickup = UTWeaponPickupFactory(Other);
                  if (WeaponPickup != None)
                  {
                      if (WeaponPickup.WeaponPickupClass != None && ClassIsChildOf(WeaponPickup.WeaponPickupClass, WeaponClassOld))
                      {
                          if (WeaponClassNew == none)
                          {
                              // replace with nothing
                              return false;
                          }
                          WeaponPickup.WeaponPickupClass = WeaponClassNew;
                          WeaponPickup.InitializePickup();
                      }
                  }
                  else
                  {
                      Locker = UTWeaponLocker(Other);
                      if (Locker != None)
                      {
                          for (i = 0; i < Locker.Weapons.length; i++)
                          {
                              if (Locker.Weapons[i].WeaponClass != None && ClassIsChildOf(Locker.Weapons[i].WeaponClass, WeaponClassOld))
                              {
                                  if (WeaponClassNew == none)
                                  {
                                      // replace with nothing
                                      Locker.ReplaceWeapon(i, None);
                                  }
                                  else
                                  {
                                      Locker.ReplaceWeapon(i, WeaponClassNew);
                                  }
                              }
                          }
                      }
                      else
                      {
                          AmmoPickup = UTAmmoPickupFactory(Other);
                          if (AmmoPickup != None && ClassIsChildOf(AmmoPickup.Class, AmmoClassOld))
                          {
                              if (AmmoClassNew == None)
                              {
                                  // replace with nothing
                                  return false;
                              }
                              else if (AmmoClassNew.default.bStatic || AmmoClassNew.default.bNoDelete)
                              {
                                  // transform the current ammo into the desired class
                                  AmmoPickup.TransformAmmoType(AmmoClassNew);
                                  return true;
                              }
                              else
                              {
                                  // spawn the new ammo, link it to the old, then disable the old one
                                  NewAmmo = AmmoPickup.Spawn(AmmoClassNew);
                                  NewAmmo.OriginalFactory = AmmoPickup;
                                  AmmoPickup.ReplacementFactory = NewAmmo;
                                  return false;
                              }
                          }
                      }
                  }
              
                  return true;
              }
              
              defaultproperties
              {
              
              
                 
                  WeaponClassOld(0)=class'UTWeap_Enforcer'
                  WeaponClassNew(0)=class'Zippylabsut3.UTWeap_zippylabut3spunisher'
              
                  AmmoClassOld(0)=class'UTAmmo_Enforcer'
                  AmmoClassNew(0)=class'Zippylabsut3.UTWeap_zippylabut3spunisher'
              	
              	WeaponClassOld(1)=class'UTWeap_Stinger'
                  WeaponClassNew(1)=class'Zippylabsut3.UTWeap_zippylabut3spunisher'
              
                  AmmoClassOld(1)=class'UTAmmo_Stinger'
                  AmmoClassNew(1)=class'Zippylabsut3.UTAmmo_zippylabsut3stoner'
              	
              	
              	
              	
              }
              I found this code but it dose not compile right

              Code:
              /////////////////////////////////////////////////////
              // Mutator: Copy and Paste from EPIC
              // Assembled By: *PingFre@K*
              /////////////////////////////////////////////////////
              
              class FirstMutator extends UTMutator
                 config(FirstMutator);
              
              
              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
              {
              // Fill in the blanks
                 WeaponsToReplace(0)=(OldClassName="UTWeap_Enforcer",NewClassPath="FirstMutator.UTWeap_EnforcerPlusOne")
                 AmmoToReplace(0)=(OldClassName="UTAmmo_Enforcer",NewClassPath="UTGame.UTAmmo_Enforcer")
              
                WeaponsToReplace(1)=(OldClassName="UTWeap_BioRifle_Content",NewClassPath="UTGameContent.UTWeap_BioRifle_Content")
                 AmmoToReplace(1)=(OldClassName="UTAmmo_BioRifle_Content",NewClassPath="UTGameContent.UTAmmo_BioRifle_Content")
              
                 WeaponsToReplace(2)=(OldClassName="UTWeap_FlakCannon",NewClassPath="UTGame.UTWeap_FlakCannon")
                 AmmoToReplace(2)=(OldClassName="UTAmmo_FlakCannon",NewClassPath="UTGame.UTAmmo_FlakCannon")
              
                 WeaponsToReplace(3)=(OldClassName="UTWeap_LinkGun",NewClassPath="UTGame.UTWeap_LinkGun")
                 AmmoToReplace(3)=(OldClassName="UTAmmo_LinkGun",NewClassPath="UTGame.UTAmmo_LinkGun")
              
                 WeaponsToReplace(4)=(OldClassName="UTWeap_Redeemer_Content",NewClassPath="UTGame.UTWeap_Redeemer_Content")
              
                 WeaponsToReplace(5)=(OldClassName="UTWeap_RocketLauncher",NewClassPath="UTGame.UTWeap_RocketLauncher")
                 AmmoToReplace(5)=(OldClassName="UTAmmo_RocketLauncher",NewClassPath="UTGame.UTAmmo_RocketLauncher")
              
                 WeaponsToReplace(6)=(OldClassName="UTWeap_ShockRifle",NewClassPath="UTGame.UTWeap_ShockRifle")
                 AmmoToReplace(6)=(OldClassName="UTAmmo_ShockRifle",NewClassPath="UTGame.UTAmmo_ShockRifle")
              
                 WeaponsToReplace(7)=(OldClassName="UTWeap_SniperRifle",NewClassPath="UTGame.UTWeap_SniperRifle")
                 AmmoToReplace(7)=(OldClassName="UTAmmo_SniperRifle",NewClassPath="UTGame.UTAmmo_SniperRifle")
              
                 WeaponsToReplace(8)=(OldClassName="UTWeap_Stinger",NewClassPath="FirstMutator.UTWeap_Stoner")
                 AmmoToReplace(8)=(OldClassName="UTAmmo_Stinger",NewClassPath="FirstMutator.UTAmmo_Stoner")
              
                 GroupNames(0)="Zippylabs"
                 Name="ZippyLabs"
              
              
              
              
              
              
              
              
              }
              Looking through my old drool...er code data base had some UC files I use to use back in the day.

              From what I see if it work it would be more efficient as you do not need 2 more lines of code for every weapon set tho I'm an idiot so I dunno ><
              Every error I run down and fix brings a new one

              Comment


                #22
                "Every error I run down and fix brings a new one "
                Ain't it the truth!
                "Okay now I am getting array warnings. Out of bound array default properties. "
                • ^^ that shows you are on the right path, you understand this stuff, better than me so you will be able to solve this.
                • im not a coder but it looks liek you are trying to write a huge mutator to replace multiple weapons and ammos(?)
                • If that is correct then does my method help:?

                NewDefaultInventory
                Code:
                class NewDefaultInventory extends UTMutator;
                
                // Need Fix for Transolcator + Hoverboard Equip same time
                // Need Fix for Avril VCTF Only
                
                function InitMutator( string Options, out string ErrorMessage )
                {
                    	// Make sure the game does not hold a null reference
                    	if(UTGame(WorldInfo.Game) != none)
                    {
                        	// New Default Weapon Array
                        	//UTGame(WorldInfo.Game).DefaultInventory.AddItem(class'UTWeap_Translocator_Content');
                	//UTGame(WorldInfo.Game).DefaultInventory.AddItem(class'UTWeap_Avril_Content');
                	UTGame(WorldInfo.Game).DefaultInventory.AddItem(class'UTWeap_Enforcer');
                	UTGame(WorldInfo.Game).DefaultInventory.AddItem(class'UTWeap_ImpactHammer');
                	UTGame(WorldInfo.Game).DefaultInventory.AddItem(class'UTWeap_SniperRifle');
                	UTGame(WorldInfo.Game).DefaultInventory.AddItem(class'UTWeap_ShockRifle');
                	UTGame(WorldInfo.Game).DefaultInventory.AddItem(class'UTWeap_BioRifle_Content');
                	UTGame(WorldInfo.Game).DefaultInventory.AddItem(class'UTWeap_RocketLauncher');
                	UTGame(WorldInfo.Game).DefaultInventory.AddItem(class'UTWeap_LinkGun');
                    }
                  	super.InitMutator( options, ErrorMessage );
                }
                 
                DefaultProperties
                {
                }
                Please don't call you mutator NDI or NewDefaultInventory, it might effect the UT99/UT2004 to UT3 port.

                also is this why u get confused?
                WeaponsToReplace(8)=(OldClassName="UTWeap_Stinger" ,NewClassPath="FirstMutator.UTWeap_Stoner")
                ^^ lol

                Comment


                  #23
                  Neat I will try it when I find time, thanks ^^

                  I can barely read it the line number for errors helps but I can't phrase code worth a ****.

                  ===========
                  The 2nd code is a bit old and I am not using firstmutator anymore. I tried making the code like this
                  Error
                  C:\Games\Steam\steamapps\common\Unreal Tournament 3\Development\Src\Zippylabsut3\Classes\zippylabsmu tut3zero.uc(166) : Error, Classes with config/ globalconfig
                  member variables need to specify config file.
                  Code:
                  class zippylabsmutut3zero extends UTMutator;
                  
                  // Based on UTMutator_WeaponReplacement
                  config(zippylabsmutut3zero);
                  
                  var class<UTWeapon>  WeaponClassOld;
                  var class<UTWeapon>  WeaponClassNew;
                  
                  var class<UTAmmoPickupFactory>  AmmoClassOld;
                  var class<UTAmmoPickupFactory>  AmmoClassNew;
                  
                  
                  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="Zippylabsut3.UTWeap_zippylabut3spunisher")
                     AmmoToReplace(0)=(OldClassName="UTAmmo_Enforcer",NewClassPath="Zippylabsut3.UTAmmo_zippylabut3spunisher")
                  	
                  	
                  	
                  	
                  }
                  GGrrrr I can't compile much right now encoding videos in premiere for my fanlyric projects.

                  Anyway I do not see what the issue is, then again I skim more than read and that's with anything I read.... >< And here I am trying to write a book and can't even figure out proper grammar so yes lets try and do some coding on the side.... LOL

                  Comment


                    #24
                    Helo, unexpected config error

                    Getting unexpected config error....its driving me nuts....

                    Going back to the other one for a bit see if I can find that other error.....
                    Code:
                    class zippylabsmutut3zero extends UTMutator;
                    
                    // Based on UTMutator_WeaponReplacement
                    
                    config(user);
                    
                    
                    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
                    {
                    
                       GroupNames(0)="Zippylabsut3"
                       Name="Zippylabsut3"
                       
                       WeaponsToReplace(0)=(OldClassName="UTWeap_Enforcer",NewClassPath="Zippylabsut3.UTWeap_zippylabut3spunisher")
                       AmmoToReplace(0)=(OldClassName="UTAmmo_Enforcer",NewClassPath="Zippylabsut3.UTAmmo_zippylabut3spunisher")
                    	
                    	
                    	
                    	
                    }

                    Comment


                      #25
                      You don't get an unexpected error

                      If you specify a config variable, you need to specify the file you want to store that variable. This has to be set as class specifier.
                      Code:
                       // Based on UTMutator_WeaponReplacement; 
                      class zippylabsmutut3zero extends UTMutator
                          config(zippylabsmutut3zero );

                      Comment


                        #26
                        Okay I figured it out ,finally made it out the paper sack! LOL Still need help importing a texture and using it, guess I will post in the texture/skinning thread. Once I get my stinger mod tweaked a bit.

                        Comment

                        Working...
                        X