VPC Scripts: Difference between revisions
mNo edit summary |
(added relevant software tags) |
||
Line 1: | Line 1: | ||
[[Category:SDK_Documentation]] | [[Category:SDK_Documentation]] | ||
VPC (or | {{VPC|4}} (or {{VPC|4|nt=1}}) is a a command line tool that ships with the {{User:SomeoneTookSeven/TemplateSDK}}. This tool is used for constructing {{Visual Studio|4}} projects (<code>.vcproj</code>) with consistent project properties. | ||
The | The {{source|4|nt=1}} uses pre-processor definitions to determine what code needs to be compiled in any given file for the target settings. While the SDK does use some pre-defined definitions set by the compiler or operating system, it also uses custom definitions like <code>CLIENT_DLL</code> and <code>TF_CLIENT_DLL</code> to tell the compiler what is or isn't needed from that file. | ||
This is done for maximum reusability. Every file in the source engine will be functional across all projects and platforms as long as the preprocessors are setup correctly. While extremely useful, it can be un-intuitive at times when read the source code to understand why things were implemented the way they were. | This is done for maximum reusability. Every file in the source engine will be functional across all projects and platforms as long as the preprocessors are setup correctly. While extremely useful, it can be un-intuitive at times when read the source code to understand why things were implemented the way they were. | ||
== Using VPC == | == Using VPC == | ||
VPC gets really powerful in two distinct ways. First is the command line. VPC offers a quick, consistent, and easy way to generate or modify large source engine projects. | {{VPC|4}} gets really powerful in two distinct ways. First is the command line. VPC offers a quick, consistent, and easy way to generate or modify large source engine projects. | ||
if you have downloaded the | if you have downloaded the {{User:SomeoneTookSeven/TemplateSDK}} and opened it (if you haven't please see a relevant page about that) you would have already used VPC in the form of a <code>.bat</code> file. | ||
When you ran <code>createallprojects.bat</code> you actually ran the code: | When you ran <code>createallprojects.bat</code> you actually ran the code: | ||
Line 21: | Line 21: | ||
=== VPC Script Files === | === VPC Script Files === | ||
VPC can also be written as scripts with the <code>.vpc</code> file extension. These files work in conjunction with the VPC command line to generate the projects. These files is where per-project properties are setup, pre-processor definitions set, what files to include in the given project, and even where the output should be directed to. | {{VPC|4}} can also be written as scripts with the <code>.vpc</code> file extension. These files work in conjunction with the VPC command line to generate the projects. These files is where per-project properties are setup, pre-processor definitions set, what files to include in the given project, and even where the output should be directed to. | ||
For those interested in editing or writing their own VPC scripts see [[/Syntax]] | For those interested in editing or writing their own VPC scripts see [[/Syntax]] and [[Editing_VPC_scripts]] |
Revision as of 15:17, 28 July 2025
VPC (or
Valve Project Creator) is a a command line tool that ships with the
Source SDK. This tool is used for constructing
Visual Studio projects (
.vcproj
) with consistent project properties.
The Source Engine uses pre-processor definitions to determine what code needs to be compiled in any given file for the target settings. While the SDK does use some pre-defined definitions set by the compiler or operating system, it also uses custom definitions like
CLIENT_DLL
and TF_CLIENT_DLL
to tell the compiler what is or isn't needed from that file.
This is done for maximum reusability. Every file in the source engine will be functional across all projects and platforms as long as the preprocessors are setup correctly. While extremely useful, it can be un-intuitive at times when read the source code to understand why things were implemented the way they were.
Using VPC
VPC gets really powerful in two distinct ways. First is the command line. VPC offers a quick, consistent, and easy way to generate or modify large source engine projects.
if you have downloaded the Source SDK and opened it (if you haven't please see a relevant page about that) you would have already used VPC in the form of a
.bat
file.
When you ran createallprojects.bat
you actually ran the code:
devtools\bin\vpc.exe /hl2mp /tf /define:SOURCESDK +everything /mksln everything.sln
This simplifies the process of creating project files and ensure that those working in teams can all have a consistent setup.
For More information about what VPC can do in the command line type vpc /h
in your own environment or see the output on the /help subpage.
However this is not the only way to utilize VPC.
VPC Script Files
VPC can also be written as scripts with the
.vpc
file extension. These files work in conjunction with the VPC command line to generate the projects. These files is where per-project properties are setup, pre-processor definitions set, what files to include in the given project, and even where the output should be directed to.
For those interested in editing or writing their own VPC scripts see /Syntax and Editing_VPC_scripts