modding code to accept my gun controller input

Started by
3 comments, last by GrassRoots 16 years, 4 months ago
Hi folks, I have a gun controller prototype that is pretty cool. I want to use it in a mod, preferably BF2. The system mouse-cursor is line of sight...I want the target reticle (or no reticle is fine) to appear wherever the mouse coordinates are set by my parent c++ program. Can anyone suggest, short of learning how to develop a game, the most efficient means to doing this? GR
Advertisement
The hardest, but probably most elegant and useful way would be to create a mouse driver for it. If you want to do this you'll need to get hold of the Windows DDK (which is on MSDN somewhere). Then once you've got this working you can use your controller in any game you want.

Another option may be to intercept Direct Input calls and modify the mouse coordinates, this article may be of some help. This is the kind of thing that may set off a game's anti-cheat protection however (as an Aimbot would do a similar thing).

Actually simply finding out how Aimbots work would be useful. I'm sure you can find plenty of info on the net (as well as some sample code you could modify).
>>Then once you've got this working you can use your controller in any game you want.

Thanks for the reply. Its a good start. However, most games if you move the mouse controller, the center reticle doesn't change (it's centered) the POV does in FPS. What has to change in the game so that if I point here and there with my controller the gun reticle will go there without changing the POV. In other words histrocially FPS games have bundled direction of fire and direction of movement together. This concept would unbundle them, where you would have to move with one control mechanism and aim the gun with another...Furthermore, my controller input is already sensed by Joint Ops (for example) - anywhere I point, the game interprets this as mouse input. What ends up happening is I can control the POV with the gun controller but not where the gun is aimed. I've tried mouse look with JO but no luck so far. Is there a different game that would allow me to utilize the free look approach better?
Ahh sorry, misread your first post. There's no simple way to do what you want if you want to play with that kind of thing your best option would be to get a game that is moddable (such as HL2) and write a mod that allows you to target independent of where you are looking. Precisely how you'd accomplish this depends upon the game.
So it is possible to mod it to seperate the two....I was thinking of BF2...

This topic is closed to new replies.

Advertisement