VPC Scripts: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(added relevant software tags)
mNo edit summary
 
Line 6: Line 6:
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|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.
{{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.


Line 20: Line 20:
However this is not the only way to utilize VPC.
However this is not the only way to utilize VPC.


=== VPC Script Files ===
===VPC Script Files===
{{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.
{{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]] and [[Editing_VPC_scripts]]
For those interested in editing or writing their own VPC scripts see [[/Syntax]] and [[Editing VPC scripts]]

Latest revision as of 14:26, 29 July 2025

VPC VPC (or VPC Valve Project Creator) is a a command line tool that ships with the "SDKImg" Source SDK. This tool is used for constructing Visual Studio Visual Studio projects (.vcproj) with consistent project properties.

The Source 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 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 "SDKImg" 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 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