Share Files Between Projects
In the creation of a mod, sometimes it is necessary to have a "global" file that both the "client" and "hl" projects can use. To set a file that can be updated from both projects, just follow these steps:
- Browse to your mod folder, e.g. C:\MyMods\Mod\ and go to the src directory. In this example, we are going to open the game_shared directory and create a new .cpp file.
- Create a text file by right-clicking the folder and clicking New -> Text Document. Rename it mysharedfile.cpp.
- Open up the solution file game.sln in VS.NET.
- Under the client project create a new folder under Source Files. Name it mod or whatever you prefer.
- Right-click the "mod" folder and select Add -> Add Existing Item.
- Browse to your C:\MyMod\Mod\src\game_shared directory and find mysharedfile.cpp. Double-click it to add it to your project.
- Repeat steps 4-6 for the hl project.
The point of doing this is that both projects now share the same file. This means it does NOT matter which project you use to edit your file, they will be updated and compiled by both. You can use this method for any type of file you want to share.