op2_sdk:projectsettings

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
op2_sdk:projectsettings [2016/02/29 19:55] vagabondop2_sdk:projectsettings [2016/11/03 17:40] (current) – Moved Debuging Scenario information to a separate wiki page. vagabond
Line 11: Line 11:
   - Open your Project in Visual Studio.   - Open your Project in Visual Studio.
   - In the solution explorer, right click on your project -> Properties.   - In the solution explorer, right click on your project -> Properties.
-  - Click Configuration Properties -> General -> Target Name. Update the name as you see fit. +  - Set Configuration to All Configurations. 
 +  - Set Platform to All Platforms. 
 +  - Click Configuration Properties -> General -> Target Name. Update the name as you see fit. //(The Target Name should not include the file extension).//
  
 {{ op2_sdk:projectsettings:changing_project_target_name_visual_studio_2015.png }} {{ op2_sdk:projectsettings:changing_project_target_name_visual_studio_2015.png }}
Line 22: Line 24:
  
 Visual Studio uses macros in pre and post build events to simplify commands. For example ''$(TargetName)'' represents the target filename minus its extension. A list of macros can be found here: [[https://msdn.microsoft.com/en-us/library/c02as0cs.aspx]]. Visual Studio uses macros in pre and post build events to simplify commands. For example ''$(TargetName)'' represents the target filename minus its extension. A list of macros can be found here: [[https://msdn.microsoft.com/en-us/library/c02as0cs.aspx]].
 +
 +A vanilla copy of the current Outpost 2 release is kept in the repository at ''Outpost2SVN\GameDownload\Outpost2\Trunk''. It is recommended to target this copy of Outpost 2 for testing. If placing the scenario on the SVN, the post build event's output path should be similar to ''..\..\..\..\GameDownload\Outpost2\trunk\''. This allows post build events to work on other computers where the repository is downloaded without changing the destination of post build event copies.
 +
 +**Example Post Build copy commands:** 
 +
 +  * copy /Y "$(TargetPath)" "..\..\..\..\GameDownload\Outpost2\trunk\$(TargetFilename)"
 +  * copy /Y "$(ProjectDir)Ashes.map" "..\..\..\..\GameDownload\Outpost2\trunk\Ashes.map"
 +  * copy /Y "$(ProjectDir)multitekNoLavaWalls.txt" "..\..\..\..\GameDownload\Outpost2\trunk\multitekNoLavaWalls.txt"
 +
 +**Setting Post Build Event Instructions**
  
   - In the Solution Explorer, right click on the project you wish to include a post build event and click on properties.   - In the Solution Explorer, right click on the project you wish to include a post build event and click on properties.
 +  - Set Configuration to All Configurations.
 +  - Set Platform to All Platforms.
   - Click Configuration Properties -> Build Events -> Post-Build Event.   - Click Configuration Properties -> Build Events -> Post-Build Event.
   - Set the Command Line to perform a copy event.   - Set the Command Line to perform a copy event.
   - Repeat for each file you want copied to the new directory.   - Repeat for each file you want copied to the new directory.
  
-If placing a project into the Outpost2SVNcopy your output files into the repository's Outpost 2 game folder using a relative path. This allows post build events to work on other computers where the repository is downloaded without changing the destination of post build event copies. +**Note:** //Before committing new project to the repositoryturn the post build events into remarks by prefixing them with the rem keyword. This prevents the post build events from executing unless the user downloading your source code explicitly wants them.//
- +
-  * See the Outpost 2 game on the repository at Outpost2SVN/GameDownload/Trunk.  +
-  * For an output path example, use a path similar to ''..\..\..\..\GameDownload\Outpost2\trunk\''.+
  
 **Note:** //In the copy command, the ''/Y'' instructs the copy command to overwrite existing files. Place the original file first and the location you want the file copied to second.// **Note:** //In the copy command, the ''/Y'' instructs the copy command to overwrite existing files. Place the original file first and the location you want the file copied to second.//
Line 43: Line 54:
 ===== Referencing the Outpost 2 executable ===== ===== Referencing the Outpost 2 executable =====
  
-Executable files can be referenced from within Visual Studio. This allows running Outpost 2 from within Visual Studio when testing a mission DLL. An alternative option to referencing Outpost2.exe as another project within the solution would be to set Outpost2.exe as the startup executable for the scenario DLL project.+Executable files can be referenced from within Visual Studio. This allows running Outpost 2 from within Visual Studio when testing a mission DLL.  
 + 
 +An alternative option to referencing Outpost2.exe within the solution is to set Outpost2.exe as the startup executable for the scenario DLL. To do this, set Outpost 2 as the external executable under the DLL project's debug settings.
  
 To add the Outpost 2 executable as an existing project to a Visual Studio Solution. To add the Outpost 2 executable as an existing project to a Visual Studio Solution.
Line 57: Line 70:
  
 ----  ---- 
- + - //Go Back to [[op2_sdk:software_development_kit_sdk|Outpost 2 Software Development Kit (SDK)]]//\\
-===== Debugging Custom Mission DLLs ===== +
- +
-Since we do not have access to the Outpost 2 source code or program debug database (PDB file), we cannot step through the Outpost 2 executable code or compare the stack trace with source code. However, we can still debug custom scenario DLLs. +
- +
-In order to debug your DLL, follow the required steps from previous sections to ensure a copy of all required files (mission DLL, MAP file, tech tree file, etc) are contained in the Outpost 2 root directory. Then ensure your Visual Studio project is linked to Outpost 2.  +
- +
-  - Recompile your project if needed. +
-  - Set a break point where you want to examine the code or perform whatever other debugging action. +
-  - Press Start Debugging (or hit F5). Outpost 2 should load normally. Once Outpost 2 accesses your DLL, Visual Studio should pause the program at the break point and let you examine the stack trace. +
- +
-{{ op2_sdk:projectsettings:breakpoint_hit_visual_studio_2015.png }} +
- +
-**Note:** //The Visual Studio must have access to your scenario's PDB (Program Debug Database) file for debugging. The PDB file is rebuilt every time you recompile a scenario. Visual Studio will automatically find the PDB file in your project directories and copying the PDB to the Outpost 2 directory is not required.// +
- +
-----  +
- - //Go Back to [[op2_sdk:software_development_kit_sdk|Outpost 2 Mapmaking]]//\\+
  - //Go Back to [[outpost_2:outpost_2|Outpost 2 Main page]]//\\  - //Go Back to [[outpost_2:outpost_2|Outpost 2 Main page]]//\\
- - //Go Back to [[http://wiki.outpostuniverse.org/doku.php?id=start|Wiki Home Page]]//+ - //Go Back to [[http://wiki.outpost2.net/doku.php?id=start|Wiki Home Page]]//
  
  • op2_sdk/projectsettings.1456775708.txt.gz
  • Last modified: 2016/02/29 19:55
  • by vagabond