LogoLogo
简体中文
简体中文
  • 主页
  • 联系我们
  • 感谢名单
  • 维基101 - 如何开始?
    • 修改指南
      • 如何备份,解包和重新打包
      • 如何配置修改用一个工作环境
      • 修改工具
        • 如何使用RSPNVPK
        • 资源
          • 游戏目录
          • BSP
            • BSPSource
            • BSP Viewer
            • BSP2MAP
            • BSPZIP
            • EntEd
            • Entspy
            • Map Analyst
            • PackBsp
            • Pakrat
            • VBSP_h4xed
            • VIDE
            • VMEX
            • WinBSPC
            • WinBSPZip
          • Hammer
            • 位移Luxel密度
          • VTF & VMT
            • VTFEdit
            • Vtex
              • Vtex - 编译参数
              • Vtex - 疑难解答
  • 信息
    • 纹理
      • Valve纹理格式-VTF
        • 创建材质
        • 创建动画粒子
        • 修改动画粒子-Wanty的方法
      • Valve材质类型-VMT
      • 纹理和颜色
        • 颜色和纹理信息
      • 着色器
        • $basetexture
        • $color
        • $reflectivity
        • 材质标志
      • 反照率贴图
      • 凹凸贴图
        • $bumpmap
        • $ssbump
      • 立方环境贴图
      • 光照贴图
      • 矢量材质
      • 纹理映射
      • 内容丢失
      • 基础天空盒
        • 2D天空盒
        • 3D天空盒
    • 脚本
      • 关键值
        • Gameinfo.txt
        • 武器配置
      • VScript
    • 文件格式
      • NUT & GNUT-Squirrel游戏语言
      • PSD-Photoshop文档
      • TGA-Truevision图像文件
      • TXT-文本文件
      • VPK-Valve包文件
    • 文件位置
      • VPK
      • 武器
        • 武器模型
        • 武器脚本
        • 武器配置
      • 模型
        • 模型-天空背景
        • 铁驭
          • 模型-铁驭能力
          • 模型-铁驭武器
        • 泰坦
        • 模型-引导标志
        • 模型-容器
        • 模型- Fixtures
        • 模型-IMC基础
        • 模型-工业
        • 模型- 虎大前进基地_live_fire
        • 模型-NPC
        • 模型-边境防御
  • 修改
    • 武器
      • 自定义武器皮肤
        • 使用\应用自定义武器皮肤
          • VTF文件制作
        • 制作武器自定义皮肤
          • 2D图像线框渲染模式(Wireframe mode)
        • 武器自定义皮肤样例
      • 武器效果
      • 准星修改
        • 批量修改准星
        • 准星样例
      • 武器定位
      • 武器视野
      • 一键更换武器视野
      • 特殊/独特武器修改
        • 电能步枪-电弧枪
        • 电能步枪-蓄力颜色
        • LSTAR-蓄力颜色
    • 铁驭
      • 模型-铁驭类
    • 泰坦
      • 泰坦的穹顶护盾
      • 北极星
        • 线缆-钩爪和绊索陷阱
        • 电浆磁轨炮-蓄力特效
        • 北极星-重力特效
        • 北极星-铝热剂特效
      • 浪人
        • 剑封颜色
      • 军团
        • 强大火力-蓄力颜色
      • 离子
        • 镭射炮-蓄力颜色
        • 漩涡防护罩颜色
    • 地图
      • 地图-天空背景
      • 地图-立体地图
      • 战争游戏
        • 全息墙颜色
    • 用户界面
      • 游戏文本修改-r1_language
      • 游戏中
        • 计分板背景
      • 菜单
        • 暂停菜单模糊
        • 主菜单背景
        • 网路-菜单
        • 新闻和聚焦
        • 设置
          • 控制
          • 按键设置
    • 声音
      • 击杀音效
      • 大厅背景音乐
    • 杂项
      • 电缆-滑索
      • 马文机器人-胸部显示屏
      • 脉冲刀范围特效
      • 被声呐探测到的效果
      • 模型-炸蛛
      • 尼斯湖水怪模型
  • 脚本数据
    • 准星
    • 特效(FX)
    • 特效
      • 特效-铁驭
        • 特效-铁驭武器
          • 特效-突击步枪
          • 特效-冲锋枪
          • 特效-轻机枪
          • 特效-狙击步枪
          • 特效-散弹枪
          • 特效-榴弹发射器
          • 特效-副手武器和手枪
          • 特效-反泰坦武器
          • 特效-特殊武器
        • 特效-铁驭投掷物
          • 特效-电弧效果
          • 特效-飞火星
          • 特效-重力星
        • 特效-铁驭能力
      • 特效-泰坦
        • 特效-离子
        • 特效-强力
        • 特效-北极星
          • 特效-电浆轨道炮
          • 特效- Holo Railgun
          • 特效-毒蛇
        • 特效-帝王
          • 特效-Monarch Beam
        • 特效-浪人
        • 特效-烈焰
          • 特效-铝热剂发射器
          • 特效-Meteor First
          • 特效-火墙
        • 特效-军团
      • 特效-NPC和炮台
        • 特效-NPC
          • 特效-无人机
          • FX - Drone Cloak
          • FX - Drone Frag
          • FX - MRVN
          • FX - Mortar
          • FX - Holo Spectre
        • 特效-炮台
      • 特效-杂项和未知项
        • FX - Holo Map
        • FX - Beacon
        • FX - Skybox
          • FX - Skybox 1K
          • FX - Skybox Carrier
          • FX - Skybox Creature
          • FX - Skybox Nuke
          • FX - Skybox Station Traffic
        • FX - Skyway
        • FX - Dev
          • FX - Bug Repro
        • FX - Droppod
        • FX - Scan
      • 特效-原始数据
        • FX - EMP
        • FX - Env
        • FX - Grenade
        • FX - Harvester
          • FX - Coop Harvester FX
        • FX - HUD
          • FX - HUD AR FX
          • FX - HUD AR Impacts
          • FX - HUD AR Lines
          • FX - HUD AR Ordinance
          • FX - HUD AR Pings
          • FX - HUD AR Titandroppoint
        • FX - Impact
          • FX - Impact FX EXP Cutom
        • FX - Light
        • FX - Orbital Strike
        • FX - Projectile Plasma
        • FX - Reload
        • FX - Shell Eject
        • FX - Smoke
        • FX - Tracers
        • FX - Weapon
          • FX - Arc Cannon
          • FX - Dragonbreath
          • FX - Flamethrower
          • FX - Malta Gun
          • FX - Triple Threat
    • 声音
      • 声音-默认语音
      • 声音-铁驭
        • 铁驭武器
          • 突击步枪
          • 冲锋枪
          • 轻机枪
          • 狙击步枪
          • 散弹枪
          • 榴弹枪
          • 副手武器及手枪
          • 反泰坦武器
        • 铁驭投掷物
        • 铁驭能力
      • 声音-泰坦
        • 声音-离子
        • 声音-强力
        • 声音-北极星
        • 声音-帝王
        • 声音-浪人
        • 声音-烈焰
        • 声音-军团
      • 声音-无人机和NPC
        • 声音 -巨型炮塔
      • 声音-杂项和未知项
        • 声音-电弧炮
        • 声音-电弧枪
        • 声音- Flamethrower
        • 声音- Triplethreat
    • 图标和HUD
      • 菜单
        • 私房加载界面
        • 私人比赛
        • 计分板
  • 修改样例
    • 低配模式
    • 无HUD修改
  • 导出资源
    • 导出地图
    • 导出模型
    • 使用Legion的方式导出
  • 资源
    • 纹理库
