|
| 1 | +# Building and Compiling C&C Generals on Visual Studio 2022 |
| 2 | + |
| 3 | +> [!WARNING] |
| 4 | +> This build guide refers to a fork that is not from TheSuperHackers. It may include additional modifications, software, |
| 5 | + and changes compared to the official TheSuperHackers version, and is included here for documentation purposes only. |
| 6 | + |
| 7 | +## Prerequisites |
| 8 | + |
| 9 | +- **Install Visual Studio 2022** |
| 10 | + Ensure that the necessary C++ development components, including MFC, are |
| 11 | + installed. |
| 12 | + |
| 13 | +- **Obtain the C&C Generals Source Code** |
| 14 | + Clone or download the source code repository: |
| 15 | + [jmarshall2323 VS2022 Fork](https://github.com/jmarshall2323/CnC_Generals_Zero_Hour.git). |
| 16 | + |
| 17 | +- **Install C&C Generals** |
| 18 | + The game installation is required to access the necessary asset files. |
| 19 | + |
| 20 | +- **Download the necessary SDKs as needed** |
| 21 | + 3ds max sdk: [3ds-max sdk](https://archive.org/details/maxsdk-4.2.0.85). |
| 22 | + Download and extract the contents of the zip file to the folder |
| 23 | + `/Code/Libraries/max4sdk` |
| 24 | + |
| 25 | +## Build Steps |
| 26 | + |
| 27 | +### 1. Copy Required Game Assets |
| 28 | + |
| 29 | +- Navigate to your C&C Generals installation directory, for example if using Steam: |
| 30 | + |
| 31 | + ``` text |
| 32 | + C:\Program Files (x86)\Steam\steamapps\common\Command and Conquer Generals |
| 33 | + ``` |
| 34 | + |
| 35 | +- Copy all necessary `.BIG` files into the `Run` folder of your compiled project: |
| 36 | + |
| 37 | + ``` text |
| 38 | + EnglishZH.big |
| 39 | + Generals.big |
| 40 | + INIZH.big |
| 41 | + SpeechZH.big |
| 42 | + W3DZH.big |
| 43 | + (Other required files) |
| 44 | + ``` |
| 45 | + |
| 46 | +- Copy the entire `Data` folder to the `Run` folder as well. |
| 47 | + |
| 48 | +### 2. Open the Project in Visual Studio 2022 |
| 49 | + |
| 50 | +- Launch Visual Studio 2022 and open the solution file `Code/RTS.sln`. |
| 51 | + |
| 52 | +### 3. Set up Paths correctly |
| 53 | + |
| 54 | +- Add to your PATH environment variable the following folder: `<base_git_folder>\Code\Tools\NVASM` |
| 55 | +- Load the RTS.sln Solution file in Visual Studio. |
| 56 | +- Navigate to the max2w3d project folder in \toolchain\max2w3d |
| 57 | +- Right-click on the project and select Properties. |
| 58 | +- In the VC++ Directories tab, update the Additional Include Directories to the SDK Includes |
| 59 | + Folder (ie <base_git_folder>\Code\Libraries\max4sdk\Include) |
| 60 | +- And the same tab, update the Additional Library Directories to the |
| 61 | + SDK Libraries Folder (ie <base_git_folder>\Code\Libraries\max4sdk\Lib) |
| 62 | +- Navigate to **Properties** → **Debugging**. |
| 63 | +- Set `Working Directory` to your `Run` folder. |
| 64 | + |
| 65 | +>[!NOTE] |
| 66 | +>Ensure that the `Run` folder within your build directory contains all required game assets. |
| 67 | +
|
| 68 | +### 4. Select and Compile the Required Projects |
| 69 | + |
| 70 | +- In the **Solution Explorer**, locate the following projects: |
| 71 | + - `RTS` |
| 72 | + - `WorldBuilder` |
| 73 | +- Right-click each project and select **Build**. |
| 74 | +- Ensure the build process completes without errors. |
| 75 | + |
| 76 | +### 5. Run the Game or World Builder |
| 77 | + |
| 78 | +- After compiling, navigate to the `Run` folder. |
| 79 | +- Launch `RTSD.exe` or `worldbuilder.exe`. |
| 80 | + |
| 81 | +## Troubleshooting |
| 82 | + |
| 83 | +- **Missing DLLs?** Ensure that all required dependencies are installed. |
| 84 | +- **Game not launching?** Verify that all necessary `.BIG` files are correctly |
| 85 | + placed. |
| 86 | +- **Build errors?** Check Visual Studio settings and dependencies for any issues. |
| 87 | + |
| 88 | +### Enjoy Modding and Playing C&C Generals! 🎮 |
0 commit comments