Author Topic: Multiple Questions Asked  (Read 17193 times)

Offline Hidiot

  • Hero Member
  • *****
  • Posts: 1018
Multiple Questions Asked
« Reply #75 on: September 22, 2008, 07:37:17 AM »
[size=8]Yay! for double posting![/size]

Now that we have the mighty svn, this topic will pretty much be a good place for me to leave a question I might forget later.

For instance: I need something to tell me the current power unused. If there's no direct way for it, then something to read the total power production and total power usage would do good.

I guess I could go check for every power generating building, then check for upgrades made on it, then check all the buildings what they are and how much they consume, but that'd be just too tedious and plain silly.
« Last Edit: September 22, 2008, 07:38:20 AM by Hidiot »
"Nothing from nowhere, I'm no one at all"

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Multiple Questions Asked
« Reply #76 on: September 22, 2008, 05:06:42 PM »
Plus, those values are already calculated by the game. You can just read them with a mem hack pointer trick. You can find the details you need in the Forced Exports project headers, or even just use the project itself. It might be easier to just code up a pointer hack in one line of code though. The project needs NASM installed to build it.

Anyways, in that project, check Player.h, for both the base address of the player array, the size of the Player class, and the offset within the class of the field you want. The address would then be: base + size*playerNum + offset.