Powered by GitBook
On this page
  • 创建
  • Linux / Unix系统
  • Windows系统
  • 命令
  • 用法
  • 例子
  • 创建VPK/添加文件
  • 提取文件
  • 显示VPK信息
  • VPK完整性/安全性
  • 杂项
  • 设置
  • 例子
  • 为MOD定制VOK
  • 创建键值文件和VPK
  • 响应文件

Was this helpful?

  1. 信息
  2. 文件格式

VPK-Valve包文件

VPK (Valve Pak) files are uncompressed archives used to package game content.

PreviousTXT-文本文件Next文件位置

Last updated 3 years ago

Was this helpful?

VPK (Valve Pak) files are uncompressed archives used to package game content. Valve's post- games store , , , and many other file types in VPK files. VPKs are also used to distribute mods via the the addoninstaller tool that ships with some games, such as .

创建

VPKs can be created with the tool vpk.exe.

The tool can be located in the bin folders for most Source games, such as the ones below. The tool is not game dependent, however it is suggested that you use the tool that corresponds to the game you are creating the vpk for. The version in one game may not be as up to date as the version in another due to game updates.

Game

Path to VPK.exe

C:\Program Files (x86)\Steam\SteamApps\common\Alien Swarm\bin

C:\Program Files (x86)\Steam\SteamApps\common\Team Fortress 2\bin

