How do I use custom textures?

Discussion in 'Mapping Questions & Discussion' started by Harry :), Aug 31, 2015.

  1. Harry :)

    Harry :) L1: Registered

    Messages:
    12
    Positive Ratings:
    0
    I imported my own texture* into Hammer and made a Minecraft map. When I tried using the map on my server, my friends couldn't see the texture (it was black and purple), but I could.

    I apologise if this is a thread duplicate, I was having trouble getting good results.

    *Technically SourceCraft imported the textures and generated the VMF. The reason I didn't say this above is because you might not understand the problem.
     
  2. killohurtz

    aa killohurtz Distinction in Applied Carving

    Messages:
    1,005
    Positive Ratings:
    1,157
    If the textures are visible to you, then you are using them correctly. That's the good news!

    However, in order for other people to see them, there's another step - packing them into your map. VIDE is a popular tool for this. Basically, since the textures you used don't ship with TF2, your friends don't have the files, and so they see them as missing textures (the purple and black checkerboard). Embedding the files into the .bsp with a packing tool allows everyone else to see them without downloading the file itself.
     
    • Thanks Thanks x 3
  3. Harry :)

    Harry :) L1: Registered

    Messages:
    12
    Positive Ratings:
    0
    Thanks!
    I also just realised I derped really badly, cause I have Pakrat and I probably could have easily figured it out with a few more tries.
     
  4. Harry :)

    Harry :) L1: Registered

    Messages:
    12
    Positive Ratings:
    0
    Actually, I still need help. I don't really want to use another program, and I still don't know how to use Pakrat. It might be because it's not finding the Minecraft files.
     
  5. Harry :)

    Harry :) L1: Registered

    Messages:
    12
    Positive Ratings:
    0
    Also, if there's a way to just add the materials to my server instead of the map, then packing the textures isn't vital.
     
  6. killohurtz

    aa killohurtz Distinction in Applied Carving

    Messages:
    1,005
    Positive Ratings:
    1,157
    I've only ever used VIDE so someone else may be able to answer this question better than me. I can at least ask, though, if you have Pakrat configured to scan the tf directory? You could also try moving your custom files from tf/custom to tf/materials or vice versa, and then try scanning again.

    I would not recommend forcing clients to download the textures because they may be using the in-game option that suppresses custom file downloads.
     
    • Thanks Thanks x 1
  7. KlashFire

    KlashFire L1: Registered

    Messages:
    17
    Positive Ratings:
    1
    with pakrat, its just as easy as VIDE I believe.
    you open the bsp file, click the "Add..." button, and navigate to the tf/ folder where you stored those textures.
    select the vtf AND vmt files that you used with the map, hit enter, save the map, done
     
    • Thanks Thanks x 1
  8. worMatty

    aa worMatty Repacking Evangelist

    Messages:
    1,072
    Positive Ratings:
    834
    Adding materials to the server is actually a lot more work because you have to compress each of them as a BZ2, then made a resource file that instructs the client to download them. It also takes longer because the operation is split in to many, rather than the single operation of downloading the map with everything packed inside.

    Pakrat and VIDE are both a bit funny. I keep my assets in tf/custom/wormatty (for example) and then in materials, sounds, models and so on. When I want to scan my map for custom things in Pakrat, I have to point its search field to tf/custom/wormatty for it to find all my custom things. Once it does that you have to confirm you want those files packed in to your BSP. When you have done it and saved your map, you can check to see if it worked by opening the map in GCFscape!
     
    • Thanks Thanks x 1
  9. Snowbat

    Snowbat L4: Comfortable Member

    Messages:
    165
    Positive Ratings:
    61
    I've always used Pakrat. It's a simple yet effective program. It's really not advised to upload them on the server. It's better to pakrat them into your BSP.
    You just have to run that pakrat.jar thing, load your map's BSP and then click the add button. Navigate to your textures folder, select it and add it.
    Then save your BSP (File--> Save)

    It's advised to take a backup of your BSP before packing anything in it. Also, small detail, I think it's important to first run buildcubemaps on your map before packing anything in it. Not sure about this one though.

    EDIT: why the **** does the spell checker at work always change the word "Always" to have a capital letter?
     
    • Thanks Thanks x 1
  10. worMatty

    aa worMatty Repacking Evangelist

    Messages:
    1,072
    Positive Ratings:
    834
    Pakrat automatically makes a backup of the .bsp in the same directory. I think it gets an extension like .bak or something similar.

    Yeah, following on from what Snowbat says, Pakrat can corrupt your map if you use it more than once on the same map, so maybe it is better to buildcubemaps first before packing. VIDE doesn't have that problem (neither does bspzip or CompilePal, which just uses bspzip anyway).
     
    • Thanks Thanks x 1
  11. Harry :)

    Harry :) L1: Registered

    Messages:
    12
    Positive Ratings:
    0
    Buildcubemaps?

    It asked me if it should correct the path, and since I'm not completely sure what that does, I clicked no (all 400+ times, even though I'm not using all of the Minecraft textures).
     
  12. PyroDevil

    PyroDevil L3: Member

    Messages:
    124
    Positive Ratings:
    108
    Cubemaps are used for textures with reflective surfaces, such as water. If a map isn't using cubemaps, or they have not been build, the surface will have a black purple checker board to the surface. Buildcubemaps is a command used to build the cubemaps when you are in-game. You want to make sure the map has identified the textures and creates a file for it before packing it Since I haven't ever used the minecraft texture pack, I do not know if any require cubemaps.

    I've used VIDE and Pakrat, and both are pretty good programs. Personally, I have recently used VIDE because of some trouble with PakRat. With VIDE, you first need to select the bsp with the Pakfile Lump Editor, then select "scan", and tell the program to scan a folder. (I usually scan the tf folder) After the scan, most files will come up with a yellow-ish background. This means these files are in the map, but not official. Then you can either select a file and click "add" or use "auto" to automatically add those files. Lastly, press "apply" and then "save"
     
    • Thanks Thanks x 2
    Last edited: Sep 4, 2015
  13. worMatty

    aa worMatty Repacking Evangelist

    Messages:
    1,072
    Positive Ratings:
    834
    When a map is loaded, the packed assets are mounted to the game and it pretends they are installed in tf/materials, or tf/models, etc. So the things inside your map need to have the same directory structure, which is where the packing program might ask you about correcting the directory. So in a packed map, rather than a file living in C:\User\Matty\Documents\TF2 Mapping\Materials\blahblahblah... they need to live in materials/ or models/ or sounds/ and so on. If you open up a custom map in GCFscape you will see how the map author has packed the custom assets. Try opening one of the Gun Mettle maps.

    You could save yourself a lot of time if you tried CompilePal. It takes care of all of the packing for you (when it works).
     
    • Thanks Thanks x 2
  14. Harry :)

    Harry :) L1: Registered

    Messages:
    12
    Positive Ratings:
    0
    Where am I supposed to put the materials? CompilePal didn't work for me. It said it I referenced a texture that doesn't exist.
     
  15. Harry :)

    Harry :) L1: Registered

    Messages:
    12
    Positive Ratings:
    0
    Oh. Just realised I moved the textures so I could see if the map worked. The textures did show. I think it works now! Yeess!!!