Announcement

Collapse
No announcement yet.

Custom death/pickup messages for cooked mutator.

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

    Custom death/pickup messages for cooked mutator.

    How ? Where? I knwo they are in the int but where do you put your INT where? I have tried Unreal Tournament 3\UTGame\CookedPC\Localization\INT with no luck 0-o

    I've managed to get Weapon name on pickup to change in unpublished.

    #2
    So what's the correct answer? The place is correct.

    Default names can be written inside the defaultprops (PickupName and ItemName for instance). If there is not default name, and someone installed the mutator with any loc file, he won't see any name (or the default name "Snagged an item", "Weapon", etc.).

    Don't get consued with Unpublished/Published. If you start the editor, everything is used from the Unpublished folder. The game is using the Published folder. Only with a special command the game will read the Unpublished folder. Conclusion: Place scripts and files related to script in Published.

    Comment


      #3
      Originally posted by RattleSN4K3 View Post
      So what's the correct answer? The place is correct.

      Default names can be written inside the defaultprops (PickupName and ItemName for instance). If there is not default name, and someone installed the mutator with any loc file, he won't see any name (or the default name "Snagged an item", "Weapon", etc.).

      Don't get consued with Unpublished/Published. If you start the editor, everything is used from the Unpublished folder. The game is using the Published folder. Only with a special command the game will read the Unpublished folder. Conclusion: Place scripts and files related to script in Published.
      So right now I should stop using the unpublished flag, and setup my sync software to automatically copy over whats been cooked to the correct places in the cooked folder?


      So Unreal Tournament 3\UTGame\Localization\INT is the correct path for int files?

      I have it there and its not working then again let me check...okay I am getting the INIs and int mixed up.


      Code:
      [zippylabsmutut3zero UTUIDataProvider_Mutator]
      ClassName=Zippylabsut3.zippylabsmutut3zero
      FriendlyName=ZippyLabs: UT3
      Description=
      GroupNames=
      UIConfigScene=
      bStandaloneOnly=False
      BitValue=0
      bRemoveOn360=False
      bRemoveOnPC=False
      bRemoveOnPS3=False
      
      [UTWeap_zippylabut3spunisher UTUIDataProvider_Weapon]
      ClassName=Zippylabsut3.UTWeap_zippylabut3spunisher
      AmmoClassPath=
      Flags=
      FriendlyName=UTWeap_zippylabut3spunisher
      Description=Zippy Labs Punisher
      MeshReference=UI_Weapons.Mesh.SK_UI_Weapons_Enforcer_3P
      bRemoveOn360=False
      bRemoveOnPC=False
      bRemoveOnPS3=False
      The INT seems to work the ini not so much so how do I add the death messages and ammo pick up to the int?

      Comment


        #4
        Originally posted by ZippyDSMlee View Post
        So right now I should stop using the unpublished flag, and setup my sync software to automatically copy over whats been cooked to the correct places in the cooked folder?
        For developing purpose (or even for a release) you don't need to cook scripts. PC version of UT3 can always read uncooked content.


        Originally posted by ZippyDSMlee View Post
        So Unreal Tournament 3\UTGame\Localization\INT is the correct path for int files?
        Preferable in your profile folder.
        Code:
        %userprofile%\Documents\My Games\Unreal Tournament 3\UTGame\Published\CookedPC\Localization\INT
        %userprofile%\Documents\My Games\Unreal Tournament 3\UTGame\Published\CookedPC\Localization\DEU
        %userprofile%\Documents\My Games\Unreal Tournament 3\UTGame\Published\CookedPC\Localization\FRA
        ...

        Originally posted by ZippyDSMlee View Post
        I have it there and its not working then again let me check...okay I am getting the INIs and int mixed up.
        The ini file is just for the engine to know the mutator and to show it in the UI selecion. Instead of using a localization file, you have to add ItemName and PickupMessage to your def-props.
        Code:
        class MyWeap_Punisher extends UTWeapon;
        
        defaultproperties
        {
            ItemName="Punisher"
            PickupMessage="Punisher"
        }
        But you can use a Localization file too.

        PACKAGENAME.int
        Code:
        [MyWeap_Punisher]
        ItemName=Punisher
        PickupMessage=Punisher
        Ammo works the same way, but you would need a cusom ammo pickup factory.

        Comment


          #5
          Okay I seem to be doing soemthing wrong.

          mut
          Code:
          class zippylabsmutut3zero extends UTMutator;
          
          function InitMutator(string Options, out string ErrorMessage)
          {
          if (UTGame(WorldInfo.Game) != None)
          {
          UTGame(WorldInfo.Game).DefaultInventory[0] = class'Zippylabsut3.UTWeap_zippylabut3spunisher';
          }
          
          Super.InitMutator(Options, ErrorMessage);
          }
          
          function bool CheckReplacement(Actor Other)
          {
          if (Other.IsA('UTWeap_Enforcer') && !Other.IsA('UTWeap_zippylabut3spunisher'))
          {
          ReplaceWith(Other, "UTWeap_zippylabut3spunisher");
          }
          
          if (Other.IsA('UTAmmo_Enforcer') && !Other.IsA('UTAmmo_zippylabsut3punisher'))
          {
          ReplaceWith(Other, "UTAmmo_zippylabsut3punisher");
          }
          
          //==========================
          return true;
          }
          
          
          DefaultProperties
          {
          }
          ammo
          Code:
          /**
           * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved.
           */
          class UTAmmo_zippylabsut3punisher extends UTAmmoPickupFactory;
          
          defaultproperties
          {
          	AmmoAmount=25
          	TargetWeapon=class'UTWeap_Enforcer'
          	PickupSound=SoundCue'A_Pickups.Ammo.Cue.A_Pickup_Ammo_Enforcer_Cue'
          	MaxDesireability=0.2
          
          	PickupMessage="Punisher Block"
          	
          	Begin Object Name=AmmoMeshComp
          		StaticMesh=StaticMesh'Pickups.Ammo_Enforcer.Mesh.S_Ammo_Enforcer'
          		Scale=1.25
          		Translation=(X=0.0,Y=0.0,Z=-15.0)
          	End Object
          
          	Begin Object Name=CollisionCylinder
          		CollisionHeight=14.4
          	End Object
          }
          I tried changing TargetWeapon=class to zippylabsut3punisher but it gives me warnings, like it can not find the weapon but it works fine in the game.


          Thanks again for the help!

          Comment


            #6
            UTWeap_zippylabut3spunisher is the name of your weapon correct
            Code:
            class UTAmmo_zippylabsut3punisher extends UTAmmoPickupFactory;
            
            defaultproperties
            {
            
            	AmmoAmount=25
            	TargetWeapon=class'UTWeap_zippylabut3spunisher'
            	PickupSound=SoundCue'A_Pickups.Ammo.Cue.A_Pickup_Ammo_Enforcer_Cue'
            	MaxDesireability=0.2
            
            	PickupMessage="Punisher Block"
            	
            	Begin Object Name=AmmoMeshComp
            		StaticMesh=StaticMesh'Pickups.Ammo_Enforcer.Mesh.S_Ammo_Enforcer'
            		Scale=1.25
            		Translation=(X=0.0,Y=0.0,Z=-15.0)
            	End Object
            
            	Begin Object Name=CollisionCylinder
            		CollisionHeight=14.4
            	End Object
            	
            }
            did you have UTWeap_zippylabut3spunisher in there or zippylabsut3punisher. it should be UTWeap_zippylabut3spunisher.

            U said the weapon mutator loaded correctly? So the pickup message for the gun is working but not the ammo.

            Comment


              #7
              Originally posted by RattleSN4K3 View Post
              You need to find the PickupFactory which spawns the weapon, and then you can replace the class with your own. ReplaceWith only works with factories. Check UTMutator_WeaponReplacement.
              Have you checked ReplaceWith? It only works with PickupFactories.
              Code:
              /* ReplaceWith()
               * Call this function to replace an actor Other with an actor of aClass.
               * @note: doesn't destroy the original; can return false from CheckReplacement() to do that
               */
              function bool ReplaceWith(actor Other, string aClassName)
              {
                  local Actor A;
                  local class<Actor> aClass;
                  local PickupFactory OldFactory, NewFactory;
              
                  if ( aClassName == "" )
                      return true;
              
                  aClass = class<Actor>(DynamicLoadObject(aClassName, class'Class'));
                  if ( aClass != None )
                  {
                      A = Spawn(aClass,Other.Owner,,Other.Location, Other.Rotation);
                      if (A != None)
                      {
                          OldFactory = PickupFactory(Other);
                          NewFactory = PickupFactory(A);
                          if (OldFactory != None && NewFactory != None)
                          {
                              OldFactory.ReplacementFactory = NewFactory;
                              NewFactory.OriginalFactory = OldFactory;
                          }
                      }
                  }
                  return ( A != None );
              }

              Also what euchreplayer23 said.

              Comment


                #8
                Originally posted by euchreplayer23 View Post
                snip
                Ya its UTWeap_zippylabut3spunisher, thats what I put in but its gives a warning. Wait a sec.... *looks at the screen funny while sipping coffee*...okay so corrected all the warnings(the main one right now is texture warning it can not find my texture in my package) and now its not giving a warning...... I swear it hates me it crashed yesterday and stopped working altogether the log was unhelpful so I wiped the info in mydoc/mygames. ><


                Originally posted by RattleSN4K3 View Post
                snip
                Getting to it this morning I found it but not got to it yet.

                Code:
                /* ReplaceWith()
                 * Call this function to replace an actor Other with an actor of aClass.
                 * @note: doesn't destroy the original; can return false from CheckReplacement() to do that
                 */
                function bool ReplaceWith(actor Other, string aClassName)
                {
                    local Actor A;
                    local class<Actor> aClass;
                    local PickupFactory UTAmmo_Enforcer, UTAmmo_zippylabsut3punisher;
                
                    if ( aClassName == "" )
                        return true;
                
                    aClass = class<Actor>(DynamicLoadObject(aClassName, class'Class'));
                    if ( aClass != None )
                    {
                        A = Spawn(aClass,Other.Owner,,Other.Location, Other.Rotation);
                        if (A != None)
                        {
                            UTAmmo_Enforcer = PickupFactory(Other);
                            UTAmmo_zippylabsut3punisher = PickupFactory(A);
                            if (UTAmmo_Enforcer != None && UTAmmo_zippylabsut3punisher != None)
                            {
                                UTAmmo_Enforcer.ReplacementFactory = UTAmmo_zippylabsut3punisher;
                                UTAmmo_zippylabsut3punisher.OriginalFactory = UTAmmo_Enforcer;
                            }
                        }
                    }
                    return ( A != None );
                }
                Dose that look correct? I'll go run it up the tree now but with my luck I will scare the tree away. >< LOL

                Comment


                  #9
                  Ehm. ... No

                  Take a look at this code.
                  Code:
                  // Based on UTMutator_WeaponReplacement
                  class PunisherReplacementMutator extends UTMutator;
                  
                  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=class'UTWeap_Enforcer'
                      WeaponClassNew=class'MyWeap_Punisher'
                  
                      AmmoClassOld=class'UTAmmo_Enforcer'
                      AmmoClassNew=class'MyAmmo_Punisher'
                  }

                  Comment


                    #10
                    And this is why I scare things away ><

                    BTW how do you do death messages, thats totally confused me too, I'm just not sure how its implemented withing the weapon files, or do you need to make a new messages file and have the mutator call to it?

                    Are there any mutators with code that can be learned from to do basic things like replace default stuff in the game?

                    Comment


                      #11
                      Deathmessages are used by the damage type. If you haven't got any custom damage type, the original messages will be printed.

                      Originally posted by ZippyDSMlee View Post
                      Are there any mutators with code that can be learned from to do basic things like replace default stuff in the game?
                      There are several tutorials and example code on this forum and on the internet. You just have to search for it.

                      Comment


                        #12
                        Originally posted by RattleSN4K3 View Post
                        Deathmessages are used by the damage type. If you haven't got any custom damage type, the original messages will be printed.


                        There are several tutorials and example code on this forum and on the internet. You just have to search for it.
                        So what do I do in the damtype?

                        I see this
                        Code:
                        	KillStatsName=KILLS_Enforcer
                        	DeathStatsName=DEATHS_Enforcer
                        	SuicideStatsName=SUICIDES_Enforcer
                        I do not see where that leads to, in the int there are old style death messages that where in the code files in UT04 but I do not know how to put those in the code of the dmgtype. *brain fries*

                        The only way I can change it is via the INT, surely there is a ucode alternative?


                        Google is not my friend....


                        I guess I am using the wrong questions. What would be the best search query for adding custom weapon textures to ut3 tutorial?

                        Comment


                          #13
                          So if you use custom damage types like this:
                          Code:
                          class MyWeap_Punisher extends UTWeap_Enforcer;
                          
                          defaultproperties
                          {
                              InstantHitDamageTypes(0)=class'MyDmgType_Punisher'
                              InstantHitDamageTypes(1)=class'MyDmgType_Punisher'
                              DualEnforcerDamageType=class'MyDmgType_DualPunisher'
                          }
                          Code:
                          class MyDmgType_Punisher extends UTDmgType_Enforcer;
                          
                          defaultproperties
                          {
                              DamageWeaponClass=class'MyWeap_Punisher'
                          }
                          Code:
                          class MyDmgType_DualPunisher extends MyDmgType_Punisher;
                          You have to do the same as the weapon localization. Write the default values in the class directly or create a localization file. Epic had not created default values for each file as they knew everyone will has atleast the INT file installed for the stock classes. You won't find any localization in the classes.

                          If you check all the parent class from UTDmgType_Enforcer, you'll see some localized strings in the variables.
                          Code:
                          var() localized string         DeathString;                 // string to describe death by this type of damage
                          var() localized string        FemaleSuicide, MaleSuicide;    // Strings to display when someone dies
                          Now, you can extend your INT file like this.

                          PACKAGENAME.int
                          Code:
                          [MyWeap_Punisher]
                          DeathString="`k riddled `o full of holes with the Punisher."
                          FemaleSuicide="`o has performed the impossible."
                          MaleSuicide="`o has performed the impossible."
                          
                          [MyDmgType_DualPunisher]
                          DeathString="`k riddled `o full of holes with dual Punishers."
                          Or you could just add your default strings to your classes.

                          Code:
                          class MyDmgType_Punisher extends UTDmgType_Enforcer;
                          
                          defaultproperties
                          {
                              DamageWeaponClass=class'MyWeap_Punisher'
                          
                              DeathString="`k riddled `o full of holes with the Punisher."
                              FemaleSuicide="`o has performed the impossible."
                              MaleSuicide="`o has performed the impossible."
                          }
                          Code:
                          class MyDmgType_DualPunisher extends MyDmgType_Punisher;
                          
                          defaultproperties
                          {
                               DeathString="`k riddled `o full of holes with dual Punishers."
                          }

                          PS: The existing code comes with several examples .

                          Comment


                            #15
                            *worships you* I am unworthy!!!!! LOL This should keep me busy for a while LOL
                            THANK YOU!

                            Comment

                            Working...
                            X