C:\Program Files (x86)\Steam\SteamApps\common\Left 4 Dead\bin

C:\Program Files (x86)\Steam\SteamApps\common\Counter-Strike Source\bin

C:\Program Files (x86)\Steam\SteamApps\common\Source SDK Base 2013\<Singleplayer or Multiplayer>\bin

C:\Program Files (x86)\Steam\SteamApps\common\Counter-Strike Global Offensive\bin

C:\Program Files (x86)\Steam\steamapps\common\Portal 2\bin

For servers installed using , it is located in the server's bin\ directory. On Linux, it is named vpk_linux32 instead of vpk.exe.

Linux / Unix系统

On Linux / Unix clients, the vpk file can be found replacing "C:\Program Files (x86)\Steam\SteamApps\common" for "~/.steam/steam/SteamApps/common/". However, it is named vpk_linux32 instead of vpk.exe.

If you are running on a 64-bit system, this binary will not work by default. You must tell it to use the 32-bit libraries located in the same directory. This can be done by setting the LD_LIBRARY_PATH variable. The following script, if created in the above listed bin directories, will create a wrapper to properly launch the 32-bit executable; then a link (or desktop shortcut) to vpk.sh (if saved as said name) can be created, from there:

#!/bin/bash
DIR=$(dirname "${BASH_SOURCE[0]}")
export LD_LIBRARY_PATH=$(cd "$DIR" && pwd)
exec "$DIR/vpk_linux32" "${@}"

Alternatively, if you're running 64-bit Linux, you can use this script to execute the vpk_linux32 binary successfully. Save this script to "/usr/local/bin/vpk" and set it as an executable in the file's properties, for ease of use:

#!/bin/bash
VPK_LINUX=$(find "${HOME}/.local/share/Steam" -type f -iname "vpk_linux32" -print | head -n 1)
VALVE_LIB_DIR=$(dirname "${VPK_LINUX}")
LD_LIBRARY_PATH="${VALVE_LIB_DIR}:${LD_LIBRARY_PATH}" "${VPK_LINUX}" "${@}"

Note: The "${@}" is for drag-and-drop with *.desktop files and arguments when using the vpk command via console.

Windows系统

On Windows, a shortcut (*.lnk) linked to the vpk.exe file in the bin folder can be created instead, making it so that you can drag-and-drop folders onto the shortcut and get a *.vpk file in return, and vice-versa.A easily-created shortcut named "vpk" can be left in the custom folder, making packaging folders into vpk's and vice-versa (while also debugging your custom files) a lot easier instead of having to do it from the command prompt.

命令

用法

vpk [options] <command> <command arguments...>vpk [options] <directory>vpk [options] <vpkfile>

例子

vpk -?Lists all of the help info, list of available arguments, and info about each argument.

创建VPK/添加文件

vpk <dirname>

Creates a pack file named <dirname>.vpk. Must be an existing location. The VPK will appear next to the directory.

Tip:Drag a folder onto the tool in Explorer to trigger this command.

vpk a <vpkfile> <filename1> <filename2> ...

Add file(s).

a <vpkfile> @<filename>

Adds the files referenced in a "response file" (not response rules). Note the @ symbol.

k vpkfile <keyvalues_filename>

Bug: They will appear inside the VPK with their full path (C:\etc\) intact - is there a way to avoid this?

vpk <directory>

Create VPK from directory structure.

Note:This is invoked when a directory is dragged onto the VPK tool.

提取文件

vpk x <vpkfile> <filename1> <filename2> ...

Extract file(s).

vpk <vpkfile>

Extract all files from VPK.

Note:This is invoked when a .VPK file is dragged onto the VPK tool.

显示VPK信息

vpk l <vpkfile>

List contents of VPK.

vpk L <vpkfile>

List Detailed contents of VPK.

VPK完整性/安全性

vpk checksig <vpkfile>

Verify signature of specified VPK file. Requires -k to specify key file to use.

杂项

vpk generate_keypair <keybasename>

Generate public/private key file. Output files will be named <keybasename>.publickey.vdf and <keybasename>.privatekey.vdf

