You can't debug mode is pretty much broken, for a bit i had it placing units that I could control. However after that, all units default to AI. Sigh.
Also the way civ5 does gold, is kinda tricky to trackdown with tsearch, i know the following:
At the start of the game gold is stored as a...