Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revisionLast revisionBoth sides next revision | ||
op2_sdk:projectcreation [2016/10/06 03:16] – [Create a New Scenario from Scratch] vagabond | op2_sdk:projectcreation [2021/03/06 21:19] – [Create a New Project through SVN Copy] vagabond | ||
---|---|---|---|
Line 15: | Line 15: | ||
===== Download the Outpost 2 SDK from the Outpost Repository ===== | ===== Download the Outpost 2 SDK from the Outpost Repository ===== | ||
- | First, you will need a copy of the Outpost 2 SDK. The most up to date version of the Outpost 2 SDK is stored | + | First, you will need a copy of the Outpost 2 SDK. The most up to date version of the Outpost 2 SDK is stored |
- | + | ||
- | A scenario template hooked into a standalone copy of the SDK is also kept on Redmine to simplify development if you are not ready to download the repository. If interested in accessing Redmine, see the [[opu: | + | |
===== Create a New Project through SVN Copy ===== | ===== Create a New Project through SVN Copy ===== | ||
- | |||
- | The recommended way to start a new Outpost 2 scenario is by using Subversion (SVN) copy to create a copy of an existing template. Starting templates of scenarios can be found on the repository at [[https:// | ||
The benefits of using SVN copy is that a link between the original template and the new scenario is maintained in the repository. The majority (if not all) the project and solution properties will already be preset to the correct values. SVN copy will also be faster then creating a new blank project and setting all the values manually. | The benefits of using SVN copy is that a link between the original template and the new scenario is maintained in the repository. The majority (if not all) the project and solution properties will already be preset to the correct values. SVN copy will also be faster then creating a new blank project and setting all the values manually. | ||
Line 63: | Line 59: | ||
**Note:** //Creating a new project also creates a solution. A solution is a group of related projects. At this point, you will only have the 1 project you created in your solution.// | **Note:** //Creating a new project also creates a solution. A solution is a group of related projects. At this point, you will only have the 1 project you created in your solution.// | ||
+ | |||
+ | ===== Setting Project Properties ===== | ||
+ | |||
+ | Visual Studio defaults to compiling a project into an executable. Outpost 2 scenarios are compiled as Dynamic Link Libraries (DLL), and this must be set in the project properties. | ||
+ | |||
+ | - Right click on your scenario' | ||
+ | - Set Configuration to All Configurations | ||
+ | - Set Platform to All Platforms | ||
+ | - Click Properties -> Configuration Properties -> General. | ||
+ | - Set Configuration Type to Dynamic Library (.dll). | ||
===== Including Other Projects in Solution ===== | ===== Including Other Projects in Solution ===== | ||
Line 86: | Line 92: | ||
- Ensure the project is included in the scenario (see above). | - Ensure the project is included in the scenario (see above). | ||
- | - In the Solution Explorer, expand your custom mission | + | - In the Solution Explorer, expand your custom mission |
- Right Click on References -> Add Reference. | - Right Click on References -> Add Reference. | ||
- Select all projects your scenario will depend on, usually Outpost2DLL and OP2Helper. | - Select all projects your scenario will depend on, usually Outpost2DLL and OP2Helper. | ||
Line 112: | Line 118: | ||
After adding references to the other projects that your scenario will depend on, you usually also need to add an additional include directory to your main project that locates the referenced projects. This helps Visual Studio locate source code from the other projects. | After adding references to the other projects that your scenario will depend on, you usually also need to add an additional include directory to your main project that locates the referenced projects. This helps Visual Studio locate source code from the other projects. | ||
+ | |||
+ | **Note:** //Visual Studio does not show the C/C++ compiler options folder in the project properties until a .cpp file is contained within the project. If your project does not yet contain a .cpp file, ensure you add one before continuing (typically named main.cpp).// | ||
**Adding Additional Include Directories** | **Adding Additional Include Directories** | ||
Line 127: | Line 135: | ||
When a new project is created in Visual Studio, a solution is also created. Within the solution, 2 default configurations are available, Debug and Release. While more custom configurations can be created, these 2 configurations are typically adequate for creating Outpost 2 scenarios. | When a new project is created in Visual Studio, a solution is also created. Within the solution, 2 default configurations are available, Debug and Release. While more custom configurations can be created, these 2 configurations are typically adequate for creating Outpost 2 scenarios. | ||
- | If you plan on using Visual Studio' | + | If you plan on using Visual Studio' |
If debug tools are unnecessary in a scenario' | If debug tools are unnecessary in a scenario' | ||
Line 166: | Line 174: | ||
- From Visual Studio, right click on your project in the Solution Explorer. | - From Visual Studio, right click on your project in the Solution Explorer. | ||
+ | - Set Configuration to All Configurations. | ||
+ | - Set Platform to All Platforms. | ||
- Select Properties -> Linker -> Advanced. | - Select Properties -> Linker -> Advanced. | ||
Line 200: | Line 210: | ||
---- | ---- | ||
- | - //Go Back to [[op2_sdk: | + | - //Go Back to [[op2_sdk: |
- //Go Back to [[outpost_2: | - //Go Back to [[outpost_2: | ||
- | - //Go Back to [[http:// | + | - //Go Back to [[http:// |