Note:Remember: your private key should be kept private.

设置

Tip:Please note the case of these options. A capital letter is different than a lowercase letter.

-v

Verbose output.

-M

Produce a multi-chunk VPK.

Note:Required if creating a VPK with key values.

  • Each chunk is a file limited to around 200MB.

Note:Multi-chunk generations only works when creating a VPK from a response file.

Tip:To inspect a multi-chunk VPK open the '_dir' file.

-P

Use SteamPipe-friendly incremental build algorithm. Use with 'k' command. For optimal incremental build performance, the control file used for the previous build should exist and be named the same as theinput control file, with '.bak' appended, and each file entryshould have an 'md5' value. The 'md5' field need not be theactual MD5 of the file contents, it is just a unique identifierthat will be compared to determine if the file contents has changedbetween builds.

-c <size>

Use specified chunk size (in MB). Default is 200.

-a

Align files within chunk on n-byte boundary. Default is 1.

-K

With commands 'a' or 'k': Sign VPK with specified private key.

-k

With commands 'a' or 'k': Public key that will be distributed and used by third parties to verify signatures.With command 'checksig': Check signature using specified key file.

例子

Listed below are some examples of using the tool and what they will do.

为MOD定制VOK

Content must be a subdirectory under sound/materials/models in the root dir of your VPK, or else they won't appear in hammer. IE your sounds should be located in sound/foo/thisIsASound.wav in your custom vpk, models under models/, materials under materials/, ect.

VPKs must be mounted in gameinfo.txt.

创建键值文件和VPK

1. Create a folder with the correct directory structure and files that you wish to use such as mymod/resource/ui/<file.res>2. Use the command line in a prompt or a bat:vpk generate_keypair <name>vpk -M -k <name>.publickey.vdf -K <name>.privatekey.vdf "C:\Program Files (x86)\Steam\SteamApps\common\Team Fortress 2\bin\mymod"3. In the folder where the vpk tool is located there will now be a public key vdf, a private key vdf, a vpk named mymod_000 and a vpk named mymod_dir.

Warning: Never disclose or share your private key vdf or the key. Only share the public key.

  • You must distribute your mod with both the mymod_dir and mymod_000 vpks for the keyvalue to work.

响应文件

A "response file" contains a list of files to be added to a VPK. Paths are relative to the current directory of the vpk tool.

Below is a Python script which generates a response file and then builds a multi-chunk VPK. Put it in your mod folder. You will need to edit the three variables at the top.

# User settings (don't use the \ character)
target_folders = [ "materials", "models", "particles", "scenes" ]
file_types = [ "vmt", "vtf", "mdl", "phy", "vtx", "vvd", "pcf", "vcd" ]
vpk_path = "C:/Program Files (x86)/Steam/steamapps/common/SourceFilmmaker/game/bin/vpk.exe"

# Script begins
import os,subprocess
from os.path import join
response_path = join(os.getcwd(),"vpk_list.txt")

out = open(response_path,'w')
len_cd = len(os.getcwd()) + 1

for user_folder in target_folders:
	for root, dirs, files in os.walk(join(os.getcwd(),user_folder)):
		for file in files:
			if len(file_types) and file.rsplit(".")[-1] in file_types:
				out.write(os.path.join(root[len_cd:].replace("/","\\"),file) + "\n")

out.close()

subprocess.call([vpk_path, "-M", "a", "pak01", "@" + response_path])

排除的文件格式

Executable and archive files are discarded by the VPK tool:

.zip .reg .rar .msi .exe .dll .com .cmd .bat

Add files references in a control file.

To reduce patch sizes, chunks are never overwritten. New/modified files are instead written to a brand new chunk every time you run the tool.

To handle this process for portal 2 you can also use the , to automate the response file creation and the creation of the vpk files.

Source:

GCF
materials
models
particles
choreography scenes
Left 4 Dead 2
command line
SteamCMD
keyvalues
https://developer.valvesoftware.com/wiki/VPK
P2 Multichunk Tool
Alien Swarm
Team Fortress 2
Left 4 Dead
Counter-Strike: Source
Source SDK Base 2013
Counter-Strike: Global Offensive
Portal 2
<Counter-Strike: Source>
<Alien Swarm>
<Source>
[Portal 2]
<Team Fortress 2>
<Left 4 Dead>
[Portal 2]
<Counter-Strike: Global Offensive>