Announcement

Collapse
No announcement yet.

Setting for importing weapon texture.

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

    Setting for importing weapon texture.

    I been looking around for info on importing a weapon texture and I have had no luck I can find body/world,ect tuts but nothing geared to weapons. I do not know what settings to use when you import a texture for weapons.

    Got my texture done so I can't wait to see it in game.

    http://img.photobucket.com/albums/v6...psa87b5818.jpg

    #2
    I managed to import and in the weapon and attachment I have tried using this

    Code:
    simulated function SetSkin(Material NewMaterial)
    {
    	Super.SetSkin(NewMaterial);
    	Mesh.SetMaterial(0, Material'Zippylabsut3.Mat.punisherzippylabsred');
    }

    I moved the package to cooked and still nothing.

    Comment


      #3
      If you setup the weapon correctly, you don't need any additional code.

      Code:
      class MyWeap_Punisher extends UTWeap_Enforcer;
      
      defaultproperties
      {
          Begin Object Name=FirstPersonMesh
              Materials(0)=Material'Zippylabsut3.Mat.punisherzippylabsred'
          End Object
      }
      If you got warning of unreferenced content while compiling, place the packages in the cooked (/uncooked) folder (not sure which one is used atm ^^).

      Comment


        #4
        Still getting warnings with the upk file right by the u file in cooked folder.....I am so lost LOL.

        Oh my weapon texture is dt5 and not dt1 will that effect anything?

        Comment


          #5
          A "cooked folder" exists in both valid directories. What are your warning?

          Comment


            #6
            I use the published cooked folder.
            C:\Games\Steam\steamapps\common\Unreal Tournament 3\Development\Src\Zippylabsut3\Classes\zippylabsmu tut3zero.uc(19) : Warning, CheckReplacement: Missing return
            value
            C:\Games\Steam\steamapps\common\Unreal Tournament 3\Development\Src\Zippylabsut3\Classes\UTWeap_zipp ylabut3spunisher.uc(79) : Warning, ObjectProperty Engine.Mes
            hComponent:Materials.Materials: unresolved reference to 'Material'zippylabsut3pak.Mat.punisherzippylabsred ''
            C:\Games\Steam\steamapps\common\Unreal Tournament 3\Development\Src\Zippylabsut3\Classes\UTWeap_zipp ylabut3spunisher.uc(79) : Warning, Invalid property value in
            defaults: Materials(0)=Material'zippylabsut3pak.Mat.punisher zippylabsred'

            The zippylabsut3pak.upk is in the weapons folder.

            MMm I am not missing anything in this line am I?


            Code:
              Materials(0)=Material'zippylabsut3pak.Mat.punisherzippylabsred'

            Comment


              #7
              Your CheckReplacement method should return the true value for the default path.

              Code:
              function bool CheckReplacement(Actor Other)
              {
                  if (AnyClass(Other) != none)
                  {
                      // do something
                  }
              
                  // Return true to keep this actor, otherwise this actor will be destroyed
                  return true;
              }
              If your material exist in the content packages with the exact path, it's okay.

              Copy your package into both folders:
              Code:
              %userprofile%\Documents\My Games\Unreal Tournament 3\UTGame\Published\CookedPC
              %userprofile%\Documents\My Games\Unreal Tournament 3\UTGame\Unpublished\CookedPC

              Comment


                #8
                This is my replacement code

                Code:
                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");
                }
                
                //==========================
                return true;
                }
                Is it the right way to replace a weapon?

                Comment


                  #9
                  Ehm no. I already replied of how to replace a weapon here:
                  Originally posted by RattleSN4K3 View Post
                  GOTO POST
                  If you check the ReplaceWith method, you would know it .

                  Code:
                  function bool ReplaceWith(actor Other, string aClassName)
                  {
                      local Actor A;
                      local class<Actor> aClass;
                      local PickupFactory OldFactory, NewFactory;
                  
                      // At this line the following parameters are set:
                      // Other = UTWeap_Enforcer_0
                                     (instance of UTWeap_Enforcer)
                      // aClassName = "UTWeap_zippylabut3spunisher"
                                             (also this path is incorrect as it needs a fully qualified name like "PACKAGENAME.UTWeap_zippylabut3spunisher"
                  
                      if ( aClassName == "" ) // aClassName is definitely not empty, so we continue
                          return true;
                  
                      // Trying to load the class given by the path in aClassName.
                      aClass = class<Actor>(DynamicLoadObject(aClassName, class'Class'));
                      
                      // as the given path is not fully qualified, aClass is empty (=none) ...
                      if ( aClass != None )
                      {
                          // but let'S assume aClass has a valid class like:
                          // aClass = class'PACKAGENAME.UTWeap_zippylabut3spunisher';
                  
                          // this code spawns a new instance of our class at the location of the old actor stored in Other
                          A = Spawn(aClass,Other.Owner,,Other.Location, Other.Rotation);
                  
                          // as aClass is assumed being valid, the class is successfully spawned...
                          if (A != None)
                          {
                              // ... now both instances of the old and new class are casted to factories
                              OldFactory = PickupFactory(Other);
                              NewFactory = PickupFactory(A);
                  
                              // this cast is only valid (and will return a casted actor) if our instances extend from PickupFactory (directly or indirectly).
                              // OldFactory is set to none as
                              // the class hierarchy of UTWeap_Enforcer is the following:
                              // Object >> Actor >> Inventory >> Weapon >> GameWeapon >> UTWeapon >> UTWeap_Enforcer
                              // which does not contain PickupFactory
                  
                              // The same goes for NewFactory, but as the if-condition is already failing because of:
                              // OldFactory != none <==> false
                  
                              if (OldFactory != None && NewFactory != None)
                              {
                                  // this code is never reached as our given actors is not a factory
                                  OldFactory.ReplacementFactory = NewFactory;
                                  NewFactory.OriginalFactory = OldFactory;
                              }
                  
                              // even if our given aClassName is spawned, it will likely be destroyed as it is a weapon without any holder
                              // placed pickups like weapon do not spawn a weapon class before a Pawn as touched the factory. It's only a visible mesh.
                          }
                      }
                  
                      // because aClassName is not fully qualified, nothing is spawned here
                      return ( A != None );
                  }
                  Conclusion:
                  You can only replace/subsitute PickupFactories with UTMutator::ReplaceWith. For this case, it is useless as weapons are using a generic weapon factory.

                  Comment


                    #10
                    I got everything working but the texture, I am starting to think its the settings I used to import it with.

                    Comment

                    Working...
                    X