Home » MODDING HQ 1.13 » v1.13 General Development Talk » Guide to debugging?
Guide to debugging?[message #337123] Sat, 25 October 2014 01:16 Go to next message
perpetual
Messages:4
Registered:October 2014
Location: United States
Hi,

I couldn't find any information about debugging the game. I've built from source using VS2010.

I want to change the the CTH system used in an ongoing campaign, which Flugente mentioned required debugging the game and changing values while running.

Any info on this would be greatly appreciated!
Re: Guide to debugging?[message #337131] Sat, 25 October 2014 13:05 Go to previous messageGo to next message
silversurfer

 
Messages:2112
Registered:May 2009
First you need to build a debug exe. Then you will need to run it from VS2010 (F5 or the Play button at the toolbar). I usually run the game in windowed mode for debugging so I can easily switch between applications.

To change any value you need to have a breakpoint in the code where code execution will halt and allow you to modify data. The easiest spot for your task is probably the end of function "LoadSavedGame" in "SaveLoadGame.cpp". Line 6442 (current development build 7606) contains a "return( TRUE );" statement where you set your breakpoint. Then you load your savegame and the game will break at this breakpoint.

Now in the "Watch" window you add the variable "gGameOptions.fUseNCTH". It will show you the current value next to it. 0 stands for OCTH system, 1 is for NCTH. Set whatever you like and press F5 to continue. Save your game and quit.

Now you can continue playing with the standard release exe.

Re: Guide to debugging?[message #337267] Tue, 28 October 2014 06:35 Go to previous messageGo to next message
perpetual
Messages:4
Registered:October 2014
Location: United States
Thanks for the detailed info, got it working. Cool stuff!
Re: Guide to debugging?[message #348907 is a reply to message #337131] Sat, 18 February 2017 08:10 Go to previous message
Slugg087
Messages:2
Registered:February 2017
Location: Sweden
I´m gonna necro this post since i also want to change to OCTH. I am not a programmer, i´ve just downloaded VS2010 just for this purpose. Exacly how do i build the debug.exe file?
Previous Topic: Which 1.13 to install?
Next Topic: Weapon status
Goto Forum:
  


Current Time: Wed Jun 28 18:56:21 EEST 2017

Total time taken to generate the page: 0.00796 seconds