home · browse · search · game entities · user directory · message board · IRC | register

October 27, 2006, 4:40 pm PDT
username  
password  
forgot password?

Popular Resources
  • Half-Life 2 Mod FAQ
  • Valve Hammer Editor
  • Hammer 3.5 beta test
  • Half-Life Utilities
  • game data files
  • ZHLT 2.5.3 custom build
  • Half-Life SDK
  • Feedback
    If you've got any feedback, suggestions, or bugs to report regarding the Collective website, go here!

  • Feedback (301)
  • Newsletter
     
    Enter your email address in the above form to add yourself to the email newsletter list. Click here for more info.

    Hosted Sites
  • Valve ERC
  • Collective
  • TFMapped
  • Spirit of Half-Life
  • Selective Design
  • Pixel Reviews
  • recent articles

    NPC and Item Placement Theory
    17/03/05 11:35pm PST
    Non-Player Character (NPC) and item placement can influence both the gameflow and immersion of a level. This article aims to give some pointers on how to properly place them.
    - Hugh 'Hugh' Lloyd

    Got Props?
    13/03/05 08:32am PST
    A common problem in HL2 mapping is props not showing up in game. This article explains why and offers solutions.
    - Jeff 'Yesukai' Pritchard

    Simulating Randomness
    18/12/04 11:29pm PST
    This article focuses on how to properly simulate random events that should occur at a certain average frequency, or within a certain probability per period of time.
    - Skyler 'Zipster' York

    Adding Single-Player Weapons to Half-Life 2
    15/12/04 06:52pm PST
    Covers the process behind adding weapons to a single-player Half-Life 2 modification.
    - Skyler 'Zipster' York

    Your world in HL2
    06/12/04 12:17am PST
    This article gives tips and advice to anyone wanting to make custom photorealistic textures to be used in Half-Life 2.
    - Oksid

    Hiding in Shadow
    21/08/04 01:11pm PDT
    Describes how to create a function that has monsters disregard you if you are hiding in a certain level of "darkness," which can be set from within map properties.
    - Anders [Wolf] Jenbo (NoBody)

    XSI EXP for Half-Life 2 Tutorial - Camera Control
    23/09/04 12:43am PDT
    A SOFTIMAGE|XSI tutorial explaining all of the camera controls available to you in XSI!
    - Josh Enes

    Bump Mapping in Half-Life
    08/08/04 11:58am PDT
    Details a method of achieving real-time bump mapping in Half-Life, and provides an implementation of the algorithm.
    - Francis 'DeathWish' Woodhouse

    Real-Time "TRON 2.0" Glow For Low-Spec Hardware
    19/06/04 02:06pm PDT
    A sequel to the original "Real-Time 'TRON 2.0' Glow" article, this describes how to implement real-time glow that works on low-spec graphics cards.
    - Francis 'DeathWish' Woodhouse

    Hitboxes and Code
    05/06/04 06:25pm PDT
    How do I make only one part of a monster take damage? Learn about the relationship between model hitboxes and what you can do with them in a characters code.
    - Jonathan 'Teh_Freak' Smith

    PAK Files and Directory Folders
    [Mon Mar 04, 2002 / 03:06pm PST] Marc 'Delete_Me' Henry - comments (0) comments enabled

    What is it?

    The .pak files are places that store sounds, models, maps, etc. in Half-Life and her mods. You can make your own using PakScape or even Wally (Both can be downloaded in the Utilities Section). Sometimes, people wish to change certain sounds or models in Half-Life and they modify the pak0.pak, which isn't recommended. In this tutorial, I will show you the several ways to insert a custom sound that replaces, for example, the scientist's 'yes.wav' sound.

    1. Pak Files - When You Are Distributing A Map Pack
      The .pak files are file holders that can overlap each other. They are coded so that if there are any files that have the same name and location in two .pak files, the file in the .pak with the highest number will override the one in the lower number.

      pak0.pak---->----pak1.pak---->----pak2.pak

      In this example, pak1.pak will override any duplicate files in pak0.pak, and pak2.pak can override any duplicate files in either pak0.pak or pak1.pak. This pattern continues on and on. There is a catch, though. Pak files have to be in numerical order, or else they won't be loaded. So if I have the .pak set-up like so:

      pak0.pak---->----pak1.pak----X----pak5.pak----X----pak436.pak

      pak0.pak and pak1.pak would be loaded and modify the game. However, pak5.pak and pak436.pak would not be counted, as the game will be looking for a pak3.pak file, and once it doesn't see it, it will stop looking for any more. If I would simply rename the above .paks to look like this:

      pak0.pak---->----pak1.pak---->----pak2.pak---->----pak3.pak

      All the .paks will load and override duplicate files.

      I can use our custom 'yes.wav' as an example now. Notice how the default HL .pak file is called pak0.pak. This means that it is the lowest .pak there is. To make my sound play in HL, I would use my Pak editor to make a new file called pak1.pak in the /valve/ folder, as 1 is a greater number then zero, for my numerically challenged friends. Then I would construct the same folder structure that the file I am replacing. Since the 'yes.wav' file is located in the sound/scientist/ folder in the pak0.pak file, I am going to make the same folders in my pak1.pak. So that my pak1.pak has a basic setup such as this:

      --pak1.pak
            |
            |
            +sound/
                  |
                  |
                  +scientist/

      Now, I would place my 'yes.wav' in the new scientist folder and then save the .pak (Make sure that your new .pak file is located in your HL/valve/ directory!). Now, whenever I run my game, the scientist will say my sound instead of the normal HL one!

    2. The Folders - When You're Just Playing Around
      If you look inside the /valve/ directory, or any other mod's directory for that matter, you can see that there are many folders that match the ones that are contained inside the pak0.pak file. This is because of the last step of the overriding process of the .pak files. If there are any files that are have the same name and location in any of the .pak files and folders, the one in the folder will override the one in the .pak file, no matter what the number of the .pak is. So if I put my custom 'yes.wav' file in the valve/sound/scientist/ folder, it will override the one in the pak0.pak, producing the same result as the first technique.

    3. The Custom Mod Folder - When You Distribute A Mod
      Many people, when they take all the time to make a lot of new sounds, maps, etc. they just go all the way and make a new mod. Their mods are selectable from the Custom Games menu in Half-Life and have their own folder inside the /half-life/ directory. They put all their files into that custom folder, still adhering to the .pak and folder techniques described above. What's different is that they name their .pak file pak0.pak, as there is no other .pak file in the directory. Now, you may be asking if they did this, if they would have to insert all the media they used from the original pak0.pak in the /valve/ folder. The answer is no. If a mod folder doesn't have something that Half-Life requires, it will automatically, pardon my expression, run home to mommy and use the needed materials from Valve's pak0.pak, or any other .pak's in the /valve/ directory.

      As you can see, every way has it's own uses. Whichever you use all has to do with what you are planning on doing with your materials.

    article created on Mon Mar 04, 2002 / 03:06pm PST
    this item has been viewed 760 times
    [general / general]

    Only registered users can post comments. Have you registered yet?

    noone has commented on this document

    VERC © 2004. All content copyright its respective owner, all rights reserved.
    script execution time: 0.0755360126495 seconds