|
What you do is build a dynamic library in any language you're happy with. Rename the .dll file to .asi, and place it in the same directory as SA executable. The .asi files get loaded when the game starts, allowing you to perform some actions with DllMain. Since the library will be loaded in the same virtual memory space as the game, it will have access to all of the variables, including player location. At this point, all you have to do is look up the virtual address for the variable you're interested in and read it.
Of course, the DllMain will only run once. If you want your code executed while the game runs, you must hook into the code. There are several ways to do that. From .asi you can replace callbacks to intercept key strokes and such. So if you want your code executed on key stroke, that's the easiest way. You can also hook into game's function calls, but you need to know a bit of assembly for that. Finally, you can create a fake d3d9.dll, which lets you hook into any graphics call. If you want your code executed per-frame, it's a good way to do that, but you need to understand a bit of DirectX programming for that